summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-09-26 18:13:38 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-15 14:46:54 (GMT)
commitc9a5f34bd7d35ebf8a4a326481ce22e809de8e4c (patch)
tree386404512d4f6723701ddd096aea5f3e41e389ad /CMakeLists.txt
parentc72f8513f7adc764aafd94f2deb9071ee1f261d9 (diff)
downloadCMake-c9a5f34bd7d35ebf8a4a326481ce22e809de8e4c.zip
CMake-c9a5f34bd7d35ebf8a4a326481ce22e809de8e4c.tar.gz
CMake-c9a5f34bd7d35ebf8a4a326481ce22e809de8e4c.tar.bz2
Cleanup use of CMake version in install destinations
Factor the CMAKE_DATA_DIR, CMAKE_DOC_DIR, and CMAKE_MAN_DIR selection out of CMakeLists.txt and into a Source/CMakeInstallDestinations.cmake script. Load the script from the original location of the code. Cache the destination values as empty strings so we know if the user sets them explicitly. If not, then compute defaults based on the platform and full CMake version string. By not caching the versioned defaults, we can change them in a single build tree as the version changes. Remove duplication of the install destination defaults from the bootstrap script. Cache empty defaults there too. Parse from the CMake code the default values to report in the help output. Keep the CMake code in a structured format to make this reliable.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 2 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9204026..3ad2d24 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -432,27 +432,8 @@ set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
# install tree.
set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
-set(CMAKE_DATA_DIR "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
- "Install location for data (relative to prefix).")
-set(CMAKE_DOC_DIR "doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
- "Install location for documentation (relative to prefix).")
-set(CMAKE_MAN_DIR "man" CACHE STRING
- "Install location for man pages (relative to prefix).")
-mark_as_advanced(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
-if(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
- # Force doc, data and man dirs to conform to cygwin layout.
- set(CMAKE_DOC_DIR "share/doc/cmake-${CMake_VERSION}")
- set(CMAKE_DATA_DIR "share/cmake-${CMake_VERSION}")
- set(CMAKE_MAN_DIR "share/man")
- # let the user know we just forced these values
- message(STATUS "Setup for Cygwin packaging")
- message(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
- message(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
- message(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
-endif()
-string(REGEX REPLACE "^/" "" CMAKE_DATA_DIR "${CMAKE_DATA_DIR}")
-string(REGEX REPLACE "^/" "" CMAKE_DOC_DIR "${CMAKE_DOC_DIR}")
-string(REGEX REPLACE "^/" "" CMAKE_MAN_DIR "${CMAKE_MAN_DIR}")
+# Load install destinations.
+include(Source/CMakeInstallDestinations.cmake)
if(BUILD_TESTING)
include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)