Has anyone sucessfully used cmake for Xcode to generate ios? (with the CMake GUI tool)
I’ve tried to use the guide and added CMAKE_TOOLCHAIN_FILE=…/cmake/ios.toolchain.cmake
I’ve also tried to just directly add the path to the ios.toolchain.cmake in the engine folder. but it seems like it always creates a Mac project. Can anyone help me ?
Btw is it already possible to have both Mac and ios targets in a cmake generated project, as far as I’ve seen there it wasn’t possible in the V3 branch few months ago, but maybe this has changed over the time?
for the last question, I think you are right, because the cmake official have replied:
It’s not possible and likely never will be. CMake’s code model supports only one target platform per build tree. Things like find_library find only one result file.
I can generated iOS project success, after executing this cmd, we will see the log like
Toolchain using default iOS SDK: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk
...
-- using toolchain file: /Users/laptop/2d-x/cmake/ios.toolchain.cmake
...
-- CMAKE_BUILD_TYPE: Debug
-- It appears you are cross compiling for IOS with AppleClang
...
What’s the logs like when you generated iOS project on CMake GUI? @Sleicreider .
could you try to use cmd line to generated iOS project. if success by cmd line, but failed on CMake GUI, I will thought some wrong operation existed.
as for some developer want to custom the cmake script, he or she can refer to the cmake official docs, we use no
special feature different from the cmake official. so I think we didn’t need to write more docs about cmake for now. @slackmoehrle
Congratulations and thanks for sharing this with us, GEN_COCOS_PREBUILT / USE_COCOS_PREBUILT are the key to use prebuilt libraries, you have gotten them.
I’ve tried this again.
This time i managed get the toolchain running with the cmake gui, by adding the toolchain file in the configure step for cross compilation.
I still have some issues with the required code signing since it doesn’t seem to find my provisioning profile in the Library profile cache path and I somehow can’t find a cmake option for automatic manage signing (which i would use for the non cmake project)
This above seems not to work for the provisioning profile, therefore I currently have to manually tick Automatic signing everytime I execute cmake, which is really annoying. If anyone has knows how to handle the code signing stuff please help
Additionally I have some issues with adding external frameworks like SDKBOX to the project via cmake.
I’ve tried to play around with t target_link_libraries but it somehow doesn’t find the .framework.
Let me know if anyone has any idea of those 2 issues.