Open YanzhaoW opened 1 month ago
It seems the precedence of which CMAKE_INSTALL_PREFIX
value is taken is determined by the command-line argument order, try
cmake -S . -B ./build -C ./FairSoftConfig.cmake -DCMAKE_INSTALL_PREFIX=/opt/FairSoft/jan24p2
I think the problem is caused by this line: https://github.com/FairRootGroup/FairSoft/blob/5537f58e609219ec54b32fb766d7d705c7bef399/FairSoftConfig.cmake#L17
I feel this is a bit anti-pattern to hard-code a common cache variable in the script.
What's the problem to just set it without FORCE
?
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install" CACHE PATH "Install prefix")
Then if a user provides any CMAKE_INSTALL_PREFIX
by setting the flag in any position, this line will not overwrite the value.
I have no objections against removing the FORCE
if that helps.
Hi,
I'm installing FairSoft-jan24p2. After unzipping the tar bar downloaded from the release page and configure the cmake with:
The print out from the CMake still has:
which shows the install prefix is pointing to the default location, instead of the new location specified from the command line.