Commit e88bae77 authored by Brad King's avatar Brad King
Browse files

Xcode: Run xcode-select to find Xcode version file (#13463)

Multiple versions of Xcode may be installed in different locations.
Run "xcode-select --print-path" to detect the active Xcode location
and parse its Contents/version.plist file.  Note that the
directory name may vary in developer versions.
parent 2c061d5c
......@@ -136,8 +136,23 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::New()
cmXcodeVersionParser parser;
if (cmSystemTools::FileExists(
std::string versionFile;
std::string out;
std::string::size_type pos;
if(cmSystemTools::RunSingleCommand("xcode-select --print-path", &out, 0, 0,
cmSystemTools::OUTPUT_NONE) &&
(pos = out.find(".app/"), pos != out.npos))
versionFile = out.substr(0, pos+5)+"Contents/version.plist";
if(!versionFile.empty() && cmSystemTools::FileExists(versionFile.c_str()))
else if (cmSystemTools::FileExists(
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment