summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2005-07-29 13:19:25 (GMT)
committerKen Martin <ken.martin@kitware.com>2005-07-29 13:19:25 (GMT)
commitc6b011e35e63cbb695b7c939c00afba21fc94825 (patch)
tree3207012e89fc196416343da482e7e3cdcba5a63a /Source
parentad46c80f7a65333600610bbbef49d2644c9f7a48 (diff)
downloadCMake-c6b011e35e63cbb695b7c939c00afba21fc94825.zip
CMake-c6b011e35e63cbb695b7c939c00afba21fc94825.tar.gz
CMake-c6b011e35e63cbb695b7c939c00afba21fc94825.tar.bz2
ENH: put cmake files intoa CMakeFiles subdir to clean up bin tree
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCacheManager.cxx2
-rw-r--r--Source/cmGlobalGenerator.cxx21
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx24
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx2
-rw-r--r--Source/cmLocalGenerator.cxx5
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx16
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx2
7 files changed, 46 insertions, 26 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 1429ef3..cbd3697 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -557,6 +557,8 @@ bool cmCacheManager::SaveCache(const char* path)
cacheFile.c_str());
cmSystemTools::RemoveFile(tempFile.c_str());
std::string checkCacheFile = path;
+ checkCacheFile += "/CMakeFiles";
+ cmSystemTools::MakeDirectory(checkCacheFile.c_str());
checkCacheFile += "/cmake.check_cache";
std::ofstream checkCache(checkCacheFile.c_str());
if(!checkCache)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 0b2bc1a..545309b 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -100,8 +100,9 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
}
// enable the given language
-void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
- cmMakefile *mf)
+void
+cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
+ cmMakefile *mf)
{
if(languages.size() == 0)
{
@@ -113,6 +114,8 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
mf->AddDefinition("RUN_CONFIGURE", true);
bool needTestLanguage = false;
std::string rootBin = mf->GetHomeOutputDirectory();
+ rootBin += "/CMakeFiles";
+
// If the configuration files path has been set,
// then we are in a try compile and need to copy the enable language
// files into the try compile directory
@@ -251,10 +254,12 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
std::string determineCompiler = "CMakeDetermine";
determineCompiler += lang;
determineCompiler += "Compiler.cmake";
- std::string determineFile = mf->GetModulesFile(determineCompiler.c_str());
+ std::string determineFile =
+ mf->GetModulesFile(determineCompiler.c_str());
if(!mf->ReadListFile(0,determineFile.c_str()))
{
- cmSystemTools::Error("Could not find cmake module file:", determineFile.c_str());
+ cmSystemTools::Error("Could not find cmake module file:",
+ determineFile.c_str());
}
// Some generators like visual studio should not use the env variables
// So the global generator can specify that in this variable
@@ -344,7 +349,8 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
std::string ifpath = mf->GetModulesFile(testLang.c_str());
if(!mf->ReadListFile(0,ifpath.c_str()))
{
- cmSystemTools::Error("Could not find cmake module file:", ifpath.c_str());
+ cmSystemTools::Error("Could not find cmake module file:",
+ ifpath.c_str());
}
// **** Step 8, load backwards compatibility stuff for C and CXX
// for old versions of CMake ListFiles C and CXX had some
@@ -785,8 +791,9 @@ cmLocalGenerator *cmGlobalGenerator::CreateLocalGenerator()
void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen )
{
- this->SetConfiguredFilesPath(
- gen->GetCMakeInstance()->GetHomeOutputDirectory());
+ std::string cfp = gen->GetCMakeInstance()->GetHomeOutputDirectory();
+ cfp += "/CMakeFiles";
+ this->SetConfiguredFilesPath(cfp.c_str());
const char* make =
gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make,
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index d1542c4..6684be1 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -171,7 +171,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
// see if the build system must be regenerated.
std::string makefileName =
this->GetCMakeInstance()->GetHomeOutputDirectory();
- makefileName += "/Makefile2";
+ makefileName += "/CMakeFiles/Makefile2";
cmGeneratedFileStream makefileStream(makefileName.c_str());
if(!makefileStream)
{
@@ -240,7 +240,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
// see if the build system must be regenerated.
std::string cmakefileName =
this->GetCMakeInstance()->GetHomeOutputDirectory();
- cmakefileName += "/Makefile.cmake";
+ cmakefileName += "/CMakeFiles/Makefile.cmake";
cmGeneratedFileStream cmakefileStream(cmakefileName.c_str());
if(!cmakefileStream)
{
@@ -305,7 +305,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
// Build the path to the cache check file.
std::string check = this->GetCMakeInstance()->GetHomeOutputDirectory();
- check += "/cmake.check_cache";
+ check += "/CMakeFiles/cmake.check_cache";
// Set the corresponding makefile in the cmake file.
cmakefileStream
@@ -322,7 +322,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
{
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
tmpStr = lg->GetMakefile()->GetStartOutputDirectory();
- tmpStr += "/CMakeDirectoryInformation.cmake";
+ tmpStr += "/CMakeFiles/CMakeDirectoryInformation.cmake";
cmakefileStream << " \"" <<
lg->Convert(tmpStr.c_str(),cmLocalGenerator::HOME_OUTPUT).c_str() << "\"\n";
}
@@ -374,7 +374,7 @@ void cmGlobalUnixMakefileGenerator3
// Check the build system in this directory.
depends.push_back("cmake_check_build_system");
- commands.push_back(lg->GetRecursiveMakeCall("Makefile2","all"));
+ commands.push_back(lg->GetRecursiveMakeCall("CMakeFiles/Makefile2","all"));
// Write the rule.
lg->WriteMakeRule(makefileStream, "The main all target", "all", depends, commands);
@@ -382,14 +382,14 @@ void cmGlobalUnixMakefileGenerator3
// write the clean
depends.clear();
commands.clear();
- commands.push_back(lg->GetRecursiveMakeCall("Makefile2","clean"));
+ commands.push_back(lg->GetRecursiveMakeCall("CMakeFiles/Makefile2","clean"));
lg->WriteMakeRule(makefileStream, "The main clean target", "clean",
depends, commands);
// write the depend rule, really a recompute depends rule
depends.clear();
commands.clear();
- std::string cmakefileName = "Makefile.cmake";
+ std::string cmakefileName = "CMakeFiles/Makefile.cmake";
std::string runRule =
"$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
runRule += " --check-build-system ";
@@ -472,7 +472,8 @@ cmGlobalUnixMakefileGenerator3
// write the directory rule
commands.clear();
commands.push_back
- (lg->GetRecursiveMakeCall("Makefile2",makeTargetName.c_str()));
+ (lg->GetRecursiveMakeCall("CMakeFiles/Makefile2",
+ makeTargetName.c_str()));
// Write the rule.
lg->WriteMakeRule(ruleFileStream, "Convenience name for directory.",
@@ -602,7 +603,8 @@ cmGlobalUnixMakefileGenerator3
// write the directory rule
commands.clear();
commands.push_back
- (lg->GetRecursiveMakeCall("Makefile2",makeTargetName.c_str()));
+ (lg->GetRecursiveMakeCall("CMakeFiles/Makefile2",
+ makeTargetName.c_str()));
// Write the rule.
lg->WriteMakeRule(ruleFileStream, "Convenience name for directory.",
@@ -703,7 +705,7 @@ cmGlobalUnixMakefileGenerator3
// Write the rule.
commands.clear();
- commands.push_back(lg->GetRecursiveMakeCall("Makefile2",
+ commands.push_back(lg->GetRecursiveMakeCall("CMakeFiles/Makefile2",
t->second.GetName()));
depends.clear();
depends.push_back("cmake_check_build_system");
@@ -798,7 +800,7 @@ cmGlobalUnixMakefileGenerator3
// Write the rule.
commands.clear();
- commands.push_back(lg->GetRecursiveMakeCall("Makefile2",
+ commands.push_back(lg->GetRecursiveMakeCall("CMakeFiles/Makefile2",
localName.c_str()));
depends.clear();
depends.push_back("cmake_check_build_system");
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index cc39638..066c3e2 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -367,7 +367,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(cmLocalGenerator* root)
m_CurrentReRunCMakeMakefile += "/ReRunCMake.make";
cmGeneratedFileStream makefileStream(m_CurrentReRunCMakeMakefile.c_str());
makefileStream << "# Generated by CMake, DO NOT EDIT\n";
- makefileStream << "cmake.check_cache: ";
+ makefileStream << "CMakeFiles/cmake.check_cache: ";
for(std::vector<std::string>::const_iterator i = lfiles.begin();
i != lfiles.end(); ++i)
{
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4f620a9..d927b3b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -43,6 +43,11 @@ cmLocalGenerator::~cmLocalGenerator()
void cmLocalGenerator::Configure()
{
+ // make sure the CMakeFiles dir is there
+ std::string filesDir = m_Makefile->GetStartOutputDirectory();
+ filesDir += "/CMakeFiles";
+ cmSystemTools::MakeDirectory(filesDir.c_str());
+
// find & read the list file
std::string currentStart = m_Makefile->GetStartDirectory();
currentStart += "/CMakeLists.txt";
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 0918ff9..b1cd324 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -172,7 +172,7 @@ void cmLocalUnixMakefileGenerator3
void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
{
std::string infoFileName = m_Makefile->GetStartOutputDirectory();
- infoFileName += "/CMakeDirectoryInformation.cmake";
+ infoFileName += "/CMakeFiles/CMakeDirectoryInformation.cmake";
// Open the output file.
cmGeneratedFileStream infoFileStream(infoFileName.c_str());
@@ -1048,7 +1048,7 @@ cmLocalUnixMakefileGenerator3
// the --check-build-system flag.
{
// Build command to run CMake to check if anything needs regenerating.
- std::string cmakefileName = "Makefile.cmake";
+ std::string cmakefileName = "CMakeFiles/Makefile.cmake";
std::string runRule =
"$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
runRule += " --check-build-system ";
@@ -1866,6 +1866,10 @@ cmLocalUnixMakefileGenerator3::GetTargetDirectory(cmTarget& target)
{
dir += prefix;
}
+ else
+ {
+ dir = "CMakeFiles/";
+ }
dir += target.GetName();
dir += ".dir";
return dir;
@@ -2579,7 +2583,7 @@ cmLocalUnixMakefileGenerator3
bool haveDirectoryInfo = false;
std::string dirInfoFile = args[4];
- dirInfoFile += "/CMakeDirectoryInformation.cmake";
+ dirInfoFile += "/CMakeFiles/CMakeDirectoryInformation.cmake";
if(mf->ReadListFile(0, dirInfoFile.c_str()) &&
!cmSystemTools::GetErrorOccuredFlag())
{
@@ -2754,7 +2758,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
std::string dir = m_Makefile->GetStartOutputDirectory();
dir += "/directorystart";
dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE);
- this->CreateJumpCommand(commands,"Makefile2",dir);
+ this->CreateJumpCommand(commands,"CMakeFiles/Makefile2",dir);
this->WriteMakeRule(ruleFileStream, "The main all target", "all", depends, commands);
// Write the clean rule.
@@ -2762,7 +2766,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
dir += "/clean";
dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE);
commands.clear();
- this->CreateJumpCommand(commands,"Makefile2",dir);
+ this->CreateJumpCommand(commands,"CMakeFiles/Makefile2",dir);
this->WriteMakeRule(ruleFileStream, "The main clean target", "clean", depends, commands);
// write our targets, and while doing it collect up the object
@@ -2819,7 +2823,7 @@ void cmLocalUnixMakefileGenerator3
commands.clear();
depends.clear();
- this->CreateJumpCommand(commands,"Makefile2",localName);
+ this->CreateJumpCommand(commands,"CMakeFiles/Makefile2",localName);
this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
localName.c_str(), depends, commands);
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 2b125df..27cd856 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1432,7 +1432,7 @@ std::string cmLocalVisualStudio7Generator::GetTargetDirectory(cmTarget& target)
// Put a prefix on the name if one is given by the CMake code.
if(const char* prefix = m_Makefile->GetDefinition("CMAKE_TARGET_DIR_PREFIX"))
{
- dir += prefix;
+ dir = prefix;
}
dir += target.GetName();
dir += ".dir";