From fdf1bb56a8d23dd2590926256d9170bdb35d1105 Mon Sep 17 00:00:00 2001 From: Antoine Lambert Date: Wed, 11 Dec 2024 20:29:40 +0100 Subject: [PATCH] thirdparty/QGeoView: Integrate cmake build with Talipot one --- CMakeLists.txt | 2 + thirdparty/CMakeLists.txt | 1 + thirdparty/QGeoView/CMakeLists.txt | 62 ++++++++---------------------- 3 files changed, 19 insertions(+), 46 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45848955a3..2b4734d53c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -328,6 +328,8 @@ IF(NOT TALIPOT_BUILD_CORE_ONLY OR TALIPOT_BUILD_OGL) SET(FTGLLibrary ftgl-talipot-${TalipotMMVersion}) SET(Tess2Include ${PROJECT_SOURCE_DIR}/thirdparty/libtess2/Include) SET(Tess2Library tess2-talipot-${TalipotMMVersion}) + SET(QGeoViewLibrary QGeoView-talipot-${TalipotMMVersion}) + SET(QGeoViewInclude ${PROJECT_SOURCE_DIR}/thirdparty/QGeoView/include) IF(NOT QUAZIP_FOUND) SET(QUAZIP_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/thirdparty/quazip-1.4/quazip) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 96e3da34b5..205eb1874e 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -9,6 +9,7 @@ ADD_SUBDIRECTORY(libvpsc) IF(NOT TALIPOT_BUILD_CORE_ONLY OR TALIPOT_BUILD_OGL) ADD_SUBDIRECTORY(ftgl) ADD_SUBDIRECTORY(libtess2) + ADD_SUBDIRECTORY(QGeoView) IF(NOT QUAZIP_FOUND) SET(QUAZIP_QT_MAJOR_VERSION ${QT_MAJOR_VERSION}) diff --git a/thirdparty/QGeoView/CMakeLists.txt b/thirdparty/QGeoView/CMakeLists.txt index 72c99ef779..5c5063318c 100644 --- a/thirdparty/QGeoView/CMakeLists.txt +++ b/thirdparty/QGeoView/CMakeLists.txt @@ -1,29 +1,6 @@ -set(CMAKE_CXX_STANDARD 11) set(CMAKE_AUTOMOC ON) -# Set the QT version -option(USE_QT_5 "Force Qt 5 usage" OFF) - -if (${USE_QT_5}) - message(STATUS "Will use Qt 5") -else() - find_package(Qt6 COMPONENTS Core QUIET) -endif() - -if (NOT Qt6_FOUND) - set(QT_VERSION 5 CACHE STRING "Qt version for QGeoView") -else() - set(QT_VERSION 6 CACHE STRING "Qt version for QGeoView") -endif() - -find_package(Qt${QT_VERSION} REQUIRED COMPONENTS - Core - Gui - Widgets - Network -) - -add_library(qgeoview SHARED +add_library(${QGeoViewLibrary} SHARED include/QGeoView/QGVGlobal.h include/QGeoView/QGVUtils.h include/QGeoView/QGVProjection.h @@ -76,35 +53,28 @@ add_library(qgeoview SHARED src/Raster/QGVIcon.cpp ) -target_include_directories(qgeoview +target_include_directories(${QGeoViewLibrary} PUBLIC - include + include PRIVATE - include/QGeoView + include/QGeoView ) -target_compile_definitions(qgeoview +target_compile_definitions(${QGeoViewLibrary} PRIVATE - QGV_EXPORT + QGV_EXPORT ) -target_link_libraries(qgeoview +target_link_libraries(${QGeoViewLibrary} PRIVATE - Qt${QT_VERSION}::Core - Qt${QT_VERSION}::Gui - Qt${QT_VERSION}::Widgets - Qt${QT_VERSION}::Network + Qt${QT_MAJOR_VERSION}::Core + Qt${QT_MAJOR_VERSION}::Gui + Qt${QT_MAJOR_VERSION}::Widgets + Qt${QT_MAJOR_VERSION}::Network ) -add_library(QGeoView ALIAS qgeoview) - -install(TARGETS qgeoview LIBRARY - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib/static -) - -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ - DESTINATION include - FILES_MATCHING PATTERN "*.h*" -) +install( + TARGETS ${QGeoViewLibrary} + RUNTIME DESTINATION ${TalipotBinInstallDir} + LIBRARY DESTINATION ${TalipotLibInstallDir} + ARCHIVE DESTINATION ${TalipotLibInstallDir})