[Cmake-commits] CMake branch, next, updated. v3.2.2-2654-g0a445a5

Brad King brad.king at kitware.com
Fri May 8 15:53:11 EDT 2015


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  0a445a5999fb25bf876f18c022420344f6e70905 (commit)
       via  e2509e5a9a54c6321fd603a8d620b0a65b1dcf95 (commit)
       via  eba9048f30279fb638403c9be425e1fadff4d837 (commit)
      from  8454123db3deda444cfc741493a19e50fb7f87ec (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=0a445a5999fb25bf876f18c022420344f6e70905
commit 0a445a5999fb25bf876f18c022420344f6e70905
Merge: 8454123 e2509e5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri May 8 15:53:09 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri May 8 15:53:09 2015 -0400

    Merge topic 'ctest-no-make-i' into next
    
    e2509e5a CTest: Stop telling 'make' to ignore errors with -i
    eba9048f Help: Fix build_command alternative signature docs


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2509e5a9a54c6321fd603a8d620b0a65b1dcf95
commit e2509e5a9a54c6321fd603a8d620b0a65b1dcf95
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri May 8 15:41:08 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri May 8 15:48:10 2015 -0400

    CTest: Stop telling 'make' to ignore errors with -i
    
    Add policy CMP0061 to maintain compatibility for existing projects.

diff --git a/Help/command/build_command.rst b/Help/command/build_command.rst
index fa971e4..1298c1f 100644
--- a/Help/command/build_command.rst
+++ b/Help/command/build_command.rst
@@ -19,7 +19,8 @@ Sets the given ``<variable>`` to a command-line string of the form::
 where ``<cmake>`` is the location of the :manual:`cmake(1)` command-line
 tool, and ``<config>`` and ``<target>`` are the values provided to the
 ``CONFIGURATION`` and ``TARGET`` options, if any.  The trailing ``-- -i``
-option is added for Makefile generators.
+option is added for :ref:`Makefile Generators` if policy :policy:`CMP0061`
+is not set to ``NEW``.
 
 When invoked, this ``cmake --build`` command line will launch the
 underlying build system tool.
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index aff696d..e59cce7 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -118,3 +118,4 @@ All Policies
    /policy/CMP0058
    /policy/CMP0059
    /policy/CMP0060
+   /policy/CMP0061
diff --git a/Help/policy/CMP0061.rst b/Help/policy/CMP0061.rst
new file mode 100644
index 0000000..069a1ab
--- /dev/null
+++ b/Help/policy/CMP0061.rst
@@ -0,0 +1,24 @@
+CMP0061
+-------
+
+CTest does not by default tell ``make`` to ignore errors (``-i``).
+
+The :command:`ctest_build` and :command:`build_command` commands no
+longer generate build commands for :ref:`Makefile Generators` with
+the ``-i`` option.  Previously this was done to help build as much
+of tested projects as possible.  However, this behavior is not
+consistent with other generators and also causes the return code
+of the ``make`` tool to be meaningless.
+
+Of course users may still add this option manually by setting
+:variable:`CTEST_BUILD_COMMAND` or the ``MAKECOMMAND`` cache entry.
+See the :ref:`CTest Build Step` ``MakeCommand`` setting documentation
+for their effects.
+
+The ``OLD`` behavior for this policy is to add ``-i`` to ``make``
+calls in CTest.  The ``NEW`` behavior for this policy is to not
+add ``-i``.
+
+This policy was introduced in CMake version 3.3.  Unlike most policies,
+CMake version |release| does *not* warn when this policy is not set and
+simply uses OLD behavior.
diff --git a/Help/release/dev/ctest-no-make-i.rst b/Help/release/dev/ctest-no-make-i.rst
new file mode 100644
index 0000000..96da0bd
--- /dev/null
+++ b/Help/release/dev/ctest-no-make-i.rst
@@ -0,0 +1,7 @@
+ctest-no-make-i
+---------------
+
+* The :command:`ctest_build` and :command:`build_command` commands
+  no longer tell ``make`` tools to ignore errors with the ``-i`` option.
+  Previously this was done for :ref:`Makefile Generators` but not others.
+  See policy :policy:`CMP0061`.
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index 2b36b0a..27e22c4 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -141,7 +141,8 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
         = this->GlobalGenerator->
         GenerateCMakeBuildCommand(cmakeBuildTarget ? cmakeBuildTarget : "",
           cmakeBuildConfiguration,
-          cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "", true);
+          cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "",
+          this->Makefile->IgnoreErrorsCMP0061());
       cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
         "SetMakeCommand:" << buildCommand << "\n", this->Quiet);
       this->CTest->SetCTestConfiguration("MakeCommand", buildCommand.c_str(),
diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index 988e9a7..c6c9804 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -106,7 +106,8 @@ bool cmBuildCommand
     }
 
   std::string makecommand = this->Makefile->GetGlobalGenerator()
