[Cmake-commits] CMake branch, next, updated. v3.7.1-1734-g4bf498e

Brad King brad.king at kitware.com
Tue Dec 13 08:48:54 EST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  4bf498e9618c6d70e642a5a58c49f222f8f2b575 (commit)
       via  53b5d6345dd9216e5110a9645a0aa194926d5688 (commit)
       via  c968213d2e43945e69ebe4ad12ca933b8f4c4e6f (commit)
      from  820267ff71a81546c420e1257bbdc4d72dad8a46 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bf498e9618c6d70e642a5a58c49f222f8f2b575
commit 4bf498e9618c6d70e642a5a58c49f222f8f2b575
Merge: 820267f 53b5d63
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 13 08:48:53 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Dec 13 08:48:53 2016 -0500

    Merge topic 'GNUInstallDirs-cache-type' into next
    
    53b5d634 GNUInstallDirs: Set UNINITALIZED cache properties to type PATH
    c968213d GNUInstallDirs: Unify path logic into helper macros


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53b5d6345dd9216e5110a9645a0aa194926d5688
commit 53b5d6345dd9216e5110a9645a0aa194926d5688
Author:     Roger Leigh <rleigh at codelibre.net>
AuthorDate: Fri Dec 9 21:36:55 2016 +0000
Commit:     Roger Leigh <rleigh at dundee.ac.uk>
CommitDate: Mon Dec 12 22:23:26 2016 +0000

    GNUInstallDirs: Set UNINITALIZED cache properties to type PATH
    
    Also convert the path to a cmake path

diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index b8b95bc..9599f27 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -120,11 +120,26 @@
 #   allow users who create additional path variables to also compute
 #   absolute paths where necessary, using the same logic.
 
+# Convert a cache variable to PATH type
+
+macro(_GNUInstallDirs_cache_convert_to_path var description)
+  get_property(_GNUInstallDirs_cache_type CACHE ${var} PROPERTY TYPE)
+  if(_GNUInstallDirs_cache_type STREQUAL "UNINITIALIZED")
+    file(TO_CMAKE_PATH "${${var}}" _GNUInstallDirs_cmakepath)
+    set_property(CACHE ${var} PROPERTY TYPE PATH)
+    set_property(CACHE ${var} PROPERTY VALUE "${_GNUInstallDirs_cmakepath}")
+    set_property(CACHE ${var} PROPERTY HELPSTRING "${description}")
+    unset(_GNUInstallDirs_cmakepath)
+  endif()
+  unset(_GNUInstallDirs_cache_type)
+endmacro()
+
 # Create a cache variable with default for a path.
 macro(_GNUInstallDirs_cache_path var default description)
   if(NOT DEFINED ${var})
     set(${var} "${default}" CACHE PATH "${description}")
   endif()
+  _GNUInstallDirs_cache_convert_to_path("${var}" "${description}")
 endmacro()
 
 # Create a cache variable with not default for a path, with a fallback
@@ -135,6 +150,7 @@ macro(_GNUInstallDirs_cache_path_fallback var default description)
     set(${var} "" CACHE PATH "${description}")
     set(${var} "${default}")
   endif()
+  _GNUInstallDirs_cache_convert_to_path("${var}" "${description}")
 endmacro()
 
 # Installation directories
