Shorten CMake version used in install destinations

Since commit c9a5f34b (Cleanup use of CMake version in install
destinations, 2013-09-26) we use the full CMake version in default
install destinations.  For rapidly changing versions of the form

 <major>.<minor>.<patch>.<date>-g<commit>[-dirty]

used by developers this is too granular.  Instead use just

 <major>.<minor>.<patch>

as the version for default install destinations.  This will still
be granular enough for unique directories in releases.

On Cygwin continue to use the full ${CMake_VERSION} as was the case
prior to the above-mentioned commit.
This commit is contained in:
Brad King 2013-10-25 08:55:50 -04:00
parent 8c0bbd37df
commit 1093deebd0
2 changed files with 12 additions and 4 deletions

View File

@ -1,13 +1,15 @@
# Keep formatting here consistent with bootstrap script expectations. # Keep formatting here consistent with bootstrap script expectations.
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION}") # OTHER
if(BEOS) if(BEOS)
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") # HAIKU
set(CMAKE_MAN_DIR_DEFAULT "documentation/man") # HAIKU set(CMAKE_MAN_DIR_DEFAULT "documentation/man") # HAIKU
set(CMAKE_DOC_DIR_DEFAULT "documentation/doc/cmake-${CMake_VERSION}") # HAIKU set(CMAKE_DOC_DIR_DEFAULT "documentation/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") # HAIKU
elseif(CYGWIN) elseif(CYGWIN)
set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION}") # CYGWIN
set(CMAKE_DOC_DIR_DEFAULT "share/doc/cmake-${CMake_VERSION}") # CYGWIN set(CMAKE_DOC_DIR_DEFAULT "share/doc/cmake-${CMake_VERSION}") # CYGWIN
set(CMAKE_MAN_DIR_DEFAULT "share/man") # CYGWIN set(CMAKE_MAN_DIR_DEFAULT "share/man") # CYGWIN
else() else()
set(CMAKE_DOC_DIR_DEFAULT "doc/cmake-${CMake_VERSION}") # OTHER set(CMAKE_DATA_DIR_DEFAULT "share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") # OTHER
set(CMAKE_DOC_DIR_DEFAULT "doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") # OTHER
set(CMAKE_MAN_DIR_DEFAULT "man") # OTHER set(CMAKE_MAN_DIR_DEFAULT "man") # OTHER
endif() endif()

View File

@ -28,7 +28,13 @@ cmake_install_dest_default()
{ {
cat "${cmake_source_dir}/Source/CMakeInstallDestinations.cmake" | sed -n ' cat "${cmake_source_dir}/Source/CMakeInstallDestinations.cmake" | sed -n '
/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT.*) # '"${2}"'$/ { /^ *set(CMAKE_'"${1}"'_DIR_DEFAULT.*) # '"${2}"'$/ {
s/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT *"\([^"]*\)").*$/\1/;p;q;} s/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT *"\([^"]*\)").*$/\1/
s/${CMake_VERSION_MAJOR}/'"${cmake_version_major}"'/
s/${CMake_VERSION_MINOR}/'"${cmake_version_minor}"'/
s/${CMake_VERSION_PATCH}/'"${cmake_version_patch}"'/
p
q
}
' '
} }