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, master has been updated
       via  1fda77d45565c3a819e6149597c3a194d9ccd0bb (commit)
       via  41be8a739e862995e56aad33e2383c2278a91b77 (commit)
       via  4bf96ed9b01a31e0c91e101b913fa5eb64b99432 (commit)
       via  9eaf0fea2824b2e0b767915dec25deed9552905a (commit)
       via  9b9a57e16b22769b612d4bbe45e9b7cb936be690 (commit)
       via  916b7d519557d4d11e73e66c3e9c95cdacb655ba (commit)
       via  e7730d78b44ca90aa8ee6d1f34495cd416888bce (commit)
       via  9a34e95a41fff294a7fcd452cb3e78fd4ff021aa (commit)
       via  58f47448210bf3fd3121bf91f74eb893ba9d034c (commit)
      from  fc58819150a126d87bf17ad812bb6f62f28ae42b (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=1fda77d45565c3a819e6149597c3a194d9ccd0bb
commit 1fda77d45565c3a819e6149597c3a194d9ccd0bb
Merge: 41be8a7 9b9a57e
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Jul 10 10:23:56 2017 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Mon Jul 10 10:23:56 2017 -0400

    Merge branch 'release-3.9'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41be8a739e862995e56aad33e2383c2278a91b77
commit 41be8a739e862995e56aad33e2383c2278a91b77
Merge: 4bf96ed 9a34e95
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Jul 10 14:21:47 2017 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Mon Jul 10 10:22:00 2017 -0400

    Merge topic 'autogen-no-generated-files'
    
    9a34e95a Autogen: Skip generated files for compatibility with CMake 3.8
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !1033


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bf96ed9b01a31e0c91e101b913fa5eb64b99432
commit 4bf96ed9b01a31e0c91e101b913fa5eb64b99432
Merge: 9eaf0fe e7730d7
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Jul 10 14:21:12 2017 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Mon Jul 10 10:21:23 2017 -0400

    Merge topic 'find_package-restore-considered-configs'
    
    e7730d78 find_package: Restore longer message when config files were 
considered
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !1032


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9eaf0fea2824b2e0b767915dec25deed9552905a
commit 9eaf0fea2824b2e0b767915dec25deed9552905a
Merge: fc58819 58f4744
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon Jul 10 14:20:26 2017 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Mon Jul 10 10:21:00 2017 -0400

    Merge topic 'indented_cmakedefine'
    
    58f47448 configure_file: Add support for indented cmakedefine
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !1024


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58f47448210bf3fd3121bf91f74eb893ba9d034c
commit 58f47448210bf3fd3121bf91f74eb893ba9d034c
Author:     Sylvain Joubert <joubert...@gmail.com>
AuthorDate: Tue Jul 4 12:00:02 2017 +0200
Commit:     Sylvain Joubert <joubert...@gmail.com>
CommitDate: Tue Jul 4 12:00:02 2017 +0200

    configure_file: Add support for indented cmakedefine
    
    Optional spaces and/or tabs are now understood between the '#' character
    and the 'cmakedefine'/'cmakedefine01' words. This indentation is
    preserved in the output lines.
    
    Fixes: #13037

diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst
index 4304f09..75ec441 100644
--- a/Help/command/configure_file.rst
+++ b/Help/command/configure_file.rst
@@ -30,6 +30,18 @@ a false constant by the :command:`if` command.  The "..." 
content on the
 line after the variable name, if any, is processed as above.
 Input file lines of the form ``#cmakedefine01 VAR`` will be replaced with
 either ``#define VAR 1`` or ``#define VAR 0`` similarly.
+The result lines (with the exception of the ``#undef`` comments) can be
+indented using spaces and/or tabs between the ``#`` character
+and the ``cmakedefine`` or ``cmakedefine01`` words. This whitespace
+indentation will be preserved in the output lines::
+
+  #  cmakedefine VAR
+  #  cmakedefine01 VAR
+
+will be replaced, if ``VAR`` is defined, with::
+
+  #  define VAR
+  #  define VAR 1
 
 If the input file is modified the build system will re-run CMake to
 re-configure the file and generate the build system again.
diff --git a/Help/release/dev/indented_cmakedefine.rst 
b/Help/release/dev/indented_cmakedefine.rst
new file mode 100644
index 0000000..fd28b25
--- /dev/null
+++ b/Help/release/dev/indented_cmakedefine.rst
@@ -0,0 +1,7 @@
+indented_cmakedefine
+--------------------
+
+* The :command:`configure_file` command learned to support indented
+  ``#  cmakedefine`` and ``#  cmakedefine01``. Spaces and/or tabs between
+  the ``#`` character and the ``cmakedefine``/``cmakedefine01`` words
+  are now understood and preserved in the output.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4a0cab3..195cd6b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -66,8 +66,8 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
 
   this->DefineFlags = " ";
 
-  this->cmDefineRegex.compile("#cmakedefine[ \t]+([A-Za-z_0-9]*)");
-  this->cmDefine01Regex.compile("#cmakedefine01[ \t]+([A-Za-z_0-9]*)");
+  this->cmDefineRegex.compile("#([ \t]*)cmakedefine[ \t]+([A-Za-z_0-9]*)");
+  this->cmDefine01Regex.compile("#([ \t]*)cmakedefine01[ \t]+([A-Za-z_0-9]*)");
   this->cmAtVarRegex.compile("(@[A-Za-z_0-9/.+-]+@)");
   this->cmNamedCurly.compile("^[A-Za-z0-9/_.+-]+{");
 
@@ -3433,18 +3433,22 @@ void cmMakefile::ConfigureString(const std::string& 
input, std::string& output,
 
     // Replace #cmakedefine instances.
     if (this->cmDefineRegex.find(line)) {
-      const char* def = this->GetDefinition(this->cmDefineRegex.match(1));
+      const char* def = this->GetDefinition(this->cmDefineRegex.match(2));
       if (!cmSystemTools::IsOff(def)) {
-        cmSystemTools::ReplaceString(line, "#cmakedefine", "#define");
+        const std::string indentation = this->cmDefineRegex.match(1);
+        cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine",
+                                     "#" + indentation + "define");
         output += line;
       } else {
         output += "/* #undef ";
-        output += this->cmDefineRegex.match(1);
+        output += this->cmDefineRegex.match(2);
         output += " */";
       }
     } else if (this->cmDefine01Regex.find(line)) {
-      const char* def = this->GetDefinition(this->cmDefine01Regex.match(1));
-      cmSystemTools::ReplaceString(line, "#cmakedefine01", "#define");
+      const std::string indentation = this->cmDefine01Regex.match(1);
+      const char* def = this->GetDefinition(this->cmDefine01Regex.match(2));
+      cmSystemTools::ReplaceString(line, "#" + indentation + "cmakedefine01",
+                                   "#" + indentation + "define");
       output += line;
       if (!cmSystemTools::IsOff(def)) {
         output += " 1";
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 075faa7..8537cd9 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -356,6 +356,8 @@ endwhile()
 
 set(SHOULD_BE_ZERO )
 set(SHOULD_BE_ONE 1)
+set(SHOULD_BE_ZERO_AND_INDENTED )
+set(SHOULD_BE_ONE_AND_INDENTED 1)
 
 # test elseif functionality, the mess below tries to catch problem
 # of clauses being executed early or late etc
diff --git a/Tests/Complex/Executable/complex.cxx 
b/Tests/Complex/Executable/complex.cxx
index 3b09229..ca39870 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -261,6 +261,12 @@ int main()
   cmPassed("ONE_VAR is defined.");
 #endif
 
+#ifndef ONE_VAR_AND_INDENTED
+  cmFailed("cmakedefine is broken, ONE_VAR_AND_INDENTED is not defined.");
+#else
+  cmPassed("ONE_VAR_AND_INDENTED is defined.");
+#endif
+
 #ifndef ONE_VAR_IS_DEFINED
   cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, "
            "ONE_VAR_IS_DEFINED is not defined.");
@@ -274,6 +280,12 @@ int main()
   cmPassed("ZERO_VAR is not defined.");
 #endif
 
+#ifdef ZERO_VAR_AND_INDENTED
+  cmFailed("cmakedefine is broken, ZERO_VAR_AND_INDENTED is defined.");
+#else
+  cmPassed("ZERO_VAR_AND_INDENTED is not defined.");
+#endif
+
 #ifndef STRING_VAR
   cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined.");
 #else
@@ -1030,6 +1042,16 @@ int main()
   } else {
     cmFailed("cmakedefine01 is not working for 1");
   }
+  if (SHOULD_BE_ZERO_AND_INDENTED == 0) {
+    cmPassed("cmakedefine01 is working for 0 and indented");
+  } else {
+    cmFailed("cmakedefine01 is not working for 0 and indented");
+  }
+  if (SHOULD_BE_ONE_AND_INDENTED == 1) {
+    cmPassed("cmakedefine01 is working for 1 and indented");
+  } else {
+    cmFailed("cmakedefine01 is not working for 1 and indented");
+  }
 #ifdef FORCE_TEST
   cmFailed("CMake SET CACHE FORCE");
 #else
diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake
index 8be59be..9761986 100644
--- a/Tests/Complex/VarTests.cmake
+++ b/Tests/Complex/VarTests.cmake
@@ -2,6 +2,7 @@
 # Test SET
 #
 set (ZERO_VAR 0)
+set (ZERO_VAR_AND_INDENTED 0)
 set (ZERO_VAR2 0)
 
 if(ZERO_VAR)
@@ -11,6 +12,7 @@ else()
 endif()
 
 set(ONE_VAR 1)
+set(ONE_VAR_AND_INDENTED 1)
 set(ONE_VAR2 1)
 set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
 
diff --git a/Tests/Complex/cmTestConfigure.h.in 
b/Tests/Complex/cmTestConfigure.h.in
index d7424b1..72317bc 100644
--- a/Tests/Complex/cmTestConfigure.h.in
+++ b/Tests/Complex/cmTestConfigure.h.in
@@ -1,8 +1,10 @@
 // Test SET, VARIABLE_REQUIRES
 
 #cmakedefine ONE_VAR
+#  cmakedefine ONE_VAR_AND_INDENTED
 #cmakedefine ONE_VAR_IS_DEFINED
 #cmakedefine ZERO_VAR
+#  cmakedefine ZERO_VAR_AND_INDENTED
 
 #define STRING_VAR "${STRING_VAR}"
 
@@ -32,6 +34,8 @@
 
 #cmakedefine01 SHOULD_BE_ZERO
 #cmakedefine01 SHOULD_BE_ONE
+#  cmakedefine01 SHOULD_BE_ZERO_AND_INDENTED
+#  cmakedefine01 SHOULD_BE_ONE_AND_INDENTED
 // Needed to check for files
 
 #define BINARY_DIR "${Complex_BINARY_DIR}"
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt 
b/Tests/ComplexOneConfig/CMakeLists.txt
index 1b833b2..4cd0bae 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -313,6 +313,8 @@ endwhile()
 
 set(SHOULD_BE_ZERO )
 set(SHOULD_BE_ONE 1)
+set(SHOULD_BE_ZERO_AND_INDENTED )
+set(SHOULD_BE_ONE_AND_INDENTED 1)
 
 # test elseif functionality, the mess below tries to catch problem
 # of clauses being executed early or late etc
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx 
b/Tests/ComplexOneConfig/Executable/complex.cxx
index 9e4eaad..9b94962 100644
--- a/Tests/ComplexOneConfig/Executable/complex.cxx
+++ b/Tests/ComplexOneConfig/Executable/complex.cxx
@@ -261,6 +261,12 @@ int main()
   cmPassed("ONE_VAR is defined.");
 #endif
 
+#ifndef ONE_VAR_AND_INDENTED
+  cmFailed("cmakedefine is broken, ONE_VAR_AND_INDENTED is not defined.");
+#else
+  cmPassed("ONE_VAR_AND_INDENTED is defined.");
+#endif
+
 #ifndef ONE_VAR_IS_DEFINED
   cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, "
            "ONE_VAR_IS_DEFINED is not defined.");
@@ -274,6 +280,12 @@ int main()
   cmPassed("ZERO_VAR is not defined.");
 #endif
 
+#ifdef ZERO_VAR_AND_INDENTED
+  cmFailed("cmakedefine is broken, ZERO_VAR_AND_INDENTED is defined.");
+#else
+  cmPassed("ZERO_VAR_AND_INDENTED is not defined.");
+#endif
+
 #ifndef STRING_VAR
   cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined.");
 #else
@@ -1030,6 +1042,16 @@ int main()
   } else {
     cmFailed("cmakedefine01 is not working for 1");
   }
