diff options
author | Brad King <brad.king@kitware.com> | 2019-01-22 14:38:24 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-22 14:38:30 (GMT) |
commit | 4b017d579d00f1d4d032eda7e179f57bdd1da080 (patch) | |
tree | 4095545154c8cf2454319028c3763b480ac39e4a /Source/cmGlobalXCodeGenerator.cxx | |
parent | cb7fbf1dbbcc88fc7701250db5c3ccdf0ab7396e (diff) | |
parent | 5ff7fb592e5b9c5a6a0f05055a2bde5623e8cc54 (diff) | |
download | CMake-4b017d579d00f1d4d032eda7e179f57bdd1da080.zip CMake-4b017d579d00f1d4d032eda7e179f57bdd1da080.tar.gz CMake-4b017d579d00f1d4d032eda7e179f57bdd1da080.tar.bz2 |
Merge topic 'Wcomma'
5ff7fb592e Fixed all but one clang -Wcomma warning
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2828
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 20fa116..79d77e7 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -191,12 +191,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())) { |