-      ->GenerateCMakeBuildCommand(target, configuration, "", true);
+    ->GenerateCMakeBuildCommand(target, configuration, "",
+                                this->Makefile->IgnoreErrorsCMP0061());
 
   this->Makefile->AddDefinition(variable, makecommand.c_str());
 
@@ -135,7 +136,8 @@ bool cmBuildCommand
     }
 
   std::string makecommand = this->Makefile->GetGlobalGenerator()
-      ->GenerateCMakeBuildCommand("", configType, "", true);
+    ->GenerateCMakeBuildCommand("", configType, "",
+                                this->Makefile->IgnoreErrorsCMP0061());
 
   if(cacheValue)
     {
diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h
index 3fb618f..979abc0 100644
--- a/Source/cmBuildCommand.h
+++ b/Source/cmBuildCommand.h
@@ -53,6 +53,8 @@ public:
   virtual std::string GetName() const {return "build_command";}
 
   cmTypeMacro(cmBuildCommand, cmCommand);
+private:
+  bool IgnoreErrors() const;
 };
 
 #endif
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 82add86..4ded936 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4942,6 +4942,26 @@ void cmMakefile::RecordPolicies(cmPolicies::PolicyMap& pm)
     }
 }
 
+//----------------------------------------------------------------------------
+bool cmMakefile::IgnoreErrorsCMP0061() const
+{
+  bool ignoreErrors = true;
+  switch (this->GetPolicyStatus(cmPolicies::CMP0061))
+    {
+    case cmPolicies::WARN:
+      // No warning for this policy!
+    case cmPolicies::OLD:
+      break;
+    case cmPolicies::REQUIRED_IF_USED:
+    case cmPolicies::REQUIRED_ALWAYS:
+    case cmPolicies::NEW:
+      ignoreErrors = false;
+      break;
+    }
+  return ignoreErrors;
+}
+
+//----------------------------------------------------------------------------
 #define FEATURE_STRING(F) , #F
 static const char * const C_FEATURES[] = {
   0
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 99f2544..e0eef6f 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -415,6 +415,8 @@ public:
   bool HasCMP0054AlreadyBeenReported(
     cmListFileContext context) const;
 
+  bool IgnoreErrorsCMP0061() const;
+
   const char* GetHomeDirectory() const;
   const char* GetHomeOutputDirectory() const;
 
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 63376dd..536dcdc 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -208,6 +208,9 @@ class cmPolicy;
     3, 3, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0060, \
     "Link libraries by full path even in implicit directories.", \
+    3, 3, 0, cmPolicies::WARN) \
+  SELECT(POLICY, CMP0061, \
+    "CTest does not by default tell make to ignore errors (-i).", \
     3, 3, 0, cmPolicies::WARN)
 
 #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
