2021-07-23 17:06:24 +02:00
|
|
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
|
|
|
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
|
2020-11-21 12:24:34 +01:00
|
|
|
|
2021-07-23 17:06:24 +02:00
|
|
|
set(PROJECT_SOURCES
|
2020-11-21 12:24:34 +01:00
|
|
|
about_dialog.cpp
|
|
|
|
info_dialog.cpp
|
|
|
|
layerdelegate.cpp
|
|
|
|
layerlistmodel.cpp
|
|
|
|
layerwidget.cpp
|
|
|
|
layer_info_dialog.cpp
|
|
|
|
main.cpp
|
|
|
|
mainwindow.cpp
|
|
|
|
mapwidget.cpp
|
|
|
|
styles_model.cpp
|
|
|
|
forms/about.ui
|
|
|
|
forms/info.ui
|
2022-08-17 17:19:59 +02:00
|
|
|
forms/layer_info.ui
|
2020-11-21 12:24:34 +01:00
|
|
|
mapnik_viewer.qrc
|
|
|
|
)
|
|
|
|
|
2021-07-23 17:06:24 +02:00
|
|
|
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
|
|
|
qt_add_executable(mapnik-viewer
|
|
|
|
MANUAL_FINALIZATION
|
|
|
|
${PROJECT_SOURCES}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
if(ANDROID)
|
|
|
|
add_library(mapnik-viewer SHARED
|
|
|
|
${PROJECT_SOURCES}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
add_executable(mapnik-viewer
|
|
|
|
${PROJECT_SOURCES}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-11-21 12:24:34 +01:00
|
|
|
set_target_properties(mapnik-viewer PROPERTIES
|
|
|
|
AUTOUIC_SEARCH_PATHS forms
|
2022-08-17 17:19:59 +02:00
|
|
|
AUTORCC ON
|
2020-11-21 12:24:34 +01:00
|
|
|
AUTOUIC ON
|
|
|
|
AUTOMOC ON
|
2021-10-25 18:58:55 +02:00
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
|
2022-04-22 15:10:49 +02:00
|
|
|
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
|
2020-11-21 12:24:34 +01:00
|
|
|
)
|
|
|
|
|
2022-08-17 17:19:59 +02:00
|
|
|
target_link_libraries(mapnik-viewer PRIVATE
|
2021-07-23 17:06:24 +02:00
|
|
|
Qt${QT_VERSION_MAJOR}::Widgets
|
2020-11-21 12:24:34 +01:00
|
|
|
mapnik::agg
|
|
|
|
mapnik::mapnik
|
|
|
|
)
|
2021-07-23 17:06:24 +02:00
|
|
|
|
2022-08-17 17:19:59 +02:00
|
|
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/viewer.ini
|
2020-11-21 12:24:34 +01:00
|
|
|
"[mapnik]
|
2020-11-25 13:20:07 +01:00
|
|
|
plugins_dir=${PLUGINS_INSTALL_DIR}
|
|
|
|
fonts/1/dir=${FONTS_INSTALL_DIR}"
|
2020-11-21 12:24:34 +01:00
|
|
|
)
|
2021-07-23 17:06:24 +02:00
|
|
|
|
|
|
|
if(QT_VERSION_MAJOR EQUAL 6)
|
|
|
|
qt_finalize_executable(mapnik-viewer)
|
|
|
|
endif()
|
|
|
|
|
2020-11-21 12:24:34 +01:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/viewer.ini DESTINATION bin)
|
2021-09-22 20:49:44 +02:00
|
|
|
mapnik_install_utility(mapnik-viewer)
|