Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.15.1, 5.15.2
-
None
-
-
265d48f688b4169e60055b15702a90eb54262298 (qt/tqtc-qtbase/5.15)
Description
Hi
I'm trying to build my project, which consists of an app and a few libraries, for Android. I'm building with CMake, there's no qmake nor QtCreator.
I get the following error at configure time:
CMake Error at C:/dev/qt/5.15.1/android/lib/cmake/Qt5Core/Qt5AndroidSupport.cmake:126 (add_custom_target): add_custom_target cannot create target "apk" because another target with the same name already exists. The existing target is a custom target created in source directory "my-project". See documentation for policy CMP0002 for more details. Call Stack (most recent call first): C:/dev/qt/5.15.1/android/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake:94 (include) C:/dev/qt/5.15.1/android/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:232 (include) my-project/CMakeLists.txt:28 (find_package)
It seems that Qt5AndroidSupport.cmake creates two custom CMake targets ("apk" and "aab") whenever it is included by a call to find_package(Qt). Therefore, multiple calls to find_package(Qt) produce this error, as it tries to create the "apk" and "aab" targets multiple times.
All this was previously working with Qt 5.13.1.