Skip to content

Commit

Permalink
thirdparty/QGeoView: Integrate cmake build with Talipot one
Browse files Browse the repository at this point in the history
  • Loading branch information
anlambert committed Dec 12, 2024
1 parent 23ce8b2 commit fdf1bb5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 46 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
62 changes: 16 additions & 46 deletions thirdparty/QGeoView/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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})

0 comments on commit fdf1bb5

Please sign in to comment.