diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2025-04-25 08:01:32 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2025-05-16 08:54:13 +0200 |
| commit | 78f8c6c81c2e900aa1cb433940667a054cc0b6ed (patch) | |
| tree | b03c5c96e1d45645a5528d2007f343f21bd46f48 /cmake/opentrack-qt.cmake | |
| parent | 1f737463587fec21337631bc0320718b49fde26c (diff) | |
buffer flush
Diffstat (limited to 'cmake/opentrack-qt.cmake')
| -rw-r--r-- | cmake/opentrack-qt.cmake | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/cmake/opentrack-qt.cmake b/cmake/opentrack-qt.cmake index 1735e836..8f6dc70e 100644 --- a/cmake/opentrack-qt.cmake +++ b/cmake/opentrack-qt.cmake @@ -1,33 +1,33 @@ include_guard(GLOBAL) -if(WIN32) - find_package(Qt5Gui REQUIRED COMPONENTS QWindowsIntegrationPlugin) -endif() -set(qt-required-components Core Network Widgets LinguistTools Gui) +set(qt-required-components Core Network Widgets LinguistTools Gui Core5Compat) set(qt-optional-components SerialPort) -set(qt-imported-targets Qt5::Core Qt5::Gui Qt5::Network Qt5::Widgets) +set(qt-imported-targets Qt6::Core Qt6::Gui Qt6::Network Qt6::Widgets Qt6::Core5Compat) if(APPLE) list(APPEND qt-required-components "DBus") list(APPEND qt-optional-components "Multimedia") - list(APPEND qt-imported-targets Qt5::DBus Qt5::Multimedia) + list(APPEND qt-imported-targets Qt6::DBus Qt6::Multimedia) endif() -find_package(Qt5 REQUIRED COMPONENTS ${qt-required-components} QUIET) -find_package(Qt5 COMPONENTS ${qt-optional-components} QUIET) +find_package(Qt6 REQUIRED COMPONENTS ${qt-required-components} QUIET) +find_package(Qt6 COMPONENTS ${qt-optional-components} QUIET) +if(WIN32) + find_package(Qt6Gui REQUIRED COMPONENTS QWindowsIntegrationPlugin) +endif() -set(MY_QT_LIBS ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES}) +set(MY_QT_LIBS ${Qt6Core_LIBRARIES} ${Qt6Gui_LIBRARIES} ${Qt6Widgets_LIBRARIES} ${Qt6Network_LIBRARIES} ${Qt6Core5Compat_LIBRARIES}) if(APPLE) - list(APPEND MY_QT_LIBS ${Qt5Multimedia_LIBRARIES} ${Qt5DBus_LIBRARIES}) + list(APPEND MY_QT_LIBS ${Qt6Multimedia_LIBRARIES} ${Qt6DBus_LIBRARIES}) endif() function(otr_install_qt_libs) foreach(i ${qt-imported-targets}) - if(NOT TARGET "${i}") - continue() - endif() + #if(NOT TARGET "${i}") + # continue() + #endif() otr_install_lib(${i} ".") endforeach() if(WIN32) - otr_install_lib(Qt5::QWindowsIntegrationPlugin "./platforms") + otr_install_lib(Qt6::QWindowsIntegrationPlugin "./platforms") endif() endfunction() @@ -39,9 +39,9 @@ function(otr_qt n) if(".${${n}-cc}${${n}-cxx}${${n}-hh}" STREQUAL ".") message(FATAL_ERROR "project ${n} not globbed") endif() - qt5_wrap_cpp(${n}-moc ${${n}-hh} OPTIONS --no-notes -I "${CMAKE_CURRENT_BINARY_DIR}" -I "${CMAKE_SOURCE_DIR}") - qt5_wrap_ui(${n}-uih ${${n}-ui}) - qt5_add_resources(${n}-rcc ${${n}-rc}) + qt6_wrap_cpp(${n}-moc ${${n}-hh} OPTIONS --no-notes -I "${CMAKE_CURRENT_BINARY_DIR}" -I "${CMAKE_SOURCE_DIR}") + qt6_wrap_ui(${n}-uih ${${n}-ui}) + qt6_add_resources(${n}-rcc ${${n}-rc}) foreach(i moc uih rcc) set(${n}-${i} "${${n}-${i}}" PARENT_SCOPE) @@ -52,10 +52,10 @@ endfunction() function(otr_qt2 n) target_include_directories("${n}" SYSTEM PRIVATE - ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} + ${Qt6Core_INCLUDE_DIRS} ${Qt6Gui_INCLUDE_DIRS} ${Qt6Widgets_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS} ) target_compile_definitions("${n}" PRIVATE - ${Qt5Core_DEFINITIONS} ${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS} + ${Qt6Core_DEFINITIONS} ${Qt6Gui_DEFINITIONS} ${Qt6Widgets_DEFINITIONS} ${Qt6Network_DEFINITIONS} -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_MESSAGELOGCONTEXT ) |
