diff options
author | Brad King <brad.king@kitware.com> | 2014-01-21 19:14:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-01-21 19:14:49 (GMT) |
commit | 82d431750389e521f021772d5d01337b6dc8c0de (patch) | |
tree | 575c58211273c0524bb63c1aab253363fefb08eb /Source | |
parent | 1ef444d67819afc43444b7b501543eeca284b177 (diff) | |
download | CMake-82d431750389e521f021772d5d01337b6dc8c0de.zip CMake-82d431750389e521f021772d5d01337b6dc8c0de.tar.gz CMake-82d431750389e521f021772d5d01337b6dc8c0de.tar.bz2 |
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.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 24 | ||||
-rw-r--r-- | Source/cmMakefile.h | 1 |
3 files changed, 27 insertions, 0 deletions
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 |