Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
Qt Creator 16.0.1
-
None
Description
I recently tried to add Android support to an application I'm working on, and in the process added a CMake preset for it. Building the application / apk using the CMake command-line interface works now, but trying to use QtCreator to build and debug the application unfortunately doesn't work out of the box.
One of the issues I encountered is that in the created temporary kit, the "Run device" is set to "Desktop" instead of "Android Device".
One solution is to have QtCreator infer that the preset is targeting Android by looking at the CMake cache variables or environment variables that the presets sets. For example, my preset sets QT_ANDROID_SIGN_APK and QT_ANDROID_ABIS which are Android-specific. Alternatively, it could also look at the value of Qt6_ROOT or Qt_ROOT to find the used Qt installation and check what that is targeting.
Alternatively, if you don't want to implement a heuristic to determine the Run device you could also introduce a vendor property in the configure preset to have the preset specify it explicitly.