diff options
author | Ken Martin <ken.martin@kitware.com> | 2006-06-14 16:28:32 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2006-06-14 16:28:32 (GMT) |
commit | 8e9a6becccc739e8135d5a3b303e8bf125fe3015 (patch) | |
tree | 4d7cbd51dd9ce0b7ecb79bcde0b4439c912383e7 /Source | |
parent | 108839ffda95fc54296d05dec176ff3a6ed6f02c (diff) | |
download | CMake-8e9a6becccc739e8135d5a3b303e8bf125fe3015.zip CMake-8e9a6becccc739e8135d5a3b303e8bf125fe3015.tar.gz CMake-8e9a6becccc739e8135d5a3b303e8bf125fe3015.tar.bz2 |
ENH: centralized locaiton of CMakeFiles setting
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCacheManager.cxx | 8 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalKdevelopGenerator.cxx | 10 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 24 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 36 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 3 | ||||
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmTryCompileCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmTryRunCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmake.h | 4 | ||||
-rw-r--r-- | Source/kwsys/kwsysPlatformCxxTests.cmake | 6 |
16 files changed, 83 insertions, 42 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index a0a231f..5eecb1d 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -19,6 +19,7 @@ #include "cmSystemTools.h" #include "cmCacheManager.h" #include "cmMakefile.h" +#include "cmake.h" #include <cmsys/Directory.hxx> #include <cmsys/Glob.hxx> @@ -163,7 +164,8 @@ bool cmCacheManager::ParseEntry(const char* entry, void cmCacheManager::CleanCMakeFiles(const char* path) { std::string glob = path; - glob += "/CMakeFiles/*.cmake"; + glob += cmake::GetCMakeFilesDirectory(); + glob += "/*.cmake"; cmsys::Glob globIt; globIt.FindFiles(glob); std::vector<std::string> files = globIt.GetFiles(); @@ -601,7 +603,7 @@ bool cmCacheManager::SaveCache(const char* path) cacheFile.c_str()); cmSystemTools::RemoveFile(tempFile.c_str()); std::string checkCacheFile = path; - checkCacheFile += "/CMakeFiles"; + checkCacheFile += cmake::GetCMakeFilesDirectory(); cmSystemTools::MakeDirectory(checkCacheFile.c_str()); checkCacheFile += "/cmake.check_cache"; std::ofstream checkCache(checkCacheFile.c_str()); @@ -626,7 +628,7 @@ bool cmCacheManager::DeleteCache(const char* path) // now remove the files in the CMakeFiles directory // this cleans up language cache files cmsys::Directory dir; - cmakeFiles += "/CMakeFiles"; + cmakeFiles += cmake::GetCMakeFilesDirectory(); dir.Load(cmakeFiles.c_str()); for (unsigned long fileNum = 0; fileNum < dir.GetNumberOfFiles(); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index c04ad73..0feb91e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -175,7 +175,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, } mf->AddDefinition("RUN_CONFIGURE", true); std::string rootBin = mf->GetHomeOutputDirectory(); - rootBin += "/CMakeFiles"; + rootBin += cmake::GetCMakeFilesDirectory(); // If the configuration files path has been set, // then we are in a try compile and need to copy the enable language @@ -930,7 +930,7 @@ cmLocalGenerator *cmGlobalGenerator::CreateLocalGenerator() void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen ) { std::string cfp = gen->GetCMakeInstance()->GetHomeOutputDirectory(); - cfp += "/CMakeFiles"; + cfp += cmake::GetCMakeFilesDirectory(); this->SetConfiguredFilesPath(cfp.c_str()); const char* make = gen->GetCMakeInstance()->GetCacheDefinition("CMAKE_MAKE_PROGRAM"); diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index 9b60ea5..fa58fb6 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -134,7 +134,9 @@ bool cmGlobalKdevelopGenerator tmp=*lt; cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); // make sure the file is part of this source tree - if ((tmp[0]!='/') && (strstr(tmp.c_str(), "CMakeFiles/")==0)) + if ((tmp[0]!='/') && + (strstr(tmp.c_str(), + cmake::GetCMakeFilesDirectoryPostSlash())==0)) { files.insert(tmp); tmp=cmSystemTools::GetFilenameName(tmp); @@ -159,7 +161,8 @@ bool cmGlobalKdevelopGenerator { tmp=(*si)->GetFullPath(); cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); - if ((tmp[0]!='/') && (strstr(tmp.c_str(), "CMakeFiles/")==0)) + if ((tmp[0]!='/') && + (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash())==0)) { files.insert(tmp); } @@ -169,7 +172,8 @@ bool cmGlobalKdevelopGenerator { tmp=*lt; cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); - if ((tmp[0]!='/') && (strstr(tmp.c_str(), "CMakeFiles/")==0)) + if ((tmp[0]!='/') && + (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash())==0)) { files.insert(tmp.c_str()); } diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index da3f6a3..387e7e0 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -206,7 +206,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2() // see if the build system must be regenerated. std::string makefileName = this->GetCMakeInstance()->GetHomeOutputDirectory(); - makefileName += "/CMakeFiles/Makefile2"; + makefileName += cmake::GetCMakeFilesDirectory(); + makefileName += "/Makefile2"; cmGeneratedFileStream makefileStream(makefileName.c_str()); if(!makefileStream) { @@ -293,7 +294,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() // see if the build system must be regenerated. std::string cmakefileName = this->GetCMakeInstance()->GetHomeOutputDirectory(); - cmakefileName += "/CMakeFiles/Makefile.cmake"; + cmakefileName += cmake::GetCMakeFilesDirectory(); + cmakefileName += "/Makefile.cmake"; cmGeneratedFileStream cmakefileStream(cmakefileName.c_str()); if(!cmakefileStream) { @@ -360,7 +362,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() // Build the path to the cache check file. std::string check = this->GetCMakeInstance()->GetHomeOutputDirectory(); - check += "/CMakeFiles/cmake.check_cache"; + check += cmake::GetCMakeFilesDirectory(); + check += "/cmake.check_cache"; // Set the corresponding makefile in the cmake file. cmakefileStream @@ -380,7 +383,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() lg = static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]); tmpStr = lg->GetMakefile()->GetStartOutputDirectory(); - tmpStr += "/CMakeFiles/CMakeDirectoryInformation.cmake"; + tmpStr += cmake::GetCMakeFilesDirectory(); + tmpStr += "/CMakeDirectoryInformation.cmake"; cmakefileStream << " \"" << lg->Convert(tmpStr.c_str(),cmLocalGenerator::HOME_OUTPUT).c_str() << "\"\n"; @@ -707,7 +711,7 @@ cmGlobalUnixMakefileGenerator3 commands.clear(); std::string progressDir = lg->GetMakefile()->GetHomeOutputDirectory(); - progressDir += "/CMakeFiles"; + progressDir += cmake::GetCMakeFilesDirectory(); { // TODO: Convert the total progress count to a make variable. @@ -734,8 +738,10 @@ cmGlobalUnixMakefileGenerator3 } commands.push_back(progCmd.str()); } + std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash(); + tmp += "Makefile2"; commands.push_back(lg->GetRecursiveMakeCall - ("CMakeFiles/Makefile2",t->second.GetName())); + (tmp.c_str(),t->second.GetName())); { cmOStringStream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 @@ -846,7 +852,7 @@ cmGlobalUnixMakefileGenerator3 std::string progressDir = lg->GetMakefile()->GetHomeOutputDirectory(); - progressDir += "/CMakeFiles"; + progressDir += cmake::GetCMakeFilesDirectory(); cmOStringStream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; // all target counts @@ -881,8 +887,10 @@ cmGlobalUnixMakefileGenerator3 // Write the rule. commands.clear(); + std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash(); + tmp += "Makefile2"; commands.push_back(lg->GetRecursiveMakeCall - ("CMakeFiles/Makefile2",localName.c_str())); + (tmp.c_str(),localName.c_str())); depends.clear(); depends.push_back("cmake_check_build_system"); localName = lg->GetRelativeTargetDirectory(t->second); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index f398a7f..5a1a2d5 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -366,7 +366,8 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(cmLocalGenerator* root) (this->CurrentReRunCMakeMakefile.c_str()); makefileStream.SetCopyIfDifferent(true); makefileStream << "# Generated by CMake, DO NOT EDIT\n"; - makefileStream << "CMakeFiles/cmake.check_cache: "; + makefileStream << cmake::GetCMakeFilesDirectoryPostSlash(); + makefileStream << "cmake.check_cache: "; for(std::vector<std::string>::const_iterator i = lfiles.begin(); i != lfiles.end(); ++i) { diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index e58fd9d..7ad7825 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -20,6 +20,7 @@ #include "cmLocalGenerator.h" #include "cmMakefile.h" #include "cmTarget.h" +#include "cmake.h" //---------------------------------------------------------------------------- cmInstallTargetGenerator @@ -48,7 +49,8 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os) if(this->Target->NeedRelinkBeforeInstall()) { fromDir = this->Target->GetMakefile()->GetStartOutputDirectory(); - fromDir += "/CMakeFiles/CMakeRelink.dir/"; + fromDir += cmake::GetCMakeFilesDirectory(); + fromDir += "/CMakeRelink.dir/"; } else { diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index cbe6532..52f48ac 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -52,7 +52,7 @@ void cmLocalGenerator::Configure() { // make sure the CMakeFiles dir is there std::string filesDir = this->Makefile->GetStartOutputDirectory(); - filesDir += "/CMakeFiles"; + filesDir += cmake::GetCMakeFilesDirectory(); cmSystemTools::MakeDirectory(filesDir.c_str()); // find & read the list file diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index b9ae7dd..03e55a3 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -280,8 +280,10 @@ void cmLocalUnixMakefileGenerator3 depends.clear(); // Build the target for this pass. + std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash(); + tmp += "Makefile2"; commands.push_back(this->GetRecursiveMakeCall - ("CMakeFiles/Makefile2",localName.c_str())); + (tmp.c_str(),localName.c_str())); this->CreateCDCommand(commands, this->Makefile->GetHomeOutputDirectory(), this->Makefile->GetStartOutputDirectory()); @@ -322,7 +324,8 @@ void cmLocalUnixMakefileGenerator3 void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile() { std::string infoFileName = this->Makefile->GetStartOutputDirectory(); - infoFileName += "/CMakeFiles/CMakeDirectoryInformation.cmake"; + infoFileName += cmake::GetCMakeFilesDirectory(); + infoFileName += "/CMakeDirectoryInformation.cmake"; // Open the output file. cmGeneratedFileStream infoFileStream(infoFileName.c_str()); @@ -653,7 +656,8 @@ void cmLocalUnixMakefileGenerator3 // the --check-build-system flag. { // Build command to run CMake to check if anything needs regenerating. - std::string cmakefileName = "CMakeFiles/Makefile.cmake"; + std::string cmakefileName = cmake::GetCMakeFilesDirectoryPostSlash(); + cmakefileName += "Makefile.cmake"; std::string runRule = "$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"; runRule += " --check-build-system "; @@ -1158,7 +1162,8 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(const char* tgtInfo) cmMakefile* mf = this->Makefile; bool haveDirectoryInfo = false; std::string dirInfoFile = this->Makefile->GetStartOutputDirectory(); - dirInfoFile += "/CMakeFiles/CMakeDirectoryInformation.cmake"; + dirInfoFile += cmake::GetCMakeFilesDirectory(); + dirInfoFile += "/CMakeDirectoryInformation.cmake"; if(mf->ReadListFile(0, dirInfoFile.c_str()) && !cmSystemTools::GetErrorOccuredFlag()) { @@ -1437,7 +1442,7 @@ void cmLocalUnixMakefileGenerator3 if (!this->Parent) { std::string progressDir = this->Makefile->GetHomeOutputDirectory(); - progressDir += "/CMakeFiles"; + progressDir += cmake::GetCMakeFilesDirectory(); cmOStringStream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # src files progCmd << this->Convert(progressDir.c_str(), @@ -1454,15 +1459,16 @@ void cmLocalUnixMakefileGenerator3 commands.push_back(progCmd.str()); } - commands.push_back - (this->GetRecursiveMakeCall("CMakeFiles/Makefile2",dir.c_str())); + std::string mf2Dir = cmake::GetCMakeFilesDirectoryPostSlash(); + mf2Dir += "Makefile2"; + commands.push_back(this->GetRecursiveMakeCall(mf2Dir.c_str(),dir.c_str())); this->CreateCDCommand(commands, - this->Makefile->GetHomeOutputDirectory(), - this->Makefile->GetStartOutputDirectory()); + this->Makefile->GetHomeOutputDirectory(), + this->Makefile->GetStartOutputDirectory()); if (!this->Parent) { std::string progressDir = this->Makefile->GetHomeOutputDirectory(); - progressDir += "/CMakeFiles"; + progressDir += cmake::GetCMakeFilesDirectory(); cmOStringStream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 progCmd << this->Convert(progressDir.c_str(), @@ -1480,8 +1486,7 @@ void cmLocalUnixMakefileGenerator3 dir = this->Convert(dir.c_str(),HOME_OUTPUT,MAKEFILE); commands.clear(); depends.clear(); - commands.push_back - (this->GetRecursiveMakeCall("CMakeFiles/Makefile2",dir.c_str())); + commands.push_back(this->GetRecursiveMakeCall(mf2Dir.c_str(),dir.c_str())); this->CreateCDCommand(commands, this->Makefile->GetHomeOutputDirectory(), this->Makefile->GetStartOutputDirectory()); @@ -1512,7 +1517,7 @@ void cmLocalUnixMakefileGenerator3 depends.push_back("cmake_check_build_system"); } commands.push_back - (this->GetRecursiveMakeCall("CMakeFiles/Makefile2", dir.c_str())); + (this->GetRecursiveMakeCall(mf2Dir.c_str(), dir.c_str())); this->CreateCDCommand(commands, this->Makefile->GetHomeOutputDirectory(), this->Makefile->GetStartOutputDirectory()); @@ -1525,7 +1530,8 @@ void cmLocalUnixMakefileGenerator3 // write the depend rule, really a recompute depends rule depends.clear(); commands.clear(); - std::string cmakefileName = "CMakeFiles/Makefile.cmake"; + std::string cmakefileName = cmake::GetCMakeFilesDirectoryPostSlash(); + cmakefileName += "Makefile.cmake"; this->Convert(cmakefileName.c_str(),HOME_OUTPUT, cmLocalGenerator::MAKEFILE); std::string runRule = @@ -1873,7 +1879,7 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p) std::string cmLocalUnixMakefileGenerator3::GetTargetDirectory(cmTarget& target) { - std::string dir = "CMakeFiles/"; + std::string dir = cmake::GetCMakeFilesDirectoryPostSlash(); dir += target.GetName(); dir += ".dir"; return dir; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 0ce05a8..fe0c39b 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1868,6 +1868,9 @@ void cmMakefile::AddDefaultDefinitions() this->AddDefinition("CMAKE_MINOR_VERSION", temp); sprintf(temp, "%d", cmMakefile::GetMajorVersion()); this->AddDefinition("CMAKE_MAJOR_VERSION", temp); + + this->AddDefinition("CMAKE_FILES_DIRECTORY", + cmake::GetCMakeFilesDirectory()); } #if defined(CMAKE_BUILD_WITH_CMAKE) diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 7b30dd2..f00105b 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -22,6 +22,7 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmTarget.h" +#include "cmake.h" //---------------------------------------------------------------------------- void cmMakefileExecutableTargetGenerator::WriteRuleFiles() @@ -168,7 +169,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) if(relink) { outpath = this->Makefile->GetStartOutputDirectory(); - outpath += "/CMakeFiles/CMakeRelink.dir"; + outpath += cmake::GetCMakeFilesDirectory(); + outpath += "/CMakeRelink.dir"; cmSystemTools::MakeDirectory(outpath.c_str()); outpath += "/"; } diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index c3df2a5..a292605 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -22,6 +22,7 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmTarget.h" +#include "cmake.h" //---------------------------------------------------------------------------- void cmMakefileLibraryTargetGenerator::WriteRuleFiles() @@ -244,7 +245,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules if(relink) { outpath = this->Makefile->GetStartOutputDirectory(); - outpath += "/CMakeFiles/CMakeRelink.dir"; + outpath += cmake::GetCMakeFilesDirectory(); + outpath += "/CMakeRelink.dir"; cmSystemTools::MakeDirectory(outpath.c_str()); outpath += "/"; } @@ -428,7 +430,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules vars.TargetPDB = targetOutPathPDB.c_str(); vars.Language = linkLanguage; vars.Objects = buildObjs.c_str(); - std::string objdir = "CMakeFiles/"; + std::string objdir = cmake::GetCMakeFilesDirectoryPostSlash(); objdir += this->Target->GetName(); objdir += ".dir"; vars.ObjectDir = objdir.c_str(); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index a030679..8973627 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -23,6 +23,7 @@ #include "cmMakefile.h" #include "cmSourceFile.h" #include "cmTarget.h" +#include "cmake.h" #include "cmMakefileExecutableTargetGenerator.h" #include "cmMakefileLibraryTargetGenerator.h" @@ -404,7 +405,7 @@ cmMakefileTargetGenerator int prog = gg->ShouldAddProgressRule(); std::string progressDir = this->Makefile->GetHomeOutputDirectory(); - progressDir += "/CMakeFiles"; + progressDir += cmake::GetCMakeFilesDirectory(); cmOStringStream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; progCmd << this->LocalGenerator->Convert(progressDir.c_str(), diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index c7405ca..f3fe893 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -110,7 +110,9 @@ int cmTryCompileCommand::CoreTryCompileCode( // signature if (srcFileSignature) { - tmpString = argv[1] + "/CMakeFiles/CMakeTmp"; + tmpString = argv[1]; + tmpString += cmake::GetCMakeFilesDirectory(); + tmpString += "/CMakeTmp"; binaryDirectory = tmpString.c_str(); } // make sure the binary directory exists diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index ba7b481..f8f2e86 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -68,7 +68,9 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv) tryCompile, false); // now try running the command if it compiled - std::string binaryDirectory = argv[2] + "/CMakeFiles/CMakeTmp"; + std::string binaryDirectory = argv[2]; + binaryDirectory += cmake::GetCMakeFilesDirectory(); + binaryDirectory += "/CMakeTmp"; if (!res) { int retVal = -1; diff --git a/Source/cmake.h b/Source/cmake.h index b2cea7b..516d981 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -67,6 +67,10 @@ class cmake static unsigned int GetMinorVersion(); static const char *GetReleaseVersion(); + ///! construct an instance of cmake + static const char *GetCMakeFilesDirectory() {return "/CMakeFiles";}; + static const char *GetCMakeFilesDirectoryPostSlash() {return "CMakeFiles/";}; + //@{ /** * Set/Get the home directory (or output directory) in the project. The diff --git a/Source/kwsys/kwsysPlatformCxxTests.cmake b/Source/kwsys/kwsysPlatformCxxTests.cmake index 6da82d6..7775457 100644 --- a/Source/kwsys/kwsysPlatformCxxTests.cmake +++ b/Source/kwsys/kwsysPlatformCxxTests.cmake @@ -7,10 +7,12 @@ MACRO(KWSYS_PLATFORM_CXX_TEST var description invert) COMPILE_DEFINITIONS -DTEST_${var} ${KWSYS_PLATFORM_CXX_TEST_DEFINES} OUTPUT_VARIABLE OUTPUT) IF(${var}_COMPILED) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeOutput.log + FILE(APPEND + ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "${description} compiled with the following output:\n${OUTPUT}\n\n") ELSE(${var}_COMPILED) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeError.log + FILE(APPEND + ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${description} failed to compile with the following output:\n${OUTPUT}\n\n") ENDIF(${var}_COMPILED) IF(${invert} MATCHES INVERT) |