-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
CMakeLists.txt
153 lines (124 loc) · 4.05 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
143
144
145
146
147
148
149
150
151
152
153
########################################################
# Files
set(WFS_SRCS
qgswfsprovider.cpp
qgswfsprovidermetadata.cpp
qgswfscapabilities.cpp
qgswfsdataitems.cpp
qgswfsfeatureiterator.cpp
qgswfsgetfeature.cpp
qgswfsrequest.cpp
qgswfsconnection.cpp
qgswfsdatasourceuri.cpp
qgswfsconstants.cpp
qgswfsdescribefeaturetype.cpp
qgswfsshareddata.cpp
qgswfstransactionrequest.cpp
qgswfsutils.cpp
qgsbackgroundcachedfeatureiterator.cpp
qgsbackgroundcachedshareddata.cpp
qgscachedirectorymanager.cpp
qgsbasenetworkrequest.cpp
oapif/qgsoapiflandingpagerequest.cpp
oapif/qgsoapifapirequest.cpp
oapif/qgsoapifcollection.cpp
oapif/qgsoapifconformancerequest.cpp
oapif/qgsoapifcreatefeaturerequest.cpp
oapif/qgsoapifcql2textexpressioncompiler.cpp
oapif/qgsoapifdeletefeaturerequest.cpp
oapif/qgsoapifpatchfeaturerequest.cpp
oapif/qgsoapifputfeaturerequest.cpp
oapif/qgsoapifitemsrequest.cpp
oapif/qgsoapifoptionsrequest.cpp
oapif/qgsoapifprovider.cpp
oapif/qgsoapifqueryablesrequest.cpp
oapif/qgsoapifsingleitemrequest.cpp
oapif/qgsoapifutils.cpp
)
if (WITH_GUI)
set(WFS_GUI_SRCS
qgswfsprovidergui.cpp
qgswfsdataitemguiprovider.cpp
qgswfssourceselect.cpp
qgswfsnewconnection.cpp
qgswfsguiutils.cpp
qgswfssubsetstringeditor.cpp
)
set(WFS_UIS ${CMAKE_SOURCE_DIR}/src/ui/qgswfssourceselectbase.ui)
endif()
########################################################
# Static
add_library(provider_wfs_a STATIC ${WFS_SRCS})
set_target_properties(provider_wfs_a PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
target_include_directories(provider_wfs_a PUBLIC
${CMAKE_SOURCE_DIR}/src/providers/wfs
${CMAKE_SOURCE_DIR}/src/providers/wfs/oapif
)
target_link_libraries(provider_wfs_a
qgis_core
GDAL::GDAL
)
# require c++17
target_compile_features(provider_wfs_a PRIVATE cxx_std_17)
# We use private headers from core that need this
target_compile_definitions(provider_wfs_a PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_compile_definitions(provider_wfs_a PRIVATE "-DQT_NO_FOREACH")
if (WITH_GUI)
if (BUILD_WITH_QT6)
QT6_WRAP_UI(WFS_UIS_H ${WFS_UIS})
else()
QT5_WRAP_UI(WFS_UIS_H ${WFS_UIS})
endif()
add_library(provider_wfs_gui_a STATIC ${WFS_GUI_SRCS} ${WFS_UIS_H})
set_target_properties(provider_wfs_gui_a PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
target_include_directories(provider_wfs_gui_a PUBLIC
${CMAKE_SOURCE_DIR}/src/providers/wfs
${CMAKE_SOURCE_DIR}/src/providers/wfs/oapif
)
target_link_libraries(provider_wfs_a
qgis_gui
)
target_link_libraries(provider_wfs_gui_a
qgis_gui
)
# require c++17
target_compile_features(provider_wfs_gui_a PRIVATE cxx_std_17)
target_compile_definitions(provider_wfs_gui_a PRIVATE "-DQT_NO_FOREACH")
add_dependencies(provider_wfs_gui_a ui)
include_directories(SYSTEM
${QSCINTILLA_INCLUDE_DIR}
${CMAKE_BINARY_DIR}/src/ui
)
endif()
if (FORCE_STATIC_LIBS)
# for (external) mobile apps to be able to pick up provider for linking
install (TARGETS provider_wfs_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR})
if (WITH_GUI)
install (TARGETS provider_wfs_gui_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR})
endif()
else()
add_library(provider_wfs MODULE ${WFS_SRCS} ${WFS_GUI_SRCS})
set_target_properties(provider_wfs PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
# require c++17
target_compile_features(provider_wfs PRIVATE cxx_std_17)
# We use private headers from core that need this
target_compile_definitions(provider_wfs PRIVATE "CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"")
target_compile_definitions(provider_wfs PRIVATE "-DQT_NO_FOREACH")
target_link_libraries (provider_wfs
qgis_core
GDAL::GDAL
)
if (WITH_GUI)
target_link_libraries (provider_wfs
qgis_gui
)
add_dependencies(provider_wfs ui)
endif()
target_include_directories(provider_wfs PUBLIC
${CMAKE_SOURCE_DIR}/src/providers/wfs
${CMAKE_SOURCE_DIR}/src/providers/wfs/oapif
)
install(TARGETS provider_wfs
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
endif()