summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2019-01-12 01:48:19 (GMT)
committerSean McBride <sean@rogue-research.com>2019-01-12 01:48:19 (GMT)
commit5ff7fb592e5b9c5a6a0f05055a2bde5623e8cc54 (patch)
tree688fa13ec49befb499cbc95ad78f85d701aebdee /Source/cmGlobalXCodeGenerator.cxx
parent5a283b79e5fe1739142cc513a9a701855849b2f8 (diff)
downloadCMake-5ff7fb592e5b9c5a6a0f05055a2bde5623e8cc54.zip
CMake-5ff7fb592e5b9c5a6a0f05055a2bde5623e8cc54.tar.gz
CMake-5ff7fb592e5b9c5a6a0f05055a2bde5623e8cc54.tar.bz2
Fixed all but one clang -Wcomma warning
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index d6ab769..068cf5e 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -176,12 +176,14 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(
std::string versionFile;
{
std::string out;
- std::string::size_type pos = 0;
- if (cmSystemTools::RunSingleCommand("xcode-select --print-path", &out,
- nullptr, nullptr, nullptr,
- cmSystemTools::OUTPUT_NONE) &&
- (pos = out.find(".app/"), pos != std::string::npos)) {
- versionFile = out.substr(0, pos + 5) + "Contents/version.plist";
+ bool commandResult = cmSystemTools::RunSingleCommand(
+ "xcode-select --print-path", &out, nullptr, nullptr, nullptr,
+ cmSystemTools::OUTPUT_NONE);
+ if (commandResult) {
+ std::string::size_type pos = out.find(".app/");
+ if (pos != std::string::npos) {
+ versionFile = out.substr(0, pos + 5) + "Contents/version.plist";
+ }
}
}
if (!versionFile.empty() && cmSystemTools::FileExists(versionFile.c_str())) {