diff --git a/Tests/RunCMake/build_command/CMP0061-NEW-stderr.txt b/Tests/RunCMake/build_command/CMP0061-NEW-stderr.txt
new file mode 100644
index 0000000..1dde843
--- /dev/null
+++ b/Tests/RunCMake/build_command/CMP0061-NEW-stderr.txt
@@ -0,0 +1,10 @@
+^[^
+]+ --build \. --config "Release"
+[^
+]+ --build \. --config "Release" --target "MyTarget"
+[^
+]+ --build \. --config "Debug"
+[^
+]+ --build \. --config "Debug" --target "MyTarget"
+[^
+]+ --build \. --config "Release"$
diff --git a/Tests/RunCMake/build_command/CMP0061-NEW.cmake b/Tests/RunCMake/build_command/CMP0061-NEW.cmake
new file mode 100644
index 0000000..2e439cb
--- /dev/null
+++ b/Tests/RunCMake/build_command/CMP0061-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0061 NEW)
+include(CMP0061Common.cmake)
diff --git a/Tests/RunCMake/build_command/CMP0061-OLD-make-stderr.txt b/Tests/RunCMake/build_command/CMP0061-OLD-make-stderr.txt
new file mode 100644
index 0000000..28e0e72
--- /dev/null
+++ b/Tests/RunCMake/build_command/CMP0061-OLD-make-stderr.txt
@@ -0,0 +1,10 @@
+^[^
+]+ --build \. --config "Release" -- -i
+[^
+]+ --build \. --config "Release" --target "MyTarget" -- -i
+[^
+]+ --build \. --config "Debug" -- -i
+[^
+]+ --build \. --config "Debug" --target "MyTarget" -- -i
+[^
+]+ --build \. --config "Release" -- -i$
diff --git a/Tests/RunCMake/build_command/CMP0061-OLD-make.cmake b/Tests/RunCMake/build_command/CMP0061-OLD-make.cmake
new file mode 100644
index 0000000..1542d8c
--- /dev/null
+++ b/Tests/RunCMake/build_command/CMP0061-OLD-make.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0061 OLD)
+include(CMP0061Common.cmake)
diff --git a/Tests/RunCMake/build_command/CMP0061-OLD-other-stderr.txt b/Tests/RunCMake/build_command/CMP0061-OLD-other-stderr.txt
new file mode 100644
index 0000000..1dde843
--- /dev/null
+++ b/Tests/RunCMake/build_command/CMP0061-OLD-other-stderr.txt
@@ -0,0 +1,10 @@
+^[^
+]+ --build \. --config "Release"
+[^
+]+ --build \. --config "Release" --target "MyTarget"
+[^
+]+ --build \. --config "Debug"
+[^
+]+ --build \. --config "Debug" --target "MyTarget"
+[^
+]+ --build \. --config "Release"$
diff --git a/Tests/RunCMake/build_command/CMP0061-OLD-other.cmake b/Tests/RunCMake/build_command/CMP0061-OLD-other.cmake
new file mode 100644
index 0000000..1542d8c
--- /dev/null
+++ b/Tests/RunCMake/build_command/CMP0061-OLD-other.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0061 OLD)
+include(CMP0061Common.cmake)
diff --git a/Tests/RunCMake/build_command/CMP0061Common.cmake b/Tests/RunCMake/build_command/CMP0061Common.cmake
new file mode 100644
index 0000000..50cd7d7
--- /dev/null
+++ b/Tests/RunCMake/build_command/CMP0061Common.cmake
@@ -0,0 +1,10 @@
+build_command(command)
+message("${command}")
+build_command(command TARGET MyTarget)
+message("${command}")
+build_command(command CONFIGURATION Debug)
+message("${command}")
+build_command(command CONFIGURATION Debug TARGET MyTarget)
+message("${command}")
+build_command(cache_command "${CMAKE_MAKE_PROGRAM}")
+message("${cache_command}")
diff --git a/Tests/RunCMake/build_command/RunCMakeTest.cmake b/Tests/RunCMake/build_command/RunCMakeTest.cmake
index eaa1d77..c3bef4c 100644
--- a/Tests/RunCMake/build_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/build_command/RunCMakeTest.cmake
@@ -1,4 +1,5 @@
 include(RunCMake)
+unset(ENV{CMAKE_CONFIG_TYPE})
 
 run_cmake(ErrorsOFF)
 run_cmake(ErrorsON)
@@ -6,3 +7,10 @@ run_cmake(ErrorsON)
 set(RunCMake_TEST_OPTIONS -DNoProject=1)
 run_cmake(BeforeProject)
 unset(RunCMake_TEST_OPTIONS)
+
+run_cmake(CMP0061-NEW)
+if(RunCMake_GENERATOR MATCHES "Make")
+  run_cmake(CMP0061-OLD-make)
+else()
+  run_cmake(CMP0061-OLD-other)
+endif()
diff --git a/Tests/RunCMake/ctest_build/BuildFailure-result.txt b/Tests/RunCMake/ctest_build/BuildFailure-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_build/BuildFailure-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_build/BuildFailure-stderr.txt b/Tests/RunCMake/ctest_build/BuildFailure-stderr.txt
new file mode 100644
index 0000000..c984df0
--- /dev/null
+++ b/Tests/RunCMake/ctest_build/BuildFailure-stderr.txt
@@ -0,0 +1 @@
+^Error\(s\) when building project$
diff --git a/Tests/RunCMake/ctest_build/CMakeLists.txt.in b/Tests/RunCMake/ctest_build/CMakeLists.txt.in
index 9ba08e9..82cb7c4 100644
--- a/Tests/RunCMake/ctest_build/CMakeLists.txt.in
+++ b/Tests/RunCMake/ctest_build/CMakeLists.txt.in
@@ -2,3 +2,4 @@ cmake_minimum_required(VERSION 3.1)
 project(CTestBuild at CASE_NAME@ NONE)
 include(CTest)
 add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
+ at CASE_CMAKELISTS_SUFFIX_CODE@
diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
index 5826fe4..1b3bf56 100644
--- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
@@ -8,3 +8,19 @@ function(run_ctest_build CASE_NAME)
 endfunction()
 
 run_ctest_build(BuildQuiet QUIET)
