I have an iOS app (made with Qt5) that I'm trying to port from qmake to cmake and I have boost (disjoint_sets.hpp) as dependency, but I could not find any precompiled binary for arm64 iOS, going through few (a lot of) forums, I concluded that I need to build boost myself for target platform.
I downloaded boost 1.80.0 source along with boost 1.79.0, and compiled to source using built-in config tool as follow
/bootstrap.sh && ./b2 toolset=clang-darwin -a cxxflags="-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/"
above command generated lib (libboost.a) file which when checked for architecture using lipo gave arm64.
lipo -info lib/libboost.a
Architectures in the fat file: lib/libboost.a are: arm64
then I added below lines to cmake:
include_directories(/opt/homebrew/include)
add_executable( ${TARGET_NAME} ...)
link_directories("/boost_framework/build/boost/1.80.0/ios/release/build/iphoneos")
target_link_libraries(${TARGET_NAME} ${Boost_LIBRARIES} ...)
For above cmake it should link to boost, but I get "boost not found" Am I doing any thing wrong here? I'm new to cmake and iOS development, am I missing something critical?
Note: I've already followed steps from some SO Posts and also tried to build boost as a framework using this ( https://github.com/faithfracture/Apple-Boost-BuildScript ) repository as suggested in one SO post, but that didn't work for me.
Build environment Details:
Qt version: 5.12.11
qmake version: 3.1
MacOs version: 12.6 (Monterey, M1 2020)
Xcode version: 14.0.1 (14A400)
xcodebuild version: 14.0.1 (14A400)
cmake version: 3.24.2
boost version: 1.80.0
REFERENCES: How to build Boost-Libraries for iPhone