@@ -232,6 +248,7 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR OR (_libdir_set
     set_property(CACHE CMAKE_INSTALL_LIBDIR PROPERTY VALUE "${_LIBDIR_DEFAULT}")
   endif()
 endif()
+_GNUInstallDirs_cache_convert_to_path(CMAKE_INSTALL_LIBDIR "Object code libraries (lib)")
 
 # Save for next run
 set(_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "CMAKE_INSTALL_PREFIX during last run")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c968213d2e43945e69ebe4ad12ca933b8f4c4e6f
commit c968213d2e43945e69ebe4ad12ca933b8f4c4e6f
Author:     Roger Leigh <rleigh at codelibre.net>
AuthorDate: Tue Dec 6 20:44:45 2016 +0000
Commit:     Roger Leigh <rleigh at dundee.ac.uk>
CommitDate: Mon Dec 12 22:22:44 2016 +0000

    GNUInstallDirs: Unify path logic into helper macros
    
    - Unify path handling: Rather than repeat the same logic for each
      individual path create two macros which can be used throughout
      the module.
    - Capitalise helpstrings to match the conventions used by the
      standard CMake properties

diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index 059a2fc..b8b95bc 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -120,31 +120,38 @@
 #   allow users who create additional path variables to also compute
 #   absolute paths where necessary, using the same logic.
 
-# Installation directories
-#
-if(NOT DEFINED CMAKE_INSTALL_BINDIR)
-  set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
-endif()
-
-if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
-  set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
-endif()
-
-if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
-  set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
-endif()
+# Create a cache variable with default for a path.
+macro(_GNUInstallDirs_cache_path var default description)
+  if(NOT DEFINED ${var})
+    set(${var} "${default}" CACHE PATH "${description}")
+  endif()
+endmacro()
 
-if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
-  set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
-endif()
+# Create a cache variable with not default for a path, with a fallback
+# when unset; used for entries slaved to other entries such as
+# DATAROOTDIR.
+macro(_GNUInstallDirs_cache_path_fallback var default description)
+  if(NOT ${var})
+    set(${var} "" CACHE PATH "${description}")
+    set(${var} "${default}")
+  endif()
+endmacro()
 
-if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
-  set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
-endif()
+# Installation directories
+#
 
-if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
-  set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
-endif()
+_GNUInstallDirs_cache_path(CMAKE_INSTALL_BINDIR "bin"
+  "User executables (bin)")
+_GNUInstallDirs_cache_path(CMAKE_INSTALL_SBINDIR "sbin"
+  "System admin executables (sbin)")
+_GNUInstallDirs_cache_path(CMAKE_INSTALL_LIBEXECDIR "libexec"
+  "Program executables (libexec)")
+_GNUInstallDirs_cache_path(CMAKE_INSTALL_SYSCONFDIR "etc"
+  "Read-only single-machine data (etc)")
+_GNUInstallDirs_cache_path(CMAKE_INSTALL_SHAREDSTATEDIR "com"
+  "Modifiable architecture-independent data (com)")
+_GNUInstallDirs_cache_path(CMAKE_INSTALL_LOCALSTATEDIR "var"
+  "Modifiable single-machine data (var)")
 
 # We check if the variable was manually set and not cached, in order to
 # allow projects to set the values as normal variables before including
@@ -219,71 +226,49 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR OR (_libdir_set
     endif()
   endif()
   if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
-    set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
+    set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "Object code libraries (${_LIBDIR_DEFAULT})")
   elseif(DEFINED __LAST_LIBDIR_DEFAULT
       AND "${__LAST_LIBDIR_DEFAULT}" STREQUAL "${CMAKE_INSTALL_LIBDIR}")
     set_property(CACHE CMAKE_INSTALL_LIBDIR PROPERTY VALUE "${_LIBDIR_DEFAULT}")
   endif()
 endif()
+
 # Save for next run
 set(_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "CMAKE_INSTALL_PREFIX during last run")
 unset(_libdir_set)
 unset(__LAST_LIBDIR_DEFAULT)
 
-
-if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
-  set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
-endif()
-
-if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
-  set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
-endif()
-
-if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
-  set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
-endif()
+_GNUInstallDirs_cache_path(CMAKE_INSTALL_INCLUDEDIR "include"
+  "C header files (include)")
+_GNUInstallDirs_cache_path(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include"
+  "C header files for non-gcc (/usr/include)")
+_GNUInstallDirs_cache_path(CMAKE_INSTALL_DATAROOTDIR "share"
+  "Read-only architecture-independent data root (share)")
 
 #-----------------------------------------------------------------------------
 # Values whose defaults are relative to DATAROOTDIR.  Store empty values in
 # the cache and store the defaults in local variables if the cache values are
 # not set explicitly.  This auto-updates the defaults as DATAROOTDIR changes.
 
-if(NOT CMAKE_INSTALL_DATADIR)
-  set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
-  set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
-endif()
+_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}"
+  "Read-only architecture-independent data (DATAROOTDIR)")
 
 if(CMAKE_SYSTEM_NAME MATCHES "^(.*BSD|DragonFly)$")
-  if(NOT CMAKE_INSTALL_INFODIR)
-    set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (info)")
-    set(CMAKE_INSTALL_INFODIR "info")
-  endif()
-
-  if(NOT CMAKE_INSTALL_MANDIR)
-    set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (man)")
-    set(CMAKE_INSTALL_MANDIR "man")
-  endif()
+  _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_INFODIR "info"
+    "Info documentation (info)")
+  _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_MANDIR "man"
+    "Man documentation (man)")
 else()
-  if(NOT CMAKE_INSTALL_INFODIR)
-    set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
-    set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
-  endif()
-
-  if(NOT CMAKE_INSTALL_MANDIR)
-    set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
-    set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
-  endif()
-endif()
-
-if(NOT CMAKE_INSTALL_LOCALEDIR)
-  set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
-  set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
+  _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info"
+    "Info documentation (DATAROOTDIR/info)")
+  _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man"
+    "Man documentation (DATAROOTDIR/man)")
 endif()
 
-if(NOT CMAKE_INSTALL_DOCDIR)
-  set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
-  set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
-endif()
+_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale"
+  "Locale-dependent data (DATAROOTDIR/locale)")
+_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}"
+  "Documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
 
 #-----------------------------------------------------------------------------
 

-----------------------------------------------------------------------

Summary of changes:
 Modules/GNUInstallDirs.cmake |  130 +++++++++++++++++++++---------------------
 1 file changed, 66 insertions(+), 64 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list