[Cmake-commits] CMake branch, next, updated. v2.8.6-1709-g1257708
David Cole
david.cole at kitware.com
Wed Oct 26 23:43:44 EDT 2011
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 1257708ae2255006a3ba879464c4949d5b9a4670 (commit)
via 76ecdd8d169fd2565466669875b5ed7e7c5c1963 (commit)
from 1343760f09cbb205d646b0119305fed0b866ed18 (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=1257708ae2255006a3ba879464c4949d5b9a4670
commit 1257708ae2255006a3ba879464c4949d5b9a4670
Merge: 1343760 76ecdd8
Author: David Cole <david.cole at kitware.com>
AuthorDate: Wed Oct 26 23:43:41 2011 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Oct 26 23:43:41 2011 -0400
Merge topic 'fix-12539-ctestconfig-from-build-dir' into next
76ecdd8 CTest: Look for CTestConfig.cmake in build dir first, then source dir
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76ecdd8d169fd2565466669875b5ed7e7c5c1963
commit 76ecdd8d169fd2565466669875b5ed7e7c5c1963
Author: Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>
AuthorDate: Wed Oct 26 22:48:36 2011 -0400
Commit: David Cole <david.cole at kitware.com>
CommitDate: Wed Oct 26 23:23:03 2011 -0400
CTest: Look for CTestConfig.cmake in build dir first, then source dir
Provide the ability to configure CTest with settings different from the ones
available in the source tree by checking first if CTestConfig.cmake
exists in the build tree.
The motivation is to allow build system checking out external project to
test and/or package them and submit the associated results to a different
dashboard than the one specified (or not) in the source of the external
project.
For example, the build system of Slicer can checkout, build, test
and package what I will call "extensions". These extensions can be developed
by third parties who can test and submit to their own dashboard / project.
When checked out by Slicer build system, the default dashboard can now be
overwritten by adding a custom CTestConfig.cmake to the build directory.
And if not overwritten, it would avoid to create CTestConfig.cmake within
the source checkout of the extension.
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 702ba10..aa75453 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -655,10 +655,26 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
}
cmMakefile* mf = command->GetMakefile();
- std::string fname = src_dir;
- fname += "/CTestConfig.cmake";
- cmSystemTools::ConvertToUnixSlashes(fname);
- if ( cmSystemTools::FileExists(fname.c_str()) )
+ std::string fname;
+
+ std::string src_dir_fname = src_dir;
+ src_dir_fname += "/CTestConfig.cmake";
+ cmSystemTools::ConvertToUnixSlashes(src_dir_fname);
+
+ std::string bld_dir_fname = bld_dir;
+ bld_dir_fname += "/CTestConfig.cmake";
+ cmSystemTools::ConvertToUnixSlashes(bld_dir_fname);
+
+ if ( cmSystemTools::FileExists(bld_dir_fname.c_str()) )
+ {
+ fname = bld_dir_fname;
+ }
+ else if ( cmSystemTools::FileExists(src_dir_fname.c_str()) )
+ {
+ fname = src_dir_fname;
+ }
+
+ if ( !fname.empty() )
{
cmCTestLog(this, OUTPUT, " Reading ctest configuration file: "
<< fname.c_str() << std::endl);
@@ -674,8 +690,12 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
}
else
{
- cmCTestLog(this, WARNING, "Cannot locate CTest configuration: "
- << fname.c_str() << std::endl);
+ cmCTestLog(this, WARNING,
+ "Cannot locate CTest configuration: in BuildDirectory: "
+ << bld_dir_fname.c_str() << std::endl);
+ cmCTestLog(this, WARNING,
+ "Cannot locate CTest configuration: in SourceDirectory: "
+ << src_dir_fname.c_str() << std::endl);
}
this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime",
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 78db39d..21d1196 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1531,6 +1531,35 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
SET_TESTS_PROPERTIES(CTestTestUpload PROPERTIES
PASS_REGULAR_EXPRESSION "Upload\\.xml")
+ CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake"
+ @ONLY ESCAPE_QUOTES)
+ ADD_TEST(CTestTestConfigFileInBuildDir1 ${CMAKE_CTEST_COMMAND}
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake" -V
+ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/testOut1.log"
+ )
+ SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild
+ PASS_REGULAR_EXPRESSION
+ "Reading ctest configuration file: ${CMake_SOURCE_DIR}.Tests.CTestTestConfigFileInBuildDir.CTestConfig.cmake")
+
+ CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake"
+ @ONLY ESCAPE_QUOTES)
+ CONFIGURE_FILE(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake"
+ "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake"
+ @ONLY ESCAPE_QUOTES COPYONLY)
+ ADD_TEST(CTestTestConfigFileInBuildDir2 ${CMAKE_CTEST_COMMAND}
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" -V
+ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/testOut2.log"
+ )
+ SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild
+ REQUIRED_FILES ${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake
+ PASS_REGULAR_EXPRESSION
+ "Reading ctest configuration file: ${CMake_BINARY_DIR}.Tests.CTestTestConfigFileInBuildDir2.CTestConfig.cmake")
+
# Use macro, not function so that build can still be driven by CMake 2.4.
# After 2.6 is required, this could be a function without the extra 'set'
# calls.
diff --git a/Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt b/Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt
new file mode 100644
index 0000000..3c53e66
--- /dev/null
+++ b/Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(CTestTestConfigFileInBuildDir)
+include(CTest)
diff --git a/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake b/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake
new file mode 100644
index 0000000..d2c28f9
--- /dev/null
+++ b/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set(CTEST_PROJECT_NAME "CTestTestConfigFileInBuildDir")
+set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+set(CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in
new file mode 100644
index 0000000..498cab2
--- /dev/null
+++ b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in
@@ -0,0 +1,17 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "CTestTest- at BUILDNAME@-ConfigFileInBuildDir1")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir1")
+SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in
new file mode 100644
index 0000000..d359f2d
--- /dev/null
+++ b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in
@@ -0,0 +1,17 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE "@SITE@")
+SET(CTEST_BUILD_NAME "CTestTest- at BUILDNAME@-ConfigFileInBuildDir2")
+
+SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir")
+SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir2")
+SET(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
-----------------------------------------------------------------------
Summary of changes:
Source/cmCTest.cxx | 32 ++++++++++++++++----
Tests/CMakeLists.txt | 29 ++++++++++++++++++
Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt | 3 ++
.../CTestConfig.cmake | 4 +-
.../test1.cmake.in} | 10 ++----
.../test2.cmake.in} | 10 ++----
6 files changed, 68 insertions(+), 20 deletions(-)
create mode 100644 Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt
copy Tests/{CTestTestParallel => CTestTestConfigFileInBuildDir}/CTestConfig.cmake (66%)
copy Tests/{CTestTestCycle/test.cmake.in => CTestTestConfigFileInBuildDir/test1.cmake.in} (78%)
copy Tests/{CTestTestCycle/test.cmake.in => CTestTestConfigFileInBuildDir/test2.cmake.in} (78%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list