Closed gerritzen closed 1 year ago
I encountered a separate issue with cmake. The file cmake/NESTConfig.cmake.in
has the following line
23 set(NEST_LIBRARIES @NEST_LIBRARY_TARGETS@)
which expands to
set(NEST_LIBRARIES NEST::Core NEST::NESTG4)
However, the auto-generated NESTTargets.cmake
does not define a library NEST::Core, but only NEST::NESTCore. That also makes the check in NESTConfig.cmake.in:19
pointless.
A quick fix would be to change line 76 in CMakeLists.txt to:
list(APPEND NEST_LIBRARY_TARGETS "NEST::NESTCore")
and change line 19 in NESTConfig.cmake.in
(if the check is even needed).
My proposal for a better solution would be to use the exported targets directly rather than the variable NEST_LIBRARIES
. That would also make all the aliasing in the cmake files unnecessary and the libraries can just be referred to by their names. I made some changes in a fork I'll create a PR in a few minutes in case the second solution is preferred.
I believe this is now fixed? @gerritzen?
Hello,
I am trying to include NEST in another CMake project, specifically the LXe example in Geant4.
The current instructions in the NEST project documentation suggest using the -DNEST_DIR variable when configuring with CMake to locate the NEST installation directory:
However, the NESTConfig.cmake file is located in a subdirectory of the installation directory:
[path to NEST install directory]/lib64/cmake/NEST
. As a result, cmake does not find theNESTConfig.cmake
.Unless I was doing something fundamentally wrong, I see two solutions to the problem:
The second option would also allow to find gcem, but I am not sure if this is intended.
My setup:
Thank you for your consideration.