-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (44 loc) · 1.44 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.12)
project(QtBasemapPlugin VERSION 1.0.0 LANGUAGES CXX)
set(LIB_NAME qtgeoservices_basemap_pix4d)
set(PACKAGE_NAME QtBasemapPlugin)
if (NOT ${BUILD_SHARED_LIBS})
message(STATUS " ***** Build plugin as static library *****")
set(DEFINES "-DQT_STATICPLUGIN -DQT_PLUGIN")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DEFINES}")
set(CXXFLAGS "${CXXFLAGS} ${DEFINES}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DEFINES}")
endif()
find_package(Qt5 COMPONENTS
Core
Location
REQUIRED QUIET)
set(SOURCES
src/GeoServiceProviderPlugin.cpp
src/GeoTiledMappingManagerEngine.cpp
src/GeoTileFetcher.cpp
src/GeoMapReply.cpp
src/GeoFileTileCache.cpp
src/GeoServiceProviderPlugin.h
src/GeoTiledMappingManagerEngine.h
src/GeoTileFetcher.h
src/GeoMapReply.h
src/GeoFileTileCache.h
)
add_library(${LIB_NAME} ${SOURCES} )
set_target_properties(${LIB_NAME} PROPERTIES AUTORCC ON AUTOMOC ON)
target_link_libraries(${LIB_NAME} PRIVATE
Qt5::Core
Qt5::Location
Qt5::LocationPrivate
)
target_include_directories(${LIB_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
target_compile_features(${LIB_NAME} PRIVATE cxx_std_14)
install(TARGETS ${LIB_NAME} EXPORT ${PACKAGE_NAME}Config
LIBRARY DESTINATION plugins/geoservices
RUNTIME DESTINATION plugins/geoservices
ARCHIVE DESTINATION lib
)
install(EXPORT ${PACKAGE_NAME}Config DESTINATION share/${PACKAGE_NAME}/cmake)