[Cmake-commits] CMake branch, next, updated. v2.8.8-2896-gba60beb

Eric Noulard eric.noulard at gmail.com
Sun May 20 11:37:03 EDT 2012


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  ba60beb24288eae6a3dcd9424457a8a20abbd8d3 (commit)
       via  4986d525afcddcad6f8610c85cc7d2cf46701ad5 (commit)
      from  209ad9c32a8d035f5ee512ac7c6649f4576f3138 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ba60beb24288eae6a3dcd9424457a8a20abbd8d3
commit ba60beb24288eae6a3dcd9424457a8a20abbd8d3
Merge: 209ad9c 4986d52
Author:     Eric Noulard <eric.noulard at gmail.com>
AuthorDate: Sun May 20 11:36:54 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun May 20 11:36:54 2012 -0400

    Merge topic 'CPackNSIS-warnDESTDIRandABSOLUTE' into next
    
    4986d52 Use CPACK_xxx and CMAKE_xxx in a consistent way.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4986d525afcddcad6f8610c85cc7d2cf46701ad5
commit 4986d525afcddcad6f8610c85cc7d2cf46701ad5
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sun May 20 17:28:54 2012 +0200
Commit:     Eric NOULARD <eric.noulard at gmail.com>
CommitDate: Sun May 20 17:28:54 2012 +0200

    Use CPACK_xxx and CMAKE_xxx in a consistent way.
    
    CMAKE_xxx vars are now used in the CMake-generated cmake_install.cmake
    script while CPACK_xxx equivalent vars are used from within CPack.
    CPack is responsible for getting/forwarding definitions of
    CPACK_xxxx var corresponding to CMAKE_xxxx when invoking
    CMake-generated install scripts.
    As a consequence:
    CMAKE_ABSOLUTE_DESTINATION_FILES
    CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
    CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
    may be used from outside CPack as well.
    e.g.
    cmake -DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=1 -P cmake_install.cmake
    works as expected.

diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx
index b529480..edbef45 100644
--- a/Source/CPack/cmCPackDocumentVariables.cxx
+++ b/Source/CPack/cmCPackDocumentVariables.cxx
@@ -79,18 +79,33 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm)
          "Variables common to all CPack generators");
 
   cm->DefineProperty
