diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-04-30 10:41:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-05-06 13:23:27 (GMT) |
commit | 275b6b3194e09a77247dc863ad5259cee316d6dc (patch) | |
tree | 402c4b92166934eeba81f88a223ed2817a996c5d | |
parent | 7700df9b1ef66761cad08cfc08344d5b27660e9f (diff) | |
download | CMake-275b6b3194e09a77247dc863ad5259cee316d6dc.zip CMake-275b6b3194e09a77247dc863ad5259cee316d6dc.tar.gz CMake-275b6b3194e09a77247dc863ad5259cee316d6dc.tar.bz2 |
iOS: Fix try_compile FILE_COPY not to fail
When building for iOS, the compiled target is placed into a bundle.
If a single-configuration generator is used, like Makefiles or Ninja,
the try_compile FILE_COPY behavior fails to find the bundle, because
it only looks for the bundle inside a Debug subfolder (presumably
to support a multi-configuration generator like Xcode).
Consider looking for the bundle in the root try_compile folder, as
well as in the location specified by CMAKE_TRY_COMPILE_CONFIGURATION.
Closes: #19211
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 3892011..037d415 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -1040,7 +1040,14 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName, } searchDirs.emplace_back("/Debug"); #if defined(__APPLE__) - std::string app = "/Debug/" + targetName + ".app"; + std::string app = "/" + targetName + ".app"; + if (config && config[0]) { + std::string tmp = "/"; + tmp += config + app; + searchDirs.push_back(std::move(tmp)); + } + std::string tmp = "/Debug" + app; + searchDirs.emplace_back(std::move(tmp)); searchDirs.push_back(std::move(app)); #endif searchDirs.emplace_back("/Development"); |