diff options
author | Brad King <brad.king@kitware.com> | 2008-07-03 17:55:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-07-03 17:55:33 (GMT) |
commit | dd1ee6975f9becafd81029e337f1c5cf5b183734 (patch) | |
tree | 734dff69306a3d055980d297a87bb3a0baf213ed /Source/cmake.cxx | |
parent | 1342965b05f7bf319e02664e4d2231fa6234c3d9 (diff) | |
download | CMake-dd1ee6975f9becafd81029e337f1c5cf5b183734.zip CMake-dd1ee6975f9becafd81029e337f1c5cf5b183734.tar.gz CMake-dd1ee6975f9becafd81029e337f1c5cf5b183734.tar.bz2 |
ENH: Do not auto-create out-dated cache variables
- We used to always put LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH
in the cache if the project did not.
- In CMake 2.6 these variables should no longer be used.
- Now add them only if CMAKE_BACKWARDS_COMPATIBILITY is also cached.
- This happens only when CMP0001 is set to OLD or WARN or if
the user or project sets it. In any case compatibility is needed.
- Reported by Miguel A. Figueroa-Villanueva and Philip Lowman.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5f933a1..e9ccf06 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2091,22 +2091,30 @@ int cmake::ActualConfigure() // Before saving the cache // if the project did not define one of the entries below, add them now // so users can edit the values in the cache: - // LIBRARY_OUTPUT_PATH - // EXECUTABLE_OUTPUT_PATH - if(!this->CacheManager->GetCacheValue("LIBRARY_OUTPUT_PATH")) - { - this->CacheManager->AddCacheEntry - ("LIBRARY_OUTPUT_PATH", "", - "Single output directory for building all libraries.", - cmCacheManager::PATH); - } - if(!this->CacheManager->GetCacheValue("EXECUTABLE_OUTPUT_PATH")) + + // We used to always present LIBRARY_OUTPUT_PATH and + // EXECUTABLE_OUTPUT_PATH. They are now documented as old-style and + // should no longer be used. Therefore we present them only if the + // project requires compatibility with CMake 2.4. We detect this + // here by looking for the old CMAKE_BACKWARDS_COMPATABILITY + // variable created when CMP0001 is not set to NEW. + if(this->GetCacheManager()->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { - this->CacheManager->AddCacheEntry - ("EXECUTABLE_OUTPUT_PATH", "", - "Single output directory for building all executables.", - cmCacheManager::PATH); - } + if(!this->CacheManager->GetCacheValue("LIBRARY_OUTPUT_PATH")) + { + this->CacheManager->AddCacheEntry + ("LIBRARY_OUTPUT_PATH", "", + "Single output directory for building all libraries.", + cmCacheManager::PATH); + } + if(!this->CacheManager->GetCacheValue("EXECUTABLE_OUTPUT_PATH")) + { + this->CacheManager->AddCacheEntry + ("EXECUTABLE_OUTPUT_PATH", "", + "Single output directory for building all executables.", + cmCacheManager::PATH); + } + } if(!this->CacheManager->GetCacheValue("CMAKE_USE_RELATIVE_PATHS")) { this->CacheManager->AddCacheEntry |