[Cmake-commits] CMake branch, next, updated. v2.8.10.2-2485-gc29248e

Brad King brad.king at kitware.com
Tue Mar 12 18:32:08 EDT 2013


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  c29248e130c1c90c873714d0fb99a954c9d164c5 (commit)
       via  d90f49b8948c3047cb0839ce505f796952dbd880 (commit)
       via  2e1c2bd2dd97e426944d6ac18e4073ec26ddf64c (commit)
       via  4e5cb375901293e8fedb5d8e44d1481e3f6799d6 (commit)
      from  65df2d9bcfb41d117eb639dfa6e9af6111e6b7da (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=c29248e130c1c90c873714d0fb99a954c9d164c5
commit c29248e130c1c90c873714d0fb99a954c9d164c5
Merge: 65df2d9 d90f49b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 12 18:32:06 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Mar 12 18:32:06 2013 -0400

    Merge topic 'cleanup-early-include-CTest-failure' into next
    
    d90f49b CTest: Fail early without PROJECT_BINARY_DIR (#14005)
    2e1c2bd build_command: Fail early without CMAKE_MAKE_PROGRAM (#14005)
    4e5cb37 Refactor RunCMake.build_command test to allow more cases


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d90f49b8948c3047cb0839ce505f796952dbd880
commit d90f49b8948c3047cb0839ce505f796952dbd880
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 12 18:20:01 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 12 18:20:44 2013 -0400

    CTest: Fail early without PROJECT_BINARY_DIR (#14005)
    
    Do not use PROJECT_BINARY_DIR before it is defined.  If it is not
    defined when needed, fail with an error message suggesting that the
    project() command be invoked first.

diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index fd4bd80..5b6e062 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -16,6 +16,10 @@ if(NOT RUN_FROM_CTEST_OR_DART)
   message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
 endif()
 
+if(NOT PROJECT_BINARY_DIR)
+  message(FATAL_ERROR "Do not include(CTest) before calling project().")
+endif()
+
 # make directories in the binary tree
 file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
 get_filename_component(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index dba772d..4b4bd31 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -52,6 +52,7 @@ if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 3)
 endif()
 
 add_RunCMake_test(CMP0019)
+add_RunCMake_test(CTest)
 if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
   add_RunCMake_test(CompilerChange)
 endif()
diff --git a/Tests/RunCMake/CTest/BeforeProject-result.txt b/Tests/RunCMake/CTest/BeforeProject-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTest/BeforeProject-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTest/BeforeProject-stderr.txt b/Tests/RunCMake/CTest/BeforeProject-stderr.txt
new file mode 100644
index 0000000..354896b
--- /dev/null
+++ b/Tests/RunCMake/CTest/BeforeProject-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at .*/Modules/CTest.cmake:[0-9]+ \(build_command\):
+  build_command\(\) requires CMAKE_MAKE_PROGRAM to be defined.  Call project\(\)
+  or enable_language\(\) first.
+Call Stack \(most recent call first\):
+  BeforeProject.cmake:[0-9]+ \(include\)
+  CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CTest/BeforeProject.cmake b/Tests/RunCMake/CTest/BeforeProject.cmake
new file mode 100644
index 0000000..903ca69
--- /dev/null
+++ b/Tests/RunCMake/CTest/BeforeProject.cmake
@@ -0,0 +1,2 @@
+include(CTest)
+project(${RunCMake_TEST} NONE)
diff --git a/Tests/RunCMake/CTest/CMakeLists.txt b/Tests/RunCMake/CTest/CMakeLists.txt
new file mode 100644
index 0000000..f6e84c0
--- /dev/null
+++ b/Tests/RunCMake/CTest/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8)
+if(NOT NoProject)
+  project(${RunCMake_TEST} NONE)
+endif()
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CTest/RunCMakeTest.cmake b/Tests/RunCMake/CTest/RunCMakeTest.cmake
new file mode 100644
index 0000000..a6f6842
--- /dev/null
+++ b/Tests/RunCMake/CTest/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+set(RunCMake_TEST_OPTIONS -DNoProject=1)
+run_cmake(BeforeProject)
+unset(RunCMake_TEST_OPTIONS)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e1c2bd2dd97e426944d6ac18e4073ec26ddf64c
commit 2e1c2bd2dd97e426944d6ac18e4073ec26ddf64c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 12 18:12:52 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 12 18:17:40 2013 -0400

    build_command: Fail early without CMAKE_MAKE_PROGRAM (#14005)
    
    If CMAKE_MAKE_PROGRAM is not set fail with an error message instead of
    crashing.  Suggest calling project() or enable_language() first to
    ensure that CMAKE_MAKE_PROGRAM is set.

diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index 3722ab6..91d55a5 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -87,6 +87,14 @@ bool cmBuildCommand
 
   const char* makeprogram
     = this->Makefile->GetDefinition("CMAKE_MAKE_PROGRAM");
+  if(!makeprogram)
+    {
+    this->Makefile->IssueMessage(
+      cmake::FATAL_ERROR,
+      "build_command() requires CMAKE_MAKE_PROGRAM to be defined.  "
+      "Call project() or enable_language() first.");
+    return true;
+    }
 
   // If null/empty CONFIGURATION argument, GenerateBuildCommand uses 'Debug'
   // in the currently implemented multi-configuration global generators...
diff --git a/Tests/RunCMake/build_command/BeforeProject-result.txt b/Tests/RunCMake/build_command/BeforeProject-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/build_command/BeforeProject-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/build_command/BeforeProject-stderr.txt b/Tests/RunCMake/build_command/BeforeProject-stderr.txt
new file mode 100644
index 0000000..d3d7661
--- /dev/null
+++ b/Tests/RunCMake/build_command/BeforeProject-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at BeforeProject.cmake:[0-9]+ \(build_command\):
+  build_command\(\) requires CMAKE_MAKE_PROGRAM to be defined.  Call project\(\)
+  or enable_language\(\) first.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/build_command/BeforeProject.cmake b/Tests/RunCMake/build_command/BeforeProject.cmake
new file mode 100644
index 0000000..15788d1
--- /dev/null
+++ b/Tests/RunCMake/build_command/BeforeProject.cmake
@@ -0,0 +1,2 @@
+build_command(MAKECOMMAND_DEFAULT_VALUE)
+project(${RunCMake_TEST} NONE)
diff --git a/Tests/RunCMake/build_command/CMakeLists.txt b/Tests/RunCMake/build_command/CMakeLists.txt
index e8db6b0..f6e84c0 100644
--- a/Tests/RunCMake/build_command/CMakeLists.txt
+++ b/Tests/RunCMake/build_command/CMakeLists.txt
@@ -1,3 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-project(${RunCMake_TEST} NONE)
+if(NOT NoProject)
+  project(${RunCMake_TEST} NONE)
+endif()
 include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/build_command/RunCMakeTest.cmake b/Tests/RunCMake/build_command/RunCMakeTest.cmake
index 4525c57..eaa1d77 100644
--- a/Tests/RunCMake/build_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/build_command/RunCMakeTest.cmake
@@ -2,3 +2,7 @@ include(RunCMake)
 
 run_cmake(ErrorsOFF)
 run_cmake(ErrorsON)
+
+set(RunCMake_TEST_OPTIONS -DNoProject=1)
+run_cmake(BeforeProject)
+unset(RunCMake_TEST_OPTIONS)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e5cb375901293e8fedb5d8e44d1481e3f6799d6
commit 4e5cb375901293e8fedb5d8e44d1481e3f6799d6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 12 18:07:52 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Mar 12 18:09:22 2013 -0400

    Refactor RunCMake.build_command test to allow more cases
    
    Move the ErrorsOFF/ON common logic from CMakeLists.txt into an
    ErrorsCommon file to allow other test cases to be added that do not use
    the Errors test logic.

diff --git a/Tests/RunCMake/build_command/CMakeLists.txt b/Tests/RunCMake/build_command/CMakeLists.txt
index 0fbb948..e8db6b0 100644
--- a/Tests/RunCMake/build_command/CMakeLists.txt
+++ b/Tests/RunCMake/build_command/CMakeLists.txt
@@ -1,59 +1,3 @@
 cmake_minimum_required(VERSION 2.8)
 project(${RunCMake_TEST} NONE)
 include(${RunCMake_TEST}.cmake)
-
-# This CMakeLists file is *sometimes expected* to result in a configure error.
-#
-# expect this to succeed:
-# ../bin/Release/cmake -G Xcode
-#   ../../CMake/Tests/CMakeCommands/build_command
-#
-# expect this to fail:
-# ../bin/Release/cmake -DTEST_ERROR_CONDITIONS:BOOL=ON -G Xcode
-#   ../../CMake/Tests/CMakeCommands/build_command
-#
-# This project exists merely to test the CMake command 'build_command'...
-# ...even purposefully calling it with known-bad argument lists to cover
-# error handling code.
-#
-
-set(cmd "initial")
-
-message("0. begin")
-
-if(TEST_ERROR_CONDITIONS)
-  # Test with no arguments (an error):
-  build_command()
-  message("1. cmd='${cmd}'")
-
-  # Test with unknown arguments (also an error):
-  build_command(cmd BOGUS STUFF)
-  message("2. cmd='${cmd}'")
-
-  build_command(cmd STUFF BOGUS)
-  message("3. cmd='${cmd}'")
-else()
-  message("(skipping cases 1, 2 and 3 because TEST_ERROR_CONDITIONS is OFF)")
-endif()
-
-# Test the one arg signature with none of the optional KEYWORD arguments:
-build_command(cmd)
-message("4. cmd='${cmd}'")
-
-# Test the two-arg legacy signature:
-build_command(legacy_cmd ${CMAKE_BUILD_TOOL})
-message("5. legacy_cmd='${legacy_cmd}'")
-message("   CMAKE_BUILD_TOOL='${CMAKE_BUILD_TOOL}'")
-
-# Test the optional KEYWORDs:
-build_command(cmd CONFIGURATION hoohaaConfig)
-message("6. cmd='${cmd}'")
-
-build_command(cmd PROJECT_NAME hoohaaProject)
-message("7. cmd='${cmd}'")
-
-build_command(cmd TARGET hoohaaTarget)
-message("8. cmd='${cmd}'")
-
-set(cmd "final")
-message("9. cmd='${cmd}'")
diff --git a/Tests/RunCMake/build_command/CMakeLists.txt b/Tests/RunCMake/build_command/ErrorsCommon.cmake
similarity index 93%
copy from Tests/RunCMake/build_command/CMakeLists.txt
copy to Tests/RunCMake/build_command/ErrorsCommon.cmake
index 0fbb948..d224539 100644
--- a/Tests/RunCMake/build_command/CMakeLists.txt
+++ b/Tests/RunCMake/build_command/ErrorsCommon.cmake
@@ -1,7 +1,3 @@
-cmake_minimum_required(VERSION 2.8)
-project(${RunCMake_TEST} NONE)
-include(${RunCMake_TEST}.cmake)
-
 # This CMakeLists file is *sometimes expected* to result in a configure error.
 #
 # expect this to succeed:
diff --git a/Tests/RunCMake/build_command/ErrorsOFF.cmake b/Tests/RunCMake/build_command/ErrorsOFF.cmake
index a243fab..7b9cac6 100644
--- a/Tests/RunCMake/build_command/ErrorsOFF.cmake
+++ b/Tests/RunCMake/build_command/ErrorsOFF.cmake
@@ -1 +1,2 @@
 set(TEST_ERROR_CONDITIONS OFF)
+include(ErrorsCommon.cmake)
diff --git a/Tests/RunCMake/build_command/ErrorsON-stderr.txt b/Tests/RunCMake/build_command/ErrorsON-stderr.txt
index 0be7475..47a84d6 100644
--- a/Tests/RunCMake/build_command/ErrorsON-stderr.txt
+++ b/Tests/RunCMake/build_command/ErrorsON-stderr.txt
@@ -1,12 +1,21 @@
-CMake Error at CMakeLists.txt:[0-9]+ \(build_command\):
+CMake Error at ErrorsCommon.cmake:[0-9]+ \(build_command\):
   build_command requires at least one argument naming a CMake variable
+Call Stack \(most recent call first\):
+  ErrorsON.cmake:[0-9]+ \(include\)
+  CMakeLists.txt:[0-9]+ \(include\)
 
 +
 1. cmd='initial'
-CMake Error at CMakeLists.txt:[0-9]+ \(build_command\):
+CMake Error at ErrorsCommon.cmake:[0-9]+ \(build_command\):
   build_command unknown argument "BOGUS"
+Call Stack \(most recent call first\):
+  ErrorsON.cmake:[0-9]+ \(include\)
+  CMakeLists.txt:[0-9]+ \(include\)
 
 +
 2. cmd='initial'
-CMake Error at CMakeLists.txt:[0-9]+ \(build_command\):
+CMake Error at ErrorsCommon.cmake:[0-9]+ \(build_command\):
   build_command unknown argument "STUFF"
+Call Stack \(most recent call first\):
+  ErrorsON.cmake:[0-9]+ \(include\)
+  CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/build_command/ErrorsON.cmake b/Tests/RunCMake/build_command/ErrorsON.cmake
index 27814bf..d7b709b 100644
--- a/Tests/RunCMake/build_command/ErrorsON.cmake
+++ b/Tests/RunCMake/build_command/ErrorsON.cmake
@@ -1 +1,2 @@
 set(TEST_ERROR_CONDITIONS ON)
+include(ErrorsCommon.cmake)

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

Summary of changes:
 Modules/CTestTargets.cmake                         |    4 +
 Source/cmBuildCommand.cxx                          |    8 +++
 Tests/RunCMake/CMakeLists.txt                      |    1 +
 .../BeforeProject-result.txt}                      |    0
 Tests/RunCMake/CTest/BeforeProject-stderr.txt      |    6 ++
 Tests/RunCMake/CTest/BeforeProject.cmake           |    2 +
 .../{CompatibleInterface => CTest}/CMakeLists.txt  |    4 +-
 Tests/RunCMake/CTest/RunCMakeTest.cmake            |    5 ++
 .../BeforeProject-result.txt}                      |    0
 .../build_command/BeforeProject-stderr.txt         |    5 ++
 Tests/RunCMake/build_command/BeforeProject.cmake   |    2 +
 Tests/RunCMake/build_command/CMakeLists.txt        |   60 +-------------------
 .../{CMakeLists.txt => ErrorsCommon.cmake}         |    4 -
 Tests/RunCMake/build_command/ErrorsOFF.cmake       |    1 +
 Tests/RunCMake/build_command/ErrorsON-stderr.txt   |   15 ++++-
 Tests/RunCMake/build_command/ErrorsON.cmake        |    1 +
 Tests/RunCMake/build_command/RunCMakeTest.cmake    |    4 +
 17 files changed, 57 insertions(+), 65 deletions(-)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CTest/BeforeProject-result.txt} (100%)
 create mode 100644 Tests/RunCMake/CTest/BeforeProject-stderr.txt
 create mode 100644 Tests/RunCMake/CTest/BeforeProject.cmake
 copy Tests/RunCMake/{CompatibleInterface => CTest}/CMakeLists.txt (53%)
 create mode 100644 Tests/RunCMake/CTest/RunCMakeTest.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => build_command/BeforeProject-result.txt} (100%)
 create mode 100644 Tests/RunCMake/build_command/BeforeProject-stderr.txt
 create mode 100644 Tests/RunCMake/build_command/BeforeProject.cmake
 copy Tests/RunCMake/build_command/{CMakeLists.txt => ErrorsCommon.cmake} (93%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list