Skip to content

Commit

Permalink
qt/test_v1: fix cmake condition for QML-test
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenRoederer committed Oct 22, 2024
1 parent f7eb2c7 commit 6cba279
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions recipes/qt/6.x.x/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ conan_set_libcxx()
conan_output_dirs_setup()

find_package(Qt6 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG)
find_package(Qt6 COMPONENTS Qml)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

Expand All @@ -25,12 +26,7 @@ set_property(TARGET ${PROJECT_NAME}2 PROPERTY CXX_STANDARD 17)
target_link_libraries(${PROJECT_NAME}2 PRIVATE Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml)

# check if QML modules are build and correctly deployed, if enabled

# we can't use OPTIONAL_COMPONENTS of find_package(), as conan philosophy is "you specify the package that you want"
# so the component is part of the package or not
if ("Qt6::Qml" IN_LIST Qt6_COMPONENTS)
find_package(Qt6 COMPONENTS Qml)

if (TARGET Qt6::Qml)
add_executable(CheckQMLModules ../test_package/test_qml_modules.cpp)
set_property(TARGET CheckQMLModules PROPERTY CXX_STANDARD 17)
target_link_libraries(CheckQMLModules Qt6::Core Qt6::Qml)
Expand Down

0 comments on commit 6cba279

Please sign in to comment.