From da17c6e4118f87e41c7c847517cab84c618f7632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C4=81rlis=20Se=C5=86ko?= Date: Tue, 13 Apr 2021 21:15:57 +0300 Subject: [PATCH] Build system compatiblity with QT6. Qt6 moved some of the functionality to separate modules. --- CMakeLists.txt | 4 ++++ cmake/Translations.cmake | 9 +++++++-- src/CMakeLists.txt | 5 +++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea2673b2..23b4fff4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,11 @@ if (CUTTER_QT6) else() set(QT_PREFIX Qt5) endif() + find_package(${QT_PREFIX} REQUIRED COMPONENTS Core Widgets Gui Svg Network) +if (CUTTER_QT6) + find_package(${QT_PREFIX} REQUIRED COMPONENTS Core5Compat SvgWidgets OpenGLWidgets) +endif() if(CUTTER_ENABLE_PYTHON) find_package(PythonInterp REQUIRED) diff --git a/cmake/Translations.cmake b/cmake/Translations.cmake index 9cdd6951..266b5706 100644 --- a/cmake/Translations.cmake +++ b/cmake/Translations.cmake @@ -20,8 +20,13 @@ set(TS_FILES # translations/pt-BR/cutter_pt.ts #2321 handling multiple versions of a language set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/translations) -find_package(Qt5LinguistTools REQUIRED) -qt5_add_translation(qmFiles ${TS_FILES}) +if (CUTTER_QT6) + find_package(Qt6LinguistTools REQUIRED) + qt6_add_translation(qmFiles ${TS_FILES}) +else() + find_package(Qt5LinguistTools REQUIRED) + qt5_add_translation(qmFiles ${TS_FILES}) +endif() add_custom_target(translations ALL DEPENDS ${qmFiles} SOURCES ${TS_FILES}) install(FILES diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0ff50cdc..87f14ef5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -459,6 +459,11 @@ if(CUTTER_ENABLE_CRASH_REPORTS) endif() target_link_libraries(Cutter PUBLIC ${QT_PREFIX}::Core ${QT_PREFIX}::Widgets ${QT_PREFIX}::Gui PRIVATE ${QT_PREFIX}::Svg ${QT_PREFIX}::Network) +if (CUTTER_QT6) + target_link_libraries(Cutter PUBLIC Qt6::Core5Compat Qt6::SvgWidgets) + target_link_libraries(Cutter PRIVATE Qt6::OpenGLWidgets) +endif() + target_link_libraries(Cutter PUBLIC ${RIZIN_TARGET}) if(CUTTER_ENABLE_PYTHON) if (WIN32)