mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 08:08:24 -05:00
GNUInstallDirs: Fix regression on -DCMAKE_INSTALL_<dir>=<default>
In commit42dfcbf1a5(GNUInstallDirs: Refactor LIBDIR default calculation, 2025-03-27, v4.1.0-rc1~384^2~2) we introduced the `_GNUInstallDirs_LIBDIR_get_default` helper and exercised code from commit9789f7d05e(GNUInstallDirs: Add internal helper to compute specific defaults, 2025-03-28, v4.1.0-rc1~384^2~3) for the first time. Fix the latter's code to update the `CMAKE_INSTALL_<dir>` cache entry without triggering conversion of a relative path to an absolute path. Fixes: #27027
This commit is contained in:
@@ -279,7 +279,10 @@ function(_GNUInstallDirs_cache_path var description)
|
||||
# the old default, reset the value to the new default
|
||||
if(${cmake_install_var} STREQUAL "$CACHE{${cmake_install_var}}"
|
||||
AND ${cmake_install_var} STREQUAL last_default)
|
||||
set(${cmake_install_var} "${default}" CACHE PATH "${full_description}" FORCE)
|
||||
set(full_description "${description} (${default})")
|
||||
set_property(CACHE ${cmake_install_var} PROPERTY TYPE PATH)
|
||||
set_property(CACHE ${cmake_install_var} PROPERTY VALUE "${default}")
|
||||
set_property(CACHE ${cmake_install_var} PROPERTY HELPSTRING "${full_description}")
|
||||
endif()
|
||||
# Continue to normal flow
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user