+  if (SHOULD_BE_ZERO_AND_INDENTED == 0) {
+    cmPassed("cmakedefine01 is working for 0 and indented");
+  } else {
+    cmFailed("cmakedefine01 is not working for 0 and indented");
+  }
+  if (SHOULD_BE_ONE_AND_INDENTED == 1) {
+    cmPassed("cmakedefine01 is working for 1 and indented");
+  } else {
+    cmFailed("cmakedefine01 is not working for 1 and indented");
+  }
 #ifdef FORCE_TEST
   cmFailed("CMake SET CACHE FORCE");
 #else
diff --git a/Tests/ComplexOneConfig/VarTests.cmake 
b/Tests/ComplexOneConfig/VarTests.cmake
index 7dd8519..42afd19 100644
--- a/Tests/ComplexOneConfig/VarTests.cmake
+++ b/Tests/ComplexOneConfig/VarTests.cmake
@@ -2,6 +2,7 @@
 # Test SET
 #
 set (ZERO_VAR 0)
+set (ZERO_VAR_AND_INDENTED 0)
 set (ZERO_VAR2 0)
 
 if(ZERO_VAR)
@@ -11,6 +12,7 @@ else()
 endif()
 
 set(ONE_VAR 1)
+set(ONE_VAR_AND_INDENTED 1)
 set(ONE_VAR2 1)
 set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable")
 
diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in 
b/Tests/ComplexOneConfig/cmTestConfigure.h.in
index d7424b1..72317bc 100644
--- a/Tests/ComplexOneConfig/cmTestConfigure.h.in
+++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in
@@ -1,8 +1,10 @@
 // Test SET, VARIABLE_REQUIRES
 
 #cmakedefine ONE_VAR
+#  cmakedefine ONE_VAR_AND_INDENTED
 #cmakedefine ONE_VAR_IS_DEFINED
 #cmakedefine ZERO_VAR
+#  cmakedefine ZERO_VAR_AND_INDENTED
 
 #define STRING_VAR "${STRING_VAR}"
 
@@ -32,6 +34,8 @@
 
 #cmakedefine01 SHOULD_BE_ZERO
 #cmakedefine01 SHOULD_BE_ONE
+#  cmakedefine01 SHOULD_BE_ZERO_AND_INDENTED
+#  cmakedefine01 SHOULD_BE_ONE_AND_INDENTED
 // Needed to check for files
 
 #define BINARY_DIR "${Complex_BINARY_DIR}"

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

Summary of changes:
 Help/command/configure_file.rst                    |   12 +++++++++++
 Help/release/dev/indented_cmakedefine.rst          |    7 +++++++
 Source/cmFindPackageCommand.cxx                    |    3 ++-
 Source/cmMakefile.cxx                              |   18 +++++++++-------
 Source/cmQtAutoGeneratorInitializer.cxx            |    7 +++++++
 Tests/Complex/CMakeLists.txt                       |    2 ++
 Tests/Complex/Executable/complex.cxx               |   22 ++++++++++++++++++++
 Tests/Complex/VarTests.cmake                       |    2 ++
 Tests/Complex/cmTestConfigure.h.in                 |    4 ++++
 Tests/ComplexOneConfig/CMakeLists.txt              |    2 ++
 Tests/ComplexOneConfig/Executable/complex.cxx      |   22 ++++++++++++++++++++
 Tests/ComplexOneConfig/VarTests.cmake              |    2 ++
 Tests/ComplexOneConfig/cmTestConfigure.h.in        |    4 ++++
 Tests/QtAutogen/mocDepends/CMakeLists.txt          |    2 ++
 Tests/QtAutogen/mocRerun/CMakeLists.txt            |    1 +
 Tests/RunCMake/find_package/RunCMakeTest.cmake     |    2 ++
 .../RunCMake/find_package/SetFoundFALSE-stderr.txt |    9 ++++++++
 .../RunCMake/find_package/SetFoundFALSE-stdout.txt |    1 -
 .../VersionedA-1/VersionedAConfig.cmake            |    0
 .../VersionedA-1/VersionedAConfigVersion.cmake     |    4 ++++
 .../VersionedA-2/VersionedAConfig.cmake            |    0
 .../VersionedA-2/VersionedAConfigVersion.cmake}    |    3 +--
 .../RunCMake/find_package/WrongVersion-stderr.txt  |   11 ++++++++++
 Tests/RunCMake/find_package/WrongVersion.cmake     |    2 ++
 .../find_package/WrongVersionConfig-stderr.txt     |   11 ++++++++++
 .../RunCMake/find_package/WrongVersionConfig.cmake |    2 ++
 26 files changed, 144 insertions(+), 11 deletions(-)
 create mode 100644 Help/release/dev/indented_cmakedefine.rst
 create mode 100644 Tests/RunCMake/find_package/SetFoundFALSE-stderr.txt
 delete mode 100644 Tests/RunCMake/find_package/SetFoundFALSE-stdout.txt
 copy Modules/IntelVSImplicitPath/hello.f => 
Tests/RunCMake/find_package/VersionedA-1/VersionedAConfig.cmake (100%)
 create mode 100644 
Tests/RunCMake/find_package/VersionedA-1/VersionedAConfigVersion.cmake
 copy Modules/IntelVSImplicitPath/hello.f => 
Tests/RunCMake/find_package/VersionedA-2/VersionedAConfig.cmake (100%)
 copy Tests/{FindPackageTest/lib/zot-2.0/zot-config-version.cmake => 
RunCMake/find_package/VersionedA-2/VersionedAConfigVersion.cmake} (77%)
 create mode 100644 Tests/RunCMake/find_package/WrongVersion-stderr.txt
 create mode 100644 Tests/RunCMake/find_package/WrongVersion.cmake
 create mode 100644 Tests/RunCMake/find_package/WrongVersionConfig-stderr.txt
 create mode 100644 Tests/RunCMake/find_package/WrongVersionConfig.cmake


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

Reply via email to