GNUInstallDirs: Make sure we test the CACHE variables

Signed-off-by: Cristian Le <git@lecris.dev>
This commit is contained in:
Cristian Le
2025-04-03 19:57:57 +02:00
parent 6bab9e3149
commit 489884fe8d

View File

@@ -18,8 +18,27 @@ set(dirs
SHAREDSTATEDIR
SYSCONFDIR
)
set(dependent_dirs
DATADIR
LOCALEDIR
DOCDIR
RUNSTATEDIR
)
# See special cases for these in GNUInstallDirs
if(NOT CMAKE_SYSTEM_NAME MATCHES "^(([^kF].*)?BSD|DragonFly)$")
list(APPEND dependent_dirs INFODIR)
endif()
if(NOT CMAKE_SYSTEM_NAME MATCHES "^(([^k].*)?BSD|DragonFly)$"
OR CMAKE_SYSTEM_NAME MATCHES "^(FreeBSD)$")
list(APPEND dependent_dirs MANDIR)
endif()
foreach(dir ${dirs})
message("CMAKE_INSTALL_${dir}='${CMAKE_INSTALL_${dir}}'")
if(dir IN_LIST dependent_dirs)
message("CMAKE_INSTALL_${dir}='${CMAKE_INSTALL_${dir}}'")
else()
message("CMAKE_INSTALL_${dir}='$CACHE{CMAKE_INSTALL_${dir}}'")
endif()
endforeach()
foreach(dir ${dirs})
message("CMAKE_INSTALL_FULL_${dir}='${CMAKE_INSTALL_FULL_${dir}}'")