summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-06-18 19:31:43 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-06-18 19:31:43 (GMT)
commit145fac96fc45d8143fdec6d5db8e05ffcdc1de35 (patch)
treebe42015590cd0a2eb565bdd265be86d98a3cb782 /Source/cmake.cxx
parent37c072b324b27f9659dfd53a376834efbda02c38 (diff)
downloadCMake-145fac96fc45d8143fdec6d5db8e05ffcdc1de35.zip
CMake-145fac96fc45d8143fdec6d5db8e05ffcdc1de35.tar.gz
CMake-145fac96fc45d8143fdec6d5db8e05ffcdc1de35.tar.bz2
ENH: move EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH initial creation to after the CMakeLists.txt files have been parsed
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx40
1 files changed, 23 insertions, 17 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 8d782af..6b67ef0 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -134,20 +134,7 @@ void cmake::AddCMakePaths(const std::vector<std::string>& args)
cmSystemTools::ConvertToUnixSlashes(cMakeSelf);
cMakeSelf = cmSystemTools::FindProgram(cMakeSelf.c_str());
- if(!cmCacheManager::GetInstance()->GetCacheValue("LIBRARY_OUTPUT_PATH"))
- {
- cmCacheManager::GetInstance()->AddCacheEntry("LIBRARY_OUTPUT_PATH", "",
- "Single output directory for building all libraries.",
- cmCacheManager::PATH);
- }
- if(!cmCacheManager::GetInstance()->GetCacheValue("EXECUTABLE_OUTPUT_PATH"))
- {
- cmCacheManager::GetInstance()->AddCacheEntry("EXECUTABLE_OUTPUT_PATH", "",
- "Single output directory for building all executables.",
- cmCacheManager::PATH);
- }
-
- // Save the value in the cache
+ // Save the value in the cache
cmCacheManager::GetInstance()->AddCacheEntry
("CMAKE_COMMAND",
cmSystemTools::EscapeSpaces(cMakeSelf.c_str()).c_str(),
@@ -238,12 +225,31 @@ int cmake::Generate(const std::vector<std::string>& args)
lf += "/CMakeLists.txt";
if(!mf.ReadListFile(lf.c_str()))
{
- this->Usage(args[0].c_str());
- return -1;
+ this->Usage(args[0].c_str());
+ return -1;
}
mf.GenerateMakefile();
+
+ // Before saving the cache
+ // if the project did not define LIBRARY_OUTPUT_PATH and
+ // EXECUTABLE_OUTPUT_PATH, add them now, so users
+ // can edit the values in the cache.
+ if(!cmCacheManager::GetInstance()->GetCacheValue("LIBRARY_OUTPUT_PATH"))
+ {
+ cmCacheManager::GetInstance()->AddCacheEntry("LIBRARY_OUTPUT_PATH", "",
+ "Single output directory for building all libraries.",
+ cmCacheManager::PATH);
+ }
+ if(!cmCacheManager::GetInstance()->GetCacheValue("EXECUTABLE_OUTPUT_PATH"))
+ {
+ cmCacheManager::GetInstance()->AddCacheEntry("EXECUTABLE_OUTPUT_PATH", "",
+ "Single output directory for building all executables.",
+ cmCacheManager::PATH);
+ }
+
+
cmCacheManager::GetInstance()->SaveCache(&mf);
-
+
if(m_Verbose)
{
cmCacheManager::GetInstance()->PrintCache(std::cout);