diff options
author | Brad King <brad.king@kitware.com> | 2009-08-03 17:37:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-08-03 17:37:36 (GMT) |
commit | 73de2362ddfcef151709e2162c0e384623da8890 (patch) | |
tree | 99c6a15307d8be45792c194ab8cbab0ea3585936 /Source/cmGlobalGenerator.cxx | |
parent | 1a159bbf331104fe680d3f37b703916a910a69f9 (diff) | |
download | CMake-73de2362ddfcef151709e2162c0e384623da8890.zip CMake-73de2362ddfcef151709e2162c0e384623da8890.tar.gz CMake-73de2362ddfcef151709e2162c0e384623da8890.tar.bz2 |
Fix recursive try_compile calls
When building an entire source tree with try_compile instead of just a
single source file, it is possible that the CMakeLists.txt file in the
try-compiled project invokes try_compile. This commit fixes propagation
of language-initialization results from the outer-most project into any
number of try-compile levels.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index a8455db..a798200 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1343,9 +1343,7 @@ cmLocalGenerator *cmGlobalGenerator::CreateLocalGenerator() void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen ) { - std::string cfp = gen->GetCMakeInstance()->GetHomeOutputDirectory(); - cfp += cmake::GetCMakeFilesDirectory(); - this->SetConfiguredFilesPath(cfp.c_str()); + this->SetConfiguredFilesPath(gen); const char* make = gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM"); this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make, @@ -1361,6 +1359,20 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen ) } //---------------------------------------------------------------------------- +void cmGlobalGenerator::SetConfiguredFilesPath(cmGlobalGenerator* gen) +{ + if(!gen->ConfiguredFilesPath.empty()) + { + this->ConfiguredFilesPath = gen->ConfiguredFilesPath; + } + else + { + this->ConfiguredFilesPath = gen->CMakeInstance->GetHomeOutputDirectory(); + this->ConfiguredFilesPath += cmake::GetCMakeFilesDirectory(); + } +} + +//---------------------------------------------------------------------------- void cmGlobalGenerator::GetDocumentation(cmDocumentationEntry& entry) const { entry.Name = this->GetName(); |