ECMFindQmlModule unittest with Qt6
Start 18: ECMFindQmlModule
18: Test command: /usr/bin/ctest "--build-and-test" "/home/ahmad/dev6/extra-cmake-modules/tests/ECMFindQmlModule" "/home/ahmad/dev6/extra-cmake-modules/build/tests/ECMFindQmlModule" "--build-two-config" "--build-generator" "Unix Makefiles" "--build-makeprogram" "/usr/bin/gmake" "--build-project" "ECMFindQmlModule" "--build-options" "-DBUILD_WITH_QT6=ON" "--test-command" "dummy"
18: Test timeout computed to be: 10000000
18: Internal cmake changing into directory: /home/ahmad/dev6/extra-cmake-modules/build/tests/ECMFindQmlModule
18: Error: cmake execution failed
18: CMake Error at /lib64/cmake/Qt6QmlTools/Qt6QmlToolsConfig.cmake:60 (__qt_internal_promote_target_to_global):
18: Unknown CMake command "__qt_internal_promote_target_to_global".
18: Call Stack (most recent call first):
18: /home/ahmad/dev6/extra-cmake-modules/build/tests/ECMFindQmlModule/FindQtQuick-QMLModule.cmake:15 (find_package)
18: /home/ahmad/dev6/extra-cmake-modules/modules/ECMFindQmlModule.cmake:46 (find_package)
18: CMakeLists.txt:10 (ecm_find_qmlmodule)
18:
18:
18: Configuring incomplete, errors occurred!
18: See also "/home/ahmad/dev6/extra-cmake-modules/build/tests/ECMFindQmlModule/CMakeFiles/CMakeOutput.log".
18:
1/1 Test #18: ECMFindQmlModule .................***Failed 0.02 sec
looks like __qt_internal_promote_target_to_global
is defined in /usr/lib64/cmake/Qt6/QtPublicTargetHelpers.cmake
And adding this to ECMFindQmlModule, lets the unittest pass:
include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake)
if(QT_MAJOR_VERSION EQUAL "6")
include(/usr/lib64/cmake/Qt6/QtPublicTargetHelpers.cmake)
endif()
but this looks like an upstream bug?