-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
144 lines (120 loc) · 3.75 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
cmake_minimum_required(VERSION 3.1)
project(GeoViewer)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/bin/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/bin/lib)
# set path to additional CMake modules
#SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
option(TestCompile "if checked test Application will be compiled" True)
set(
LIBRARIES
qgis_gui
qgis_core
# qgis_app
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Positioning
Qt5::Xml
Qt5::Network
Qt5::Sql
Qt5::Svg
QDateConvertor
)
## Add search folder for CMake ------------------------------------------------------
#set(CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PATH})
# Qt Dependencies -------------------------------------------------------------
find_package(Qt5 COMPONENTS Core Gui Widgets Positioning Xml Network Sql Svg REQUIRED)
# Dependencies -------------------------------------------------------------
## QGIS Dependencies -------------------------------------------------------------
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DQGISDEBUG)
ENDIF()
file(GLOB_RECURSE QGIS_FILES "qgis/*.cpp" "qgis/*.h")
file(GLOB_RECURSE QGIS_UI "qgis/*.ui" )
qt5_wrap_ui (QGIS_WRAP_UI ${QGIS_UI})
#add_definitions(-DQT_NO_SSL) # remove qca dependence
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
## Password helper
#FIND_PACKAGE(QtKeychain REQUIRED)
##third party
if(NOT TARGET QDateConvertor)
add_subdirectory(lib/qdateconvertor)
endif()
#----------------------------------------------- GIS Engine Files
set(GIS_SRCS
src/mapwidget.cpp
src/common/geodatacontainer.cpp
src/common/geounitmanager.cpp
src/widgets/geomapcanvas.cpp
src/items/geoitem.cpp
src/items/geomarkeritem.cpp
src/items/geotextitem.cpp
src/items/geomultipositionItem.cpp
src/items/geosimplemarkeritem.cpp
src/items/geosectoritem.cpp
src/items/geocolorizepathitem.cpp
#----------------------------Components
src/components/geocomponent.cpp
src/components/geobrowsercomponent.cpp
src/components/geolayerscomponent.cpp
#----------------------------Tools
src/tools/geomultipositiontool.cpp
src/tools/geo2positionitemtool.cpp
src/tools/geomeasuretool.cpp
)
set( GIS_HDR
GeoViewer/mapwidget.h
GeoViewer/widgets/geomapcanvas.h
GeoViewer/common/mapstructures.h
GeoViewer/common/mapenums.h
GeoViewer/common/geodatacontainer.h
GeoViewer/common/geounitmanager.h
GeoViewer/items/geoitem.h
GeoViewer/items/geomarkeritem.h
GeoViewer/items/geotextitem.h
GeoViewer/items/geomultipositionItem.h
GeoViewer/items/geosimplemarkeritem.h
GeoViewer/items/geosectoritem.h
GeoViewer/items/geocolorizepathitem.h
#----------------------------Components
GeoViewer/components/geocomponent.h
GeoViewer/components/geobrowsercomponent.h
GeoViewer/components/geolayerscomponent.h
#----------------------------Tools
GeoViewer/tools/geomultipositiontool.h
GeoViewer/tools/geo2positionitemtool.h
GeoViewer/tools/geomeasuretool.h
)
set(
GIS_UI_FILES
ui/mapwidget.ui
)
qt5_wrap_ui (GIS_WRAP_UI ${GIS_UI_FILES})
set(
RESOURCE
qrc/images/images.qrc
)
qt5_add_resources(GIS_RESOURCE_ADDED ${RESOURCE})
include_directories(
GeoViewer
lib/qdateconvertor
/usr/include/qgis
/usr/include/qt5keychain/
/usr/include/gdal/
)
set(ALL_FILES
${GIS_SRCS}
${GIS_HDR}
${GIS_WRAP_UI}
${GIS_RESOURCE_ADDED}
${QGIS_FILES}
${QGIS_WRAP_UI}
)
add_library(${PROJECT_NAME} SHARED ${ALL_FILES})
target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
if(TestCompile)
add_subdirectory(test/GeoViewerTest)
endif()