diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index ae5cef6692..77f267905a 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -7,7 +7,7 @@ # Contact KDAB at for commercial licensing options. # -if(TARGET Qt5::Core) +if(QT_VERSION_MAJOR EQUAL 5 AND TARGET Qt5::Core) add_subdirectory(codecbrowser) endif() if((QT_VERSION_MAJOR EQUAL 5) OR (QT_VERSION_MAJOR EQUAL 6 AND TARGET Qt6::StateMachine)) @@ -35,7 +35,7 @@ if(TARGET Qt::Gui) add_subdirectory(guisupport) add_subdirectory(textdocumentinspector) endif() -if(TARGET Qt5::Gui OR TARGET Qt6::OpenGL) +if((QT_VERSION_MAJOR EQUAL 5 AND TARGET Qt5::Gui) OR (QT_VERSION_MAJOR EQUAL 6 AND TARGET Qt6::OpenGL)) add_subdirectory(openglsupport) endif() diff --git a/plugins/network/CMakeLists.txt b/plugins/network/CMakeLists.txt index 2e0e7690c4..1735ab7151 100644 --- a/plugins/network/CMakeLists.txt +++ b/plugins/network/CMakeLists.txt @@ -23,7 +23,7 @@ if(NOT GAMMARAY_CLIENT_ONLY_BUILD) networksupportinterface.cpp networksupportinterface.h ) - if(TARGET Qt5::Network) + if(${QT_VERSION_MAJOR} EQUAL 5 AND TARGET Qt5::Network) list(APPEND gammaray_network_srcs networkconfigurationmodel.cpp networkconfigurationmodel.h) endif() gammaray_add_plugin( diff --git a/plugins/openglsupport/CMakeLists.txt b/plugins/openglsupport/CMakeLists.txt index 51225a41d1..969fbb36f6 100644 --- a/plugins/openglsupport/CMakeLists.txt +++ b/plugins/openglsupport/CMakeLists.txt @@ -18,7 +18,7 @@ if(NOT GAMMARAY_CLIENT_ONLY_BUILD) openglsupport.h ) target_link_libraries(gammaray_openglsupport gammaray_core Qt::Gui Qt::CorePrivate) - if(TARGET Qt6::OpenGL) + if(QT_VERSION_MAJOR EQUAL 6 AND TARGET Qt6::OpenGL) target_link_libraries(gammaray_openglsupport Qt6::OpenGL) endif() endif() diff --git a/plugins/statemachineviewer/CMakeLists.txt b/plugins/statemachineviewer/CMakeLists.txt index 10d13596ac..80f9a45f4e 100644 --- a/plugins/statemachineviewer/CMakeLists.txt +++ b/plugins/statemachineviewer/CMakeLists.txt @@ -49,7 +49,7 @@ if(NOT GAMMARAY_CLIENT_ONLY_BUILD) if(TARGET Qt::Scxml) target_link_libraries(gammaray_statemachineviewer_plugin Qt::Scxml Qt::ScxmlPrivate) endif() - if(TARGET Qt6::StateMachine) + if(QT_VERSION_MAJOR EQUAL 6 AND TARGET Qt6::StateMachine) target_link_libraries(gammaray_statemachineviewer_plugin Qt6::StateMachine Qt6::StateMachinePrivate) endif() endif() @@ -83,7 +83,7 @@ if(GAMMARAY_BUILD_UI AND GAMMARAY_WITH_KDSME) gammaray_ui ) - if(TARGET Qt6::StateMachine) + if(QT_VERSION_MAJOR EQUAL 6 AND TARGET Qt6::StateMachine) target_link_libraries(gammaray_statemachineviewer_ui_plugin Qt6::StateMachine) endif() endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 69f2ee9e3f..0f465c0171 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -445,7 +445,7 @@ target_link_libraries( fontdatabasemodeltest Qt::Gui ) -if(TARGET Qt5::Core) +if(QT_VERSION_MAJOR EQUAL 5 AND TARGET Qt5::Core) gammaray_add_test( codecmodeltest codecmodeltest.cpp ${CMAKE_SOURCE_DIR}/plugins/codecbrowser/codecmodel.cpp $ @@ -518,7 +518,7 @@ if(NOT GAMMARAY_CLIENT_ONLY_BUILD) ) # only opengl rhi backend is supported atm - if(TARGET Qt6::Quick) + if(QT_VERSION_MAJOR EQUAL 6 AND TARGET Qt6::Quick) set_tests_properties( quickinspectortest PROPERTIES ENVIRONMENT "QT_QUICK_BACKEND=rhi;QSG_RHI_BACKEND=opengl" ) @@ -528,7 +528,7 @@ if(NOT GAMMARAY_CLIENT_ONLY_BUILD) quickinspectortest2 quickinspectortest2.cpp quickinspectortest.qrc $ ) target_link_libraries(quickinspectortest2 gammaray_core gammaray_quickinspector_shared Qt::Quick) - if(TARGET Qt6::Quick) + if(QT_VERSION_MAJOR EQUAL 6 AND TARGET Qt6::Quick) set_tests_properties( quickinspectortest2 PROPERTIES ENVIRONMENT "QT_QUICK_BACKEND=rhi;QSG_RHI_BACKEND=opengl" )