CMake install target doesn't work out-of-the-box on iOS
When I do a Release build on iOS where I'm installing the target, then run cpack -C Release
, I get this error:
CMake Error at /Users/steve/Code/hello-ios/build_ios/cmake_install.cmake:39 (file):
file INSTALL cannot find
"/Users/steve/Code/hello-ios/build_ios/Release/hello.app": No such file or
directory.
The path to hello.app was actually build_ios/Release-iphoneos
. Looking at cmake_install.cmake line 39 it expected to find build_ios/Release${EFFECTIVE_PLATFORM_NAME}/hello.app
, but ${EFFECTIVE_PLATFORM_NAME} was apparently blank.
I can get the install to work with the command cpack -C Release-iphoneos
, but it took some digging and I'm not sure it's supposed to be this way. It would be more intuitive and consistent with other platforms if a target install 'just works'.
Here are specific code and steps to reproduce the issue:
- Clone https://gitlab.com/ssrobins/hello-ios
- In CMakeLists.txt, update XCODE_ATTRIBUTE_DEVELOPMENT_TEAM to match the identifier from your Apple Developer account.
- Run: ./build_ios.sh
Here's my environment:
- CMake 3.16.0-rc4
- Xcode 11.2.1 (11B500)
- macOS 10.14.4