diff --git a/src/nrnpython/CMakeLists.txt b/src/nrnpython/CMakeLists.txt index c0ac8ce0f0..880636c0ac 100644 --- a/src/nrnpython/CMakeLists.txt +++ b/src/nrnpython/CMakeLists.txt @@ -37,12 +37,13 @@ if(NRN_ENABLE_PYTHON_DYNAMIC) list(GET NRN_PYTHON_VERSIONS ${val} pyver) list(GET NRN_PYTHON_INCLUDES ${val} pyinc) list(GET NRN_PYTHON_LIBRARIES ${val} pylib) - make_nanobind_target(nanobind ${pyinc}) + set(nanobind_target "nanobind_py${pyver}") + make_nanobind_target(${nanobind_target} ${pyinc}) add_library(nrnpython${pyver} SHARED ${NRN_NRNPYTHON_SRC_FILES}) target_include_directories(nrnpython${pyver} BEFORE PUBLIC ${pyinc} ${INCLUDE_DIRS}) target_link_libraries(nrnpython${pyver} PUBLIC nrniv_lib) - target_link_libraries(nrnpython${pyver} PRIVATE ${Readline_LIBRARY} nanobind) + target_link_libraries(nrnpython${pyver} PRIVATE ${Readline_LIBRARY} ${nanobind_target}) if(NRN_LINK_AGAINST_PYTHON) target_link_libraries(nrnpython${pyver} ${pylib}) endif()