Fixed an issue where CMAKE_INSTALL_PREFIX was not cached.

This commit is contained in:
Leon Styhre 2021-05-13 12:57:52 +02:00
parent f24b27c809
commit 12cc3b05b9

View file

@ -197,11 +197,11 @@ endif()
if(NOT WIN32 AND NOT APPLE) if(NOT WIN32 AND NOT APPLE)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_INSTALL_PREFIX "/usr") set(CMAKE_INSTALL_PREFIX "/usr" CACHE INTERNAL "CMAKE_INSTALL_PREFIX")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD") elseif(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
set(CMAKE_INSTALL_PREFIX "/usr/pkg") set(CMAKE_INSTALL_PREFIX "/usr/pkg" CACHE INTERNAL "CMAKE_INSTALL_PREFIX")
else() else()
set(CMAKE_INSTALL_PREFIX "/usr/local") set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE INTERNAL "CMAKE_INSTALL_PREFIX")
endif() endif()
endif() endif()
message("-- Installation prefix is set to " ${CMAKE_INSTALL_PREFIX}) message("-- Installation prefix is set to " ${CMAKE_INSTALL_PREFIX})