iOS: xcode: can not find static library
The problem that I faced is exactly as described here: https://stackoverflow.com/questions/30318941/cmake-generated-xcode-project-release-build-works-but-archive-fails-on-linker But I use more recent versions.
I have:
add_library(foo STATIC lib.cpp)
add_executable(prog1 main.cpp)
target_link_libraries(prog1 PRIVATE foo)
then I configure project:
cmake -DCMAKE_PREFIX_PATH=/Users/evgeniy/Qt/5.15.0/ios -DDEPLOYMENT_TARGET=11.0 -DCMAKE_TOOLCHAIN_FILE=../cmake/IosCMakeToolchain/ios.toolchain.cmake -DPLATFORM=OS64 -DENABLE_BITCODE=FALSE -G "Xcode" .. && open -a Xcode.app proj.xcodeproj
all works find in Debug build, but then I run XCode: Product->Archive I got error:
clang: error: no such file or directory: '/Users/evgeniy/projects/testproj/build_qt_gui_ios/Release-iphoneos/libfoo.a'
I use cmake version 3.17.1 and Xcode Version 11.5 (11E608c)
Edited by Brad King