-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
CMakeLists.txt
65 lines (49 loc) · 1.64 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
ADD_DEFINITIONS(-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\")
########################################################
# Files
SET(GRASS_PROVIDER_SRCS provider.cpp)
SET(GRASS_LIB_SRCS qgsgrassprovider.cpp qgsgrass.cpp)
########################################################
# Build
INCLUDE_DIRECTORIES (
../../core
${GRASS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
)
ADD_LIBRARY (qgisgrass SHARED ${GRASS_LIB_SRCS})
SET_TARGET_PROPERTIES(qgisgrass PROPERTIES
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR})
IF (WIN32)
SET_TARGET_PROPERTIES(qgisgrass PROPERTIES COMPILE_FLAGS "\"-DGRASS_EXPORT=__declspec(dllexport)\"" )
ELSE (WIN32)
SET_TARGET_PROPERTIES(qgisgrass PROPERTIES COMPILE_FLAGS "-DGRASS_EXPORT=" )
ENDIF (WIN32)
TARGET_LINK_LIBRARIES (qgisgrass
${QT_QTCORE_LIBRARY}
${QT_QTXML_LIBRARY}
${GRASS_LIBRARIES}
qgis_core
)
ADD_LIBRARY (grassprovider MODULE ${GRASS_PROVIDER_SRCS})
IF (WIN32)
SET_TARGET_PROPERTIES(grassprovider PROPERTIES COMPILE_FLAGS "\"-DGRASS_EXPORT=__declspec(dllimport)\"" )
ELSE (WIN32)
SET_TARGET_PROPERTIES(grassprovider PROPERTIES COMPILE_FLAGS "-DGRASS_EXPORT=" )
ENDIF (WIN32)
TARGET_LINK_LIBRARIES (grassprovider
${QT_QTCORE_LIBRARY}
${QT_QTXML_LIBRARY}
qgis_core
qgisgrass
)
########################################################
# Install
INSTALL(TARGETS qgisgrass
RUNTIME DESTINATION ${QGIS_BIN_DIR}
LIBRARY DESTINATION ${QGIS_LIB_DIR})
INSTALL(TARGETS grassprovider
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})