@@ -190,8 +190,6 @@ set_target_properties(coreneuron corenrnmech scopmath ${link_cudacoreneuron}
190190add_custom_command (TARGET coreneuron
191191 POST_BUILD
192192 COMMAND ${CMAKE_BINARY_DIR} /bin/nrnivmodl-core
193- -i "-I${CORENEURON_PROJECT_SOURCE_DIR} -I${CORENRN_NMODL_INCLUDE} "
194- -m "${CORENRN_NMODL_BINARY} "
195193 ${CORENEURON_PROJECT_SOURCE_DIR} /tests/integration/ring_gap/mod
196194 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} /bin
197195 BYPRODUCTS ${CMAKE_BINARY_DIR} /bin/${CMAKE_SYSTEM_PROCESSOR} /special-core
@@ -224,19 +222,28 @@ set(CORENRN_LINK_LIBS "${CORENRN_LINK_LIBS}" PARENT_SCOPE)
224222# =============================================================================
225223# Copy files for nrnivmodl-core workflow during build time
226224# =============================================================================
227- configure_file (${MODFUNC_PERL_SCRIPT} ${CMAKE_BINARY_DIR} /share/coreneuron/mod_func.c.pl @ONLY)
228- configure_file (${KINDERIV_PYTHON_SCRIPT} ${CMAKE_BINARY_DIR} /share/coreneuron/kinderiv.py)
229- configure_file (${DIMPLIC_CODE_FILE} ${CMAKE_BINARY_DIR} /share/coreneuron/dimplic.cpp)
230- configure_file (${ENGINEMECH_CODE_FILE} ${CMAKE_BINARY_DIR} /share/coreneuron/enginemech.cpp)
231225
232- configure_file ("engine.h" ${CMAKE_BINARY_DIR} /include /coreneuron/engine.h)
233- configure_file ("enginemech.h" ${CMAKE_BINARY_DIR} /include /coreneuron/enginemech.h)
226+ configure_file (${MODFUNC_PERL_SCRIPT} ${CMAKE_BINARY_DIR} /share/coreneuron/mod_func.c.pl COPYONLY )
227+ configure_file (${KINDERIV_PYTHON_SCRIPT} ${CMAKE_BINARY_DIR} /share/coreneuron/kinderiv.py COPYONLY )
228+ configure_file (${DIMPLIC_CODE_FILE} ${CMAKE_BINARY_DIR} /share/coreneuron/dimplic.cpp COPYONLY )
229+ configure_file (${ENGINEMECH_CODE_FILE} ${CMAKE_BINARY_DIR} /share/coreneuron/enginemech.cpp COPYONLY )
230+
231+ # Make headers avail to build tree
232+ file (GLOB_RECURSE main_headers RELATIVE "${CMAKE_CURRENT_SOURCE_DIR} " *.h *.hpp *.ispc)
233+ foreach (header ${main_headers} )
234+ configure_file ("${header} " "${CMAKE_BINARY_DIR} /include/coreneuron/${header} " COPYONLY )
235+ endforeach ()
234236configure_file ("utils/profile/profiler_interface.h"
235- ${CMAKE_BINARY_DIR} /include /coreneuron/nrniv/profiler_interface.h)
236- configure_file ("mechanism/nrnoc_ml.ispc" ${CMAKE_BINARY_DIR} /include /coreneuron/mechanism/nrnoc_ml.ispc)
237+ ${CMAKE_BINARY_DIR} /include /coreneuron/nrniv/profiler_interface.h COPYONLY )
237238
238- # TODO : this doesn't get re-copied if source changes
239- file (COPY "utils/randoms" DESTINATION ${CMAKE_BINARY_DIR} /include /coreneuron/utils)
239+ if (NOT CORENRN_ENABLE_NMODL)
240+ # MOD2C puts UNITS_FILE in share, but we need to see it in share/mod2c
241+ # We create a link since we know neither the source location nor when its copied
242+ FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR} /share/mod2c/" )
243+ ADD_CUSTOM_TARGET (link_units ALL
244+ COMMAND ${CMAKE_COMMAND} -E create_symlink
245+ "${NMODL_UNITS_FILE} " "${CMAKE_BINARY_DIR} /share/mod2c/nrnunits.lib" )
246+ endif ()
240247
241248# main program required for building special-core
242249file (COPY apps/coreneuron.cpp DESTINATION ${CMAKE_BINARY_DIR} /share/coreneuron)
0 commit comments