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  7e927348fc204e858f5ce16c2bc712cd2812ec19 (commit)
       via  05a8630ee63361ad8665b56412a9602761ca2dc4 (commit)
       via  c8bf86cf82041172187103b61ea78340971483fc (commit)
      from  2682d39ef9a805ae2fe5ff14dae832018c2cb07c (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=7e927348fc204e858f5ce16c2bc712cd2812ec19
commit 7e927348fc204e858f5ce16c2bc712cd2812ec19
Merge: 2682d39 05a8630
Author:     Eric Noulard <eric.noul...@gmail.com>
AuthorDate: Thu Jul 5 05:14:56 2012 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Thu Jul 5 05:14:56 2012 -0400

    Merge topic 'CPack-honorCPACK_XXX-valuesInScriptFile' into next
    
    05a8630 Do not provide defaul value for CPACK_PACKAGE_DIRECTORY if found in 
config.
    c8bf86c CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05a8630ee63361ad8665b56412a9602761ca2dc4
commit 05a8630ee63361ad8665b56412a9602761ca2dc4
Author:     Eric NOULARD <eric.noul...@gmail.com>
AuthorDate: Wed Jul 4 23:08:32 2012 +0200
Commit:     Eric NOULARD <eric.noul...@gmail.com>
CommitDate: Wed Jul 4 23:08:32 2012 +0200

    Do not provide defaul value for CPACK_PACKAGE_DIRECTORY if found in config.
    
    This fixes bug #0012906.

diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index e572119..6575957 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -63,6 +63,14 @@
 ##end
 #
 ##variable
+#  CPACK_PACKAGE_DIRECTORY - The directory in which CPack is doing its
+#  packaging. If it is not set then this will default (internally) to the
+#  build dir. This variable may be defined in CPack config file or from
+#  the cpack command line option "-B". If set the command line option
+#  override the value found in the config file.
+##end
+#
+##variable
 #  CPACK_PACKAGE_VERSION_MAJOR - Package major Version
 ##end
 #
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 6f5055c..396c551 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -207,8 +207,7 @@ int main (int argc, char *argv[])
   std::string helpHTML;
 
   std::string cpackProjectName;
-  std::string cpackProjectDirectory
-    = cmsys::SystemTools::GetCurrentWorkingDirectory();
+  std::string cpackProjectDirectory;
   std::string cpackBuildConfig;
   std::string cpackProjectVersion;
   std::string cpackProjectPatch;
@@ -370,10 +369,24 @@ int main (int argc, char *argv[])
       globalMF->AddDefinition("CPACK_PACKAGE_VENDOR",
         cpackProjectVendor.c_str());
       }
+    // if this is not empty it has been set on the command line
+    // go for it. Command line override values set in config file.
     if ( !cpackProjectDirectory.empty() )
       {
       globalMF->AddDefinition("CPACK_PACKAGE_DIRECTORY",
-        cpackProjectDirectory.c_str());
+                              cpackProjectDirectory.c_str());
+      }
+    // The value has not been set on the command line
+    else
+      {
+      // get a default value (current working directory)
+      cpackProjectDirectory = cmsys::SystemTools::GetCurrentWorkingDirectory();
+      // use default value iff no value has been provided by the config file
+      if (!globalMF->IsSet("CPACK_PACKAGE_DIRECTORY"))
+        {
+        globalMF->AddDefinition("CPACK_PACKAGE_DIRECTORY",
+                                cpackProjectDirectory.c_str());
+        }
       }
     if ( !cpackBuildConfig.empty() )
       {

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

Summary of changes:
 Modules/CPack.cmake       |    8 ++++++++
 Source/CMakeVersion.cmake |    2 +-
 Source/CPack/cpack.cxx    |   19 ++++++++++++++++---
 3 files changed, 25 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to