summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-28 19:00:02 (GMT)
committerBrad King <brad.king@kitware.com>2015-01-29 14:11:11 (GMT)
commitab9fa54d4841e5b0eff8d241ad8edb47401b0394 (patch)
tree4675b0ba7baef215961e07d4cd03d68d4fbcd158 /Source
parent11e2e6cadf7f0ee36b7ccecaa11457949382b75f (diff)
downloadCMake-ab9fa54d4841e5b0eff8d241ad8edb47401b0394.zip
CMake-ab9fa54d4841e5b0eff8d241ad8edb47401b0394.tar.gz
CMake-ab9fa54d4841e5b0eff8d241ad8edb47401b0394.tar.bz2
Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator (#15324)
The "cmakexbuild" wrapper is not needed for Xcode 4 and above, and the path to it may change when CMake moves. Avoid storing a specific path to a build program in CMakeCache.txt and instead compute the value for CMAKE_MAKE_PROGRAM on demand. However, if a user does set the value explicitly then honor it. This does for Xcode what commit v3.0.0-rc1~260^2~4 (VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators, 2013-11-15) did for Visual Studio generators.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx19
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx14
-rw-r--r--Source/cmGlobalXCodeGenerator.h2
3 files changed, 15 insertions, 20 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 4c95a9f..6d0fedc 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -315,25 +315,6 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
"make program",
cmCacheManager::FILEPATH);
}
-
- if(makeProgram.find("xcodebuild") != makeProgram.npos)
- {
- // due to the text file busy /bin/sh problem with xcodebuild
- // use the cmakexbuild wrapper instead. This program
- // will run xcodebuild and if it sees the error text file busy
- // it will stop forwarding output, and let the build finish.
- // Then it will retry the build. It will continue this
- // until no text file busy errors occur.
- std::string cmakexbuild =
- this->CMakeInstance->GetCacheManager()->GetCacheValue("CMAKE_COMMAND");
- cmakexbuild = cmakexbuild.substr(0, cmakexbuild.length()-5);
- cmakexbuild += "cmakexbuild";
-
- mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM",
- cmakexbuild.c_str(),
- "make program",
- cmCacheManager::FILEPATH);
- }
}
// enable the given language
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index ebad7da..cd0dcc6 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -136,7 +136,6 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version)
sscanf(this->VersionString.c_str(), "%u.%u", &v[0], &v[1]);
this->XcodeVersion = 10*v[0] + v[1];
- this->FindMakeProgramFile = "CMakeFindXCode.cmake";
this->RootObject = 0;
this->MainGroupChildren = 0;
this->SourcesGroupChildren = 0;
@@ -203,6 +202,19 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory
}
//----------------------------------------------------------------------------
+void cmGlobalXCodeGenerator::FindMakeProgram(cmMakefile* mf)
+{
+ // The Xcode generator knows how to lookup its build tool
+ // directly instead of needing a helper module to do it, so we
+ // do not actually need to put CMAKE_MAKE_PROGRAM into the cache.
+ if(cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
+ {
+ mf->AddDefinition("CMAKE_MAKE_PROGRAM",
+ this->GetXcodeBuildCommand().c_str());
+ }
+}
+
+//----------------------------------------------------------------------------
std::string const& cmGlobalXCodeGenerator::GetXcodeBuildCommand()
{
if(!this->XcodeBuildCommandInitialized)
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index e54bb37..f513e28 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -70,6 +70,8 @@ public:
const std::string& suffix,
std::string& dir);
+ virtual void FindMakeProgram(cmMakefile*);
+
///! What is the configurations directory variable called?
virtual const char* GetCMakeCFGIntDir() const;
///! expand CFGIntDir