Build system compatiblity with QT6.

Qt6 moved some of the functionality to separate modules.
This commit is contained in:
Kārlis Seņko 2021-04-13 21:15:57 +03:00 committed by karliss
parent 4328f5df5a
commit da17c6e411
3 changed files with 16 additions and 2 deletions

View File

@ -61,7 +61,11 @@ if (CUTTER_QT6)
else() else()
set(QT_PREFIX Qt5) set(QT_PREFIX Qt5)
endif() endif()
find_package(${QT_PREFIX} REQUIRED COMPONENTS Core Widgets Gui Svg Network) 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) if(CUTTER_ENABLE_PYTHON)
find_package(PythonInterp REQUIRED) find_package(PythonInterp REQUIRED)

View File

@ -20,8 +20,13 @@ set(TS_FILES
# translations/pt-BR/cutter_pt.ts #2321 handling multiple versions of a language # 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) set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/translations)
find_package(Qt5LinguistTools REQUIRED) if (CUTTER_QT6)
qt5_add_translation(qmFiles ${TS_FILES}) 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}) add_custom_target(translations ALL DEPENDS ${qmFiles} SOURCES ${TS_FILES})
install(FILES install(FILES

View File

@ -459,6 +459,11 @@ if(CUTTER_ENABLE_CRASH_REPORTS)
endif() endif()
target_link_libraries(Cutter PUBLIC ${QT_PREFIX}::Core ${QT_PREFIX}::Widgets ${QT_PREFIX}::Gui PRIVATE ${QT_PREFIX}::Svg ${QT_PREFIX}::Network) 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}) target_link_libraries(Cutter PUBLIC ${RIZIN_TARGET})
if(CUTTER_ENABLE_PYTHON) if(CUTTER_ENABLE_PYTHON)
if (WIN32) if (WIN32)