mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-15 11:10:19 -06:00
Source: Factor out common parts of install layout variable loop item names
This commit is contained in:
@@ -36,24 +36,24 @@ set_property(CACHE CMake_INSTALL_INFIX PROPERTY HELPSTRING
|
|||||||
mark_as_advanced(CMake_INSTALL_INFIX)
|
mark_as_advanced(CMake_INSTALL_INFIX)
|
||||||
|
|
||||||
foreach(v
|
foreach(v
|
||||||
CMAKE_BIN_DIR
|
BIN
|
||||||
CMAKE_DATA_DIR
|
DATA
|
||||||
CMAKE_DOC_DIR
|
DOC
|
||||||
CMAKE_INFO_DIR
|
INFO
|
||||||
CMAKE_MAN_DIR
|
MAN
|
||||||
CMAKE_XDGDATA_DIR
|
XDGDATA
|
||||||
)
|
)
|
||||||
# Populate the cache with empty values so we know when the user sets them.
|
# Populate the cache with empty values so we know when the user sets them.
|
||||||
set(${v} "" CACHE STRING "")
|
set(CMAKE_${v}_DIR "" CACHE STRING "")
|
||||||
set_property(CACHE ${v} PROPERTY HELPSTRING
|
set_property(CACHE CMAKE_${v}_DIR PROPERTY HELPSTRING
|
||||||
"Location under install prefix for ${${v}_DESC} (default \"${${v}_DEFAULT}\")"
|
"Location under install prefix for ${CMAKE_${v}_DIR_DESC} (default \"${CMAKE_${v}_DIR_DEFAULT}\")"
|
||||||
)
|
)
|
||||||
set_property(CACHE ${v} PROPERTY ADVANCED 1)
|
set_property(CACHE CMAKE_${v}_DIR PROPERTY ADVANCED 1)
|
||||||
|
|
||||||
# Use the default when the user did not set this variable.
|
# Use the default when the user did not set this variable.
|
||||||
if(NOT ${v})
|
if(NOT CMAKE_${v}_DIR)
|
||||||
set(${v} "${CMake_INSTALL_INFIX}${${v}_DEFAULT}")
|
set(CMAKE_${v}_DIR "${CMake_INSTALL_INFIX}${CMAKE_${v}_DIR_DEFAULT}")
|
||||||
endif()
|
endif()
|
||||||
# Remove leading slash to treat as relative to install prefix.
|
# Remove leading slash to treat as relative to install prefix.
|
||||||
string(REGEX REPLACE "^/" "" ${v} "${${v}}")
|
string(REGEX REPLACE "^/" "" CMAKE_${v}_DIR "${CMAKE_${v}_DIR}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|||||||
Reference in New Issue
Block a user