+
+function(run_BuildFailure)
+  set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_custom_target(BuildFailure ALL COMMAND command-does-not-exist)
+]])
+  set(CASE_TEST_PREFIX_CODE [[
+cmake_policy(SET CMP0061 NEW)
+]])
+  run_ctest(BuildFailure)
+
+  if (RunCMake_GENERATOR MATCHES "Make")
+    set(CASE_TEST_PREFIX_CODE "")
+    run_ctest(BuildFailure-CMP0061-OLD)
+  endif()
+endfunction()
+run_BuildFailure()
diff --git a/Tests/RunCMake/ctest_build/test.cmake.in b/Tests/RunCMake/ctest_build/test.cmake.in
index 38c8ea1..6f89a65 100644
--- a/Tests/RunCMake/ctest_build/test.cmake.in
+++ b/Tests/RunCMake/ctest_build/test.cmake.in
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.1)
+ at CASE_TEST_PREFIX_CODE@
 
 set(CTEST_SITE                          "test-site")
 set(CTEST_BUILD_NAME                    "test-build-name")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eba9048f30279fb638403c9be425e1fadff4d837
commit eba9048f30279fb638403c9be425e1fadff4d837
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri May 8 15:39:34 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri May 8 15:40:21 2015 -0400

    Help: Fix build_command alternative signature docs
    
    Do not specify that --config will not be added, because the
    command does add it.

diff --git a/Help/command/build_command.rst b/Help/command/build_command.rst
index 82a9a42..fa971e4 100644
--- a/Help/command/build_command.rst
+++ b/Help/command/build_command.rst
@@ -32,7 +32,7 @@ This second signature is deprecated, but still available for backwards
 compatibility.  Use the first signature instead.
 
 It sets the given ``<cachevariable>`` to a command-line string as
-above but without the ``--config`` or ``--target`` options.
+above but without the ``--target`` option.
 The ``<makecommand>`` is ignored but should be the full path to
 msdev, devenv, nmake, make or one of the end user build tools
 for legacy invocations.

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

Summary of changes:
 Help/command/build_command.rst                     |    5 ++--
 Help/manual/cmake-policies.7.rst                   |    1 +
 Help/policy/CMP0061.rst                            |   24 ++++++++++++++++++++
 Help/release/dev/ctest-no-make-i.rst               |    7 ++++++
 Source/CTest/cmCTestBuildCommand.cxx               |    3 ++-
 Source/cmBuildCommand.cxx                          |    6 +++--
 Source/cmBuildCommand.h                            |    2 ++
 Source/cmMakefile.cxx                              |   20 ++++++++++++++++
 Source/cmMakefile.h                                |    2 ++
 Source/cmPolicies.h                                |    3 +++
 .../RunCMake/build_command/CMP0061-NEW-stderr.txt  |   10 ++++++++
 Tests/RunCMake/build_command/CMP0061-NEW.cmake     |    2 ++
 .../build_command/CMP0061-OLD-make-stderr.txt      |   10 ++++++++
 .../RunCMake/build_command/CMP0061-OLD-make.cmake  |    2 ++
 .../build_command/CMP0061-OLD-other-stderr.txt     |   10 ++++++++
 .../RunCMake/build_command/CMP0061-OLD-other.cmake |    2 ++
 Tests/RunCMake/build_command/CMP0061Common.cmake   |   10 ++++++++
 Tests/RunCMake/build_command/RunCMakeTest.cmake    |    8 +++++++
 .../BuildFailure-result.txt}                       |    0
 Tests/RunCMake/ctest_build/BuildFailure-stderr.txt |    1 +
 Tests/RunCMake/ctest_build/CMakeLists.txt.in       |    1 +
 Tests/RunCMake/ctest_build/RunCMakeTest.cmake      |   16 +++++++++++++
 Tests/RunCMake/ctest_build/test.cmake.in           |    1 +
 23 files changed, 141 insertions(+), 5 deletions(-)
 create mode 100644 Help/policy/CMP0061.rst
 create mode 100644 Help/release/dev/ctest-no-make-i.rst
 create mode 100644 Tests/RunCMake/build_command/CMP0061-NEW-stderr.txt
 create mode 100644 Tests/RunCMake/build_command/CMP0061-NEW.cmake
 create mode 100644 Tests/RunCMake/build_command/CMP0061-OLD-make-stderr.txt
 create mode 100644 Tests/RunCMake/build_command/CMP0061-OLD-make.cmake
 create mode 100644 Tests/RunCMake/build_command/CMP0061-OLD-other-stderr.txt
 create mode 100644 Tests/RunCMake/build_command/CMP0061-OLD-other.cmake
 create mode 100644 Tests/RunCMake/build_command/CMP0061Common.cmake
 copy Tests/RunCMake/{ctest_memcheck/DummyAddressSanitizer-result.txt => ctest_build/BuildFailure-result.txt} (100%)
 create mode 100644 Tests/RunCMake/ctest_build/BuildFailure-stderr.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list