tqu-dev
(Harald Meyer)
April 9, 2023, 4:15am
1
Hi,
At the moment I am using cmake for generating a xCode iOS project (using Qt for iOS framework) which is then used for creating an archive and for the app store submission. Now I want to add a WatchKit extension to the iOS app. This can be manually done in Xcode but each time cmake is run again, the xCode project is re-written and the WatchKit project structure must be manually re-created in xCode (which is a lot of work).
It is possible to compile for WatchOS (https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-or-watchos ) but this does not create the appropriate xCode project structure.
Is it possible to generate a WatchOS/WatchKit extension structure (https://developer.apple.com/documentation/watchkit/setting_up_a_watchos_project?language=objc#3295999 ) using cmake?
Thanks,
ben.boeckel
(Ben Boeckel (Kitware))
April 24, 2023, 4:48am
2
There are XCODE_ATTRIBUTE_*
properties that are available. But maybe this needs some dedicated support.
tqu-dev
(Harald Meyer)
April 24, 2023, 12:58pm
3
Yes, but to the best of my knowledge none of these work for this use case.
ben.boeckel
(Ben Boeckel (Kitware))
April 24, 2023, 1:32pm
4
Knowing what to put into the Xcode project files would be a great help here. We’ve always had to reverse engineer the format.
tqu-dev
(Harald Meyer)
April 24, 2023, 1:37pm
5
Is it sufficient to post a project before and after adding the WatchKit extension (so that you can diff it)? Or do you need something else?
ben.boeckel
(Ben Boeckel (Kitware))
April 24, 2023, 5:08pm
6
I suspect instructions for what boxes to poke in Xcode would also be helpful, but a before-and-after can’t hurt.
tqu-dev
(Harald Meyer)
April 25, 2023, 3:46am
7
Attached is a sample project (https://bit.ly/41UY13r ):
sampleqt: The Qt project with the CMakeLists.txt
build-sampleqt-Qt_6_5_0_for_iOS_BEFORE_WATCHKIT: The generated xCode project before adding WatchKit support.
build-sampleqt-Qt_6_5_0_for_iOS_AFTER_WATCHKIT: The generated xCode project after manually adding WatchKit support.
tqu-dev
(Harald Meyer)
April 25, 2023, 3:46am
8
This video shows how to manually add WatchKit support to a xCode project: