Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes related to issue #977 #981

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ find_package(
NO_MODULE
QUIET
)
if(QT_VERSION_MAJOR GREATER_EQUAL 6)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
find_package(
Qt${QT_VERSION_MAJOR}StateMachine
${Qt${QT_VERSION_MAJOR}_VERSION}
Expand All @@ -511,7 +511,7 @@ if(GAMMARAY_BUILD_DOCS)
find_package(Qt${QT_VERSION_MAJOR} NO_MODULE QUIET OPTIONAL_COMPONENTS Help LinguistTools)
endif()

if(QT_VERSION_MAJOR GREATER_EQUAL 6)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down Expand Up @@ -564,7 +564,7 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050500)
if(WARNINGS_ARE_ERRORS)
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=deprecated-declarations")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND QT_VERSION_MAJOR EQUAL 5)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND ${QT_VERSION_MAJOR} EQUAL 5)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=suggest-override") # Q_OBJECT expansion warnings
endif()

Expand Down Expand Up @@ -636,7 +636,7 @@ else()
set(GAMMARAY_CORE_ONLY_LAUNCHER TRUE)
endif()

if(QT_VERSION_MAJOR EQUAL 5)
if(${QT_VERSION_MAJOR} EQUAL 5)
add_feature_info("QtScript debugger" Qt5ScriptTools_FOUND "Requires QtScript and QtScriptTools.")
endif()
add_feature_info("Widget .ui file export" HAVE_QT_DESIGNER "Requires QtDesigner library.")
Expand Down
4 changes: 2 additions & 2 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

# qdoc toolchain
find_package(Qt${QT_VERSION_MAJOR} NO_MODULE QUIET OPTIONAL_COMPONENTS Help)
if(QT_VERSION_MAJOR EQUAL 5)
if(${QT_VERSION_MAJOR} EQUAL 5)
find_package(Qt${QT_VERSION_MAJOR} NO_MODULE QUIET OPTIONAL_COMPONENTS AttributionsScannerTools)
elseif(QT_VERSION_MAJOR GREATER_EQUAL 6)
elseif(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
find_package(Qt${QT_VERSION_MAJOR} NO_MODULE QUIET OPTIONAL_COMPONENTS ToolsTools)
endif()

Expand Down
2 changes: 1 addition & 1 deletion docs/collection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#

find_package(Qt${QT_VERSION_MAJOR} NO_MODULE QUIET OPTIONAL_COMPONENTS Help)
if(QT_VERSION_MAJOR GREATER_EQUAL 6)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
find_package(Qt${QT_VERSION_MAJOR} NO_MODULE QUIET OPTIONAL_COMPONENTS ToolsTools)
endif()
if(NOT TARGET Qt::qhelpgenerator)
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
add_subdirectory(quick-batching)
add_subdirectory(quick-event-handling)

if((QT_VERSION_MAJOR EQUAL 5) OR (QT_VERSION_MAJOR EQUAL 6 AND TARGET Qt6::StateMachine))
if((${QT_VERSION_MAJOR} EQUAL 5) OR (${QT_VERSION_MAJOR} EQUAL 6 AND TARGET Qt6::StateMachine))
add_subdirectory(state-machine)
endif()

Expand Down
2 changes: 1 addition & 1 deletion examples/quick-batching/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

qml_lint(quick-batching.qml)

if(QT_VERSION_MAJOR GREATER_EQUAL 6)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qml_lint(Slider.qml)
endif()
4 changes: 2 additions & 2 deletions launcher/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ int main(int argc, char **argv)
#endif
return launcher.exitCode();
} else {
QObject::connect(&launcher, &Launcher::finished, &app, &QApplication::quit);
QObject::connect(&launcher, &Launcher::attached, &app, &QApplication::quit);
QObject::connect(&launcher, &Launcher::finished, &app, &QCoreApplication::quit);
QObject::connect(&launcher, &Launcher::attached, &app, &QCoreApplication::quit);
}
auto result = app.exec();
return result == 0 ? launcher.exitCode() : result;
Expand Down
6 changes: 3 additions & 3 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
# Contact KDAB at <[email protected]> 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))
if((${QT_VERSION_MAJOR} EQUAL 5) OR (${QT_VERSION_MAJOR} EQUAL 6 AND TARGET Qt6::StateMachine))
add_subdirectory(statemachineviewer)
else()
message(STATUS "WARNING: Skipping the statemachineviewer plugin since Qt6StateMachine was not found")
Expand All @@ -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()

Expand Down
5 changes: 4 additions & 1 deletion plugins/network/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ if(NOT GAMMARAY_CLIENT_ONLY_BUILD)
networksupportinterface.cpp
networksupportinterface.h
)
if(TARGET Qt5::Network)
if(${QT_VERSION_MAJOR} EQUAL 5 AND TARGET Qt5::Network)
message("6 ${QT_VERSION_MAJOR}")
message(${QT_VERSION_MAJOR})
message(QT_VERSION_MAJOR)
list(APPEND gammaray_network_srcs networkconfigurationmodel.cpp networkconfigurationmodel.h)
endif()
gammaray_add_plugin(
Expand Down
2 changes: 1 addition & 1 deletion plugins/openglsupport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions plugins/statemachineviewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
8 changes: 4 additions & 4 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<TARGET_OBJECTS:modeltestobj>
Expand Down Expand Up @@ -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"
)
Expand All @@ -528,7 +528,7 @@ if(NOT GAMMARAY_CLIENT_ONLY_BUILD)
quickinspectortest2 quickinspectortest2.cpp quickinspectortest.qrc $<TARGET_OBJECTS:modeltestobj>
)
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"
)
Expand Down Expand Up @@ -562,7 +562,7 @@ if(NOT GAMMARAY_CLIENT_ONLY_BUILD)
gammaray_add_quick_test(
quickmaterialtest quickmaterialtest.cpp quickinspectortest.qrc $<TARGET_OBJECTS:modeltestobj>
)
if(QT_VERSION_MAJOR GREATER_EQUAL 6)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
find_package(Qt6ShaderTools)
if(Qt6ShaderTools_FOUND)
qt6_add_shaders(
Expand Down
7 changes: 5 additions & 2 deletions tests/manual/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if(TARGET Qt::Widgets)
add_dependencies(translator_test translator_test_qm)
endif()

if(Qt5Webkit_FOUND)
if(${QT_VERSION_MAJOR} EQUAL 5 AND Qt5Webkit_FOUND)
add_executable(wk1application wk1application.cpp)
target_link_libraries(
wk1application
Expand All @@ -58,7 +58,10 @@ if(Qt5Webkit_FOUND)
)
endif()

if(Qt5WebKit_FOUND AND TARGET Qt::Quick)
if(${QT_VERSION_MAJOR} EQUAL 5
AND Qt5WebKit_FOUND
AND TARGET Qt::Quick
)
set(wk2application_srcs wk2application.cpp wk2application.qrc)
add_executable(wk2application ${wk2application_srcs})
target_link_libraries(wk2application Qt::Quick)
Expand Down