Skip to content
Permalink
Browse files

fix cmake for Qt6

  • Loading branch information
3nids committed Mar 24, 2021
1 parent 02691ca commit 0a69331da739c514e417878ef27dc4b267221d20
Showing with 12 additions and 16 deletions.
  1. +12 −16 src/native/CMakeLists.txt
@@ -10,11 +10,7 @@ endif()
set(NATIVE_LINK_LIBS)

if(UNIX AND NOT APPLE AND NOT ANDROID)
if (WITH_QT6)
find_package(Qt6 COMPONENTS DBus REQUIRED)
else()
find_package(Qt5DBus REQUIRED)
endif()
find_package(${QT_VERSION_BASE} COMPONENTS DBus REQUIRED)
endif()

if(APPLE)
@@ -138,28 +134,28 @@ if(NOT ANDROID)
)
endif()

target_link_libraries(qgis_native
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
"${NATIVE_LINK_LIBS}"
)
if (WITH_QT6)
target_link_libraries(qgis_native ${Qt6Core_LIBRARIES} ${Qt6Gui_LIBRARIES} "${NATIVE_LINK_LIBS}")
else()
target_link_libraries(qgis_native ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} "${NATIVE_LINK_LIBS}")
endif()

if (UNIX AND NOT APPLE AND NOT ANDROID)
target_link_libraries(qgis_native Qt5::DBus)
target_link_libraries(qgis_native ${QT_VERSION_BASE}::DBus)
endif()

if (APPLE)
find_package(Qt5MacExtras)
find_package(${QT_VERSION_BASE}MacExtras)

target_link_libraries(qgis_native Qt5::MacExtras)
target_link_libraries(qgis_native ${QT_VERSION_BASE}::MacExtras)
endif()

if (MSVC)
find_package(Qt5WinExtras)
find_package(${QT_VERSION_BASE}WinExtras)

target_link_libraries(qgis_native shell32)
target_link_libraries(qgis_native ${Qt5Widget_LIBRARIES} ${QT_QTMAIN_LIBRARY})
target_link_libraries(qgis_native Qt5::WinExtras)
target_link_libraries(qgis_native ${${QT_VERSION_BASE}Widget_LIBRARIES} ${QT_QTMAIN_LIBRARY})
target_link_libraries(qgis_native ${QT_VERSION_BASE}::WinExtras)
endif()
# install

0 comments on commit 0a69331

Please sign in to comment.