Skip to content

Commit

Permalink
Fix linking against external CoreNEURON libraries. (#1107)
Browse files Browse the repository at this point in the history
* When CoreNEURON is built as a submodule NEURON takes the variable
   CORENEURON_LIB_LINK_FLAGS from a global property of the same name.
* If CoreNEURON is built as an external library this variable will [soon] be
  exported in coreneuron-config.cmake and should not be overwritten by the
  (empty) property value.
  • Loading branch information
olupton authored and alexsavulescu committed Apr 13, 2021
1 parent b571df7 commit 88e0e42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,11 @@ if(NRN_ENABLE_CORENEURON)
set(CORENEURON_DIR ${PROJECT_SOURCE_DIR}/external/coreneuron)
# By default `nrnivmodl` should look for `nrnivmodl-core` in the NEURON install prefix.
set(cnrn_prefix "${CMAKE_INSTALL_PREFIX}")
# CoreNEURON exports this list of flags as a property; turn it into a
# variable in this scope. If CoreNEURON is installed externally then this
# is exported into coreneuron-config.cmake.
get_property(CORENEURON_LIB_LINK_FLAGS GLOBAL PROPERTY CORENEURON_LIB_LINK_FLAGS)
endif()
get_property (CORENEURON_LIB_LINK_FLAGS GLOBAL PROPERTY CORENEURON_LIB_LINK_FLAGS)
set(NRN_ENABLE_BINARY_SPECIAL ON)
endif()

Expand Down
1 change: 0 additions & 1 deletion cmake/NeuronTestHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ function(nrn_add_test)
)
endif()
list(APPEND nrnivmodl_dependencies ${CORENEURON_BUILTIN_MODFILES})
message(STATUS nrnivmodl_dependencies ${nrnivmodl_dependencies})
endif()
add_custom_command(
OUTPUT ${output_binaries}
Expand Down

0 comments on commit 88e0e42

Please sign in to comment.