Fix handling of hh.mod
when using coreNEURON
#3301
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3000.
All mod files are first copied to the build dir (unless it's
hh.mod
in coreNEURON mode, in which case we modify the file) at configure time, then at build-time those files are actually converted tocpp
files and compiled.Unfortunately, one cannot use
file
at build-time, so we need to useadd_custom_command
with an external util (likesed
) for replacing_reg()
with_reg_()
in the generated cpp files (since those are actually generated only at build-time). I also opted for usingcmake -E copy
etc. for modifying the file because 1)sed '[pattern]' [input] > [output]
does not work, and 2) the default MacOSsed
has some idiosyncrasies compared to GNUsed
that I wanted to avoid.