+        ("CPACK_ABSOLUTE_DESTINATION_FILES", cmProperty::VARIABLE,
+         "List of files which have been installed using "
+         " an ABSOLUTE DESTINATION path.",
+         "This variable is a Read-Only variable which is set internally"
+         " by CPack during installation and before packaging using"
+         " CMAKE_ABSOLUTE_DESTINATION_FILES defined in cmake_install.cmake "
+         "scripts. The value can be used within CPack project configuration"
+         " file and/or CPack<GEN>.cmake file of <GEN> generator.", false,
+         "Variables common to all CPack generators");
+
+  cm->DefineProperty
         ("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE,
          "Ask CPack to warn each time a file with absolute INSTALL"
          " DESTINATION is encountered.",
-         "", false,
+         "This variable triggers the definition of "
+         "CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs"
+         " cmake_install.cmake scripts.", false,
          "Variables common to all CPack generators");
 
   cm->DefineProperty
         ("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE,
          "Ask CPack to error out as soon as a file with absolute INSTALL"
-         " DESTINATION is encountered",
+         " DESTINATION is encountered.",
          "The fatal error is emitted before the installation of "
          "the offending file takes place. Some CPack generators, like NSIS,"
-         "enforce this internally.", false,
+         "enforce this internally. "
+         "This variable triggers the definition of"
+         "CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION when CPack runs"
          "Variables common to all CPack generators");
 }
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index ca790c0..87a3b9e 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -854,7 +854,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
         // then forward request to cmake_install.cmake script
         if (this->GetOption("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION"))
           {
-            mf->AddDefinition("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION",
+            mf->AddDefinition("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION",
                               "1");
           }
         // If current CPack generator does support
@@ -864,11 +864,19 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
         if (!SupportsAbsoluteDestination() ||
             this->GetOption("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION"))
           {
-            mf->AddDefinition("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION",
+            mf->AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION",
                               "1");
           }
         // do installation
         int res = mf->ReadListFile(0, installFile.c_str());
+        // forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES
+        // to CPack (may be used by generators like CPack RPM or DEB)
+        // in order to transparently handle ABSOLUTE PATH
+        if (mf->GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES"))
+          {
+            mf->AddDefinition("CPACK_ABSOLUTE_DESTINATION_FILES",
+                mf->GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES"));
+          }
 
         // Now rebuild the list of files after installation
         // of the current component (if we are in component install)
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 897e516..fb40024 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -833,6 +833,36 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "Default is ON.",false,
      "Variables That Change Behavior");
 
+  cm->DefineProperty
+    ("CMAKE_ABSOLUTE_DESTINATION_FILES", cmProperty::VARIABLE,
+      "List of files which have been installed using "
+      " an ABSOLUTE DESTINATION path.",
+      "This variable is defined by CMake-generated cmake_install.cmake "
+      "scripts."
+      " It can be used (read-only) by program or script that source those"
+      " install scripts. This is used by some CPack generators (e.g. RPM).",
+      false,
+      "Variables That Change Behavior");
+
+  cm->DefineProperty
+    ("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE,
+      "Ask cmake_install.cmake script to warn each time a file with "
+      "absolute INSTALL DESTINATION is encountered.",
+      "This variable is used by CMake-generated cmake_install.cmake"
+      " scripts. If ones set this variable to ON while running the"
+      " script, it may get warning messages from the script.", false,
+      "Variables That Change Behavior");
+
+  cm->DefineProperty
+    ("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", cmProperty::VARIABLE,
+      "Ask cmake_install.cmake script to error out as soon as "
+      "a file with absolute INSTALL DESTINATION is encountered.",
+      "The fatal error is emitted before the installation of "
+      "the offending file takes place."
+      " This variable is used by CMake-generated cmake_install.cmake"
+      " scripts. If ones set this variable to ON while running the"
+      " script, it may get fatal error messages from the script.",false,
+      "Variables That Change Behavior");
 
   // Variables defined by CMake that describe the system
 
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index 2b1db79..3be2c2b 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -60,7 +60,7 @@ void cmInstallGenerator
   std::string dest = this->GetInstallDestination();
   if (cmSystemTools::FileIsFullPath(dest.c_str()))
      {
-     os << "list(APPEND CPACK_ABSOLUTE_DESTINATION_FILES\n";
+     os << "list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES\n";
      os << indent << " \"";
      for(std::vector<std::string>::const_iterator fi = files.begin();
                fi != files.end(); ++fi)
@@ -80,16 +80,16 @@ void cmInstallGenerator
                  }
              }
      os << "\")\n";
-     os << indent << "IF (CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n";
+     os << indent << "IF (CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n";
      os << indent << indent << "message(WARNING \"ABSOLUTE path INSTALL "
-        << "DESTINATION : ${CPACK_ABSOLUTE_DESTINATION_FILES}\")\n";
-     os << indent << "ENDIF (CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n";
+        << "DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n";
+     os << indent << "ENDIF (CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n";
 
-     os << indent << "IF (CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n";
+     os << indent << "IF (CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n";
      os << indent << indent << "message(FATAL_ERROR \"ABSOLUTE path INSTALL "
-        << "DESTINATION forbidden (by CPack): "
-        << "${CPACK_ABSOLUTE_DESTINATION_FILES}\")\n";
-     os << indent << "ENDIF (CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n";
+        << "DESTINATION forbidden (by caller): "
+        << "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n";
+     os << indent << "ENDIF (CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n";
      }
   os << "FILE(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype.c_str();
   if(optional)

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

Summary of changes:
 Source/CPack/cmCPackDocumentVariables.cxx |   21 +++++++++++++++++--
 Source/CPack/cmCPackGenerator.cxx         |   12 +++++++++-
 Source/cmDocumentVariables.cxx            |   30 +++++++++++++++++++++++++++++
 Source/cmInstallGenerator.cxx             |   16 +++++++-------
 4 files changed, 66 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list