summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-11-07 14:04:20 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-11-07 14:04:20 (GMT)
commit7274abe460d145aeb9cbfade17c6671cac7e22e5 (patch)
treed097aa820e7e2e19bff3f0b6f31d75af07d4445a /Source
parent5c6355ecbdabef4d8b7ece2a38dad357fa775a99 (diff)
downloadCMake-7274abe460d145aeb9cbfade17c6671cac7e22e5.zip
CMake-7274abe460d145aeb9cbfade17c6671cac7e22e5.tar.gz
CMake-7274abe460d145aeb9cbfade17c6671cac7e22e5.tar.bz2
Revert back
Diffstat (limited to 'Source')
-rw-r--r--Source/cmake.cxx40
-rw-r--r--Source/cmake.h2
2 files changed, 4 insertions, 38 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index e61308d..340ee32 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -809,9 +809,7 @@ int cmake::Configure()
int cmake::Run(const std::vector<std::string>& args)
{
// a quick check for args
- if(args.size() == 1 &&
- !cmSystemTools::FileExists("CMakeLists.txt") &&
- !cmSystemTools::FileExists("CMakeCache.txt"))
+ if(args.size() == 1 && !cmSystemTools::FileExists("CMakeLists.txt"))
{
this->Usage(args[0].c_str());
return -1;
@@ -838,7 +836,7 @@ int cmake::Run(const std::vector<std::string>& args)
m_CMakeCommand = args[0];
// load the cache
- this->LoadCache(true);
+ this->LoadCache();
// Add any cache args
this->SetCacheArgs(args);
@@ -950,7 +948,7 @@ void cmake::AddDefaultCommands()
}
}
-int cmake::LoadCache(bool fix_paths)
+int cmake::LoadCache()
{
m_CacheManager->LoadCache(this->GetHomeOutputDirectory());
@@ -965,38 +963,6 @@ int cmake::LoadCache(bool fix_paths)
{
return -3;
}
-
- if ( fix_paths && cmSystemTools::FileExists("CMakeCache.txt") )
- {
- // If we are in directory that has CMakeCache inside and we are
- // fixing paths then we might have to modify home directory and
- // start directory.
- const char* home = this->GetHomeDirectory();
- const char* startdirectory = this->GetStartDirectory();
- const char* cachehome = this->GetCacheDefinition("CMAKE_HOME_DIRECTORY");
- if ( cachehome && strcmp(home, cachehome) != 0 )
- {
- // If cachehome exists (it was in the cache), and the current
- // home is not the same as the one from cache (which means we
- // are not doing in source build), then fix home and start
- // directory.
- home = cachehome;
- startdirectory = cachehome;
- }
- // If cachehome is not set and cmakelists.txt does not exists,
- // that means we are doing out of source build and the
- // cmakecache.txt was edited manually and we cannot find the right
- // source directory.
- if ( !cachehome && !cmSystemTools::FileExists("CMakeLists.txt") )
- {
- cmSystemTools::Error("Source directory not specified");
- return -4;
- }
- // Ok, let's set the home and start directory.
- this->SetHomeDirectory(home);
- this->SetStartDirectory(startdirectory);
- }
-
return 0;
}
diff --git a/Source/cmake.h b/Source/cmake.h
index 2f30e4f..749e448 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -146,7 +146,7 @@ class cmake
* GlobalGenerator. This in turn will read in an process all the CMakeList
* files for the tree. It will not produce any actual Makefiles, or
* workspaces. Generate does that. */
- int LoadCache(bool fix_paths = false);
+ int LoadCache();
///! Create a GlobalGenerator
cmGlobalGenerator* CreateGlobalGenerator(const char* name);