[Cmake-commits] CMake branch, next, updated. v2.8.12.1-7212-g17eae5e
Brad King
brad.king at kitware.com
Tue Jan 21 14:28:32 EST 2014
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 17eae5e869d5aa2c2180b1736273d2ca1f062075 (commit)
via 82d431750389e521f021772d5d01337b6dc8c0de (commit)
via 1ef444d67819afc43444b7b501543eeca284b177 (commit)
from 9e4f373273a0deced509f8e1d7e8a6f7d7e66873 (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=17eae5e869d5aa2c2180b1736273d2ca1f062075
commit 17eae5e869d5aa2c2180b1736273d2ca1f062075
Merge: 9e4f373 82d4317
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 21 14:28:30 2014 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 21 14:28:30 2014 -0500
Merge topic 'cmake-rerun-depends' into next
82d43175 Allow projects to specify extra inputs to CMake
1ef444d6 Add test case to verify CMake does not re-run on first build
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82d431750389e521f021772d5d01337b6dc8c0de
commit 82d431750389e521f021772d5d01337b6dc8c0de
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 21 14:14:49 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 21 14:14:49 2014 -0500
Allow projects to specify extra inputs to CMake
Define a new 'CMAKE_CONFIGURE_DEPENDS' directory property that projects
can use to specify input files to the CMake configuration process.
Extend the RunCMake.Configure test to verify that the build system
re-runs CMake when this input changes.
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index c0ec0fe..d315fcb 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -48,6 +48,7 @@ Properties on Directories
/prop_dir/ADDITIONAL_MAKE_CLEAN_FILES
/prop_dir/CACHE_VARIABLES
/prop_dir/CLEAN_NO_CUSTOM
+ /prop_dir/CMAKE_CONFIGURE_DEPENDS
/prop_dir/COMPILE_DEFINITIONS_CONFIG
/prop_dir/COMPILE_DEFINITIONS
/prop_dir/COMPILE_OPTIONS
diff --git a/Help/prop_dir/CMAKE_CONFIGURE_DEPENDS.rst b/Help/prop_dir/CMAKE_CONFIGURE_DEPENDS.rst
new file mode 100644
index 0000000..b1aef19
--- /dev/null
+++ b/Help/prop_dir/CMAKE_CONFIGURE_DEPENDS.rst
@@ -0,0 +1,9 @@
+CMAKE_CONFIGURE_DEPENDS
+-----------------------
+
+Tell CMake about additional input files to the configuration process.
+If any named file is modified the build system will re-run CMake to
+re-configure the file and generate the build system again.
+
+Specify files as a semicolon-separated list of paths. Relative paths
+are interpreted as relative to the current source directory.
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index bd910e2..c13b8ee 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -114,6 +114,8 @@ void cmLocalGenerator::Configure()
}
}
+ this->Makefile->AddCMakeDependFilesFromUser();
+
// Check whether relative paths should be used for optionally
// relative paths.
this->UseRelativePaths = this->Makefile->IsOn("CMAKE_USE_RELATIVE_PATHS");
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 222cdb6..856462e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3913,6 +3913,30 @@ cmTest* cmMakefile::GetTest(const char* testName) const
return 0;
}
+void cmMakefile::AddCMakeDependFilesFromUser()
+{
+ std::vector<std::string> deps;
+ if(const char* deps_str = this->GetProperty("CMAKE_CONFIGURE_DEPENDS"))
+ {
+ cmSystemTools::ExpandListArgument(deps_str, deps);
+ }
+ for(std::vector<std::string>::iterator i = deps.begin();
+ i != deps.end(); ++i)
+ {
+ if(cmSystemTools::FileIsFullPath(i->c_str()))
+ {
+ this->AddCMakeDependFile(*i);
+ }
+ else
+ {
+ std::string f = this->GetCurrentDirectory();
+ f += "/";
+ f += *i;
+ this->AddCMakeDependFile(f);
+ }
+ }
+}
+
std::string cmMakefile::GetListFileStack()
{
cmOStringStream tmp;
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 0232ffe..dadf7ff 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -650,6 +650,7 @@ public:
///! When the file changes cmake will be re-run from the build system.
void AddCMakeDependFile(const std::string& file)
{ this->ListFiles.push_back(file);}
+ void AddCMakeDependFilesFromUser();
/**
* Get the list file stack as a string
diff --git a/Tests/RunCMake/Configure/RerunCMake-build1-check.cmake b/Tests/RunCMake/Configure/RerunCMake-build1-check.cmake
index 3fb557f..dbf8f67 100644
--- a/Tests/RunCMake/Configure/RerunCMake-build1-check.cmake
+++ b/Tests/RunCMake/Configure/RerunCMake-build1-check.cmake
@@ -2,3 +2,8 @@ file(READ ${stamp} content)
if(NOT content STREQUAL 1)
set(RunCMake_TEST_FAILED "Expected stamp '1' but got: '${content}'")
endif()
+
+file(READ ${output} content)
+if(NOT content STREQUAL 1)
+ set(RunCMake_TEST_FAILED "Expected output '1' but got: '${content}'")
+endif()
diff --git a/Tests/RunCMake/Configure/RerunCMake-build2-check.cmake b/Tests/RunCMake/Configure/RerunCMake-build2-check.cmake
new file mode 100644
index 0000000..a4897e5
--- /dev/null
+++ b/Tests/RunCMake/Configure/RerunCMake-build2-check.cmake
@@ -0,0 +1,9 @@
+file(READ ${stamp} content)
+if(NOT content STREQUAL 2)
+ set(RunCMake_TEST_FAILED "Expected stamp '2' but got: '${content}'")
+endif()
+
+file(READ ${output} content)
+if(NOT content STREQUAL 2)
+ set(RunCMake_TEST_FAILED "Expected output '2' but got: '${content}'")
+endif()
diff --git a/Tests/RunCMake/Configure/RerunCMake.cmake b/Tests/RunCMake/Configure/RerunCMake.cmake
index 854c9a2..5a561bf 100644
--- a/Tests/RunCMake/Configure/RerunCMake.cmake
+++ b/Tests/RunCMake/Configure/RerunCMake.cmake
@@ -2,3 +2,10 @@ set(input ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeInput.txt)
set(stamp ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeStamp.txt)
file(READ ${input} content)
file(WRITE ${stamp} "${content}")
+
+set(depend ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeDepend.txt)
+set(output ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeOutput.txt)
+set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${depend})
+file(READ ${depend} content)
+file(WRITE ${output} "${content}")
+set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS RerunCMake.txt)
diff --git a/Tests/RunCMake/Configure/RerunCMake.txt b/Tests/RunCMake/Configure/RerunCMake.txt
new file mode 100644
index 0000000..15598c1
--- /dev/null
+++ b/Tests/RunCMake/Configure/RerunCMake.txt
@@ -0,0 +1 @@
+Source-tree dependency for "RerunCMake.cmake".
diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake
index e748498..5ef0384 100644
--- a/Tests/RunCMake/Configure/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake
@@ -10,10 +10,15 @@ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
set(input "${RunCMake_TEST_BINARY_DIR}/CustomCMakeInput.txt")
set(stamp "${RunCMake_TEST_BINARY_DIR}/CustomCMakeStamp.txt")
+set(depend "${RunCMake_TEST_BINARY_DIR}/CustomCMakeDepend.txt")
+set(output "${RunCMake_TEST_BINARY_DIR}/CustomCMakeOutput.txt")
file(WRITE "${input}" "1")
+file(WRITE "${depend}" "1")
run_cmake(RerunCMake)
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
file(WRITE "${input}" "2")
run_cmake_command(RerunCMake-build1 ${CMAKE_COMMAND} --build .)
+file(WRITE "${depend}" "2")
+run_cmake_command(RerunCMake-build2 ${CMAKE_COMMAND} --build .)
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ef444d67819afc43444b7b501543eeca284b177
commit 1ef444d67819afc43444b7b501543eeca284b177
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 21 11:33:56 2014 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 21 13:57:15 2014 -0500
Add test case to verify CMake does not re-run on first build
Extend the RunCMake.Configure with a case to verify that the CMake
configuration process does not immediately re-run the first time that
the generated build system is invoked.
diff --git a/Tests/RunCMake/Configure/RerunCMake-build1-check.cmake b/Tests/RunCMake/Configure/RerunCMake-build1-check.cmake
new file mode 100644
index 0000000..3fb557f
--- /dev/null
+++ b/Tests/RunCMake/Configure/RerunCMake-build1-check.cmake
@@ -0,0 +1,4 @@
+file(READ ${stamp} content)
+if(NOT content STREQUAL 1)
+ set(RunCMake_TEST_FAILED "Expected stamp '1' but got: '${content}'")
+endif()
diff --git a/Tests/RunCMake/Configure/RerunCMake.cmake b/Tests/RunCMake/Configure/RerunCMake.cmake
new file mode 100644
index 0000000..854c9a2
--- /dev/null
+++ b/Tests/RunCMake/Configure/RerunCMake.cmake
@@ -0,0 +1,4 @@
+set(input ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeInput.txt)
+set(stamp ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeStamp.txt)
+file(READ ${input} content)
+file(WRITE ${stamp} "${content}")
diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake
index 79e4060..e748498 100644
--- a/Tests/RunCMake/Configure/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake
@@ -2,3 +2,18 @@ include(RunCMake)
run_cmake(ErrorLogs)
run_cmake(FailCopyFileABI)
+
+# Use a single build tree for a few tests without cleaning.
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build)
+set(RunCMake_TEST_NO_CLEAN 1)
+file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+set(input "${RunCMake_TEST_BINARY_DIR}/CustomCMakeInput.txt")
+set(stamp "${RunCMake_TEST_BINARY_DIR}/CustomCMakeStamp.txt")
+file(WRITE "${input}" "1")
+run_cmake(RerunCMake)
+execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
+file(WRITE "${input}" "2")
+run_cmake_command(RerunCMake-build1 ${CMAKE_COMMAND} --build .)
+unset(RunCMake_TEST_BINARY_DIR)
+unset(RunCMake_TEST_NO_CLEAN)
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake-properties.7.rst | 1 +
Help/prop_dir/CMAKE_CONFIGURE_DEPENDS.rst | 9 ++++++++
Source/cmLocalGenerator.cxx | 2 ++
Source/cmMakefile.cxx | 24 ++++++++++++++++++++
Source/cmMakefile.h | 1 +
.../Configure/RerunCMake-build1-check.cmake | 9 ++++++++
.../Configure/RerunCMake-build2-check.cmake | 9 ++++++++
Tests/RunCMake/Configure/RerunCMake.cmake | 11 +++++++++
Tests/RunCMake/Configure/RerunCMake.txt | 1 +
Tests/RunCMake/Configure/RunCMakeTest.cmake | 20 ++++++++++++++++
10 files changed, 87 insertions(+)
create mode 100644 Help/prop_dir/CMAKE_CONFIGURE_DEPENDS.rst
create mode 100644 Tests/RunCMake/Configure/RerunCMake-build1-check.cmake
create mode 100644 Tests/RunCMake/Configure/RerunCMake-build2-check.cmake
create mode 100644 Tests/RunCMake/Configure/RerunCMake.cmake
create mode 100644 Tests/RunCMake/Configure/RerunCMake.txt
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list