-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
CMakeLists.txt
104 lines (81 loc) · 2.89 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
########################################################
# Files
SET (HELP_SRCS
main.cpp
qgshelpserver.cpp
qgshelpviewer.cpp
#../core/qgsapplication.cpp
#../core/qgslogger.cpp
)
SET (HELP_UIS qgshelpviewerbase.ui)
SET (HELP_MOC_HDRS
qgshelpserver.h
qgshelpviewer.h
)
#SET (HELP_RCCS qgsgps_plugin.qrc)
IF (WIN32)
IF (MSVC)
SET (HELP_SRCS ${HELP_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/../app/qgis_win32.rc)
ELSE(MSVC)
# Icon for windows MINGW
# Note: can't include .rc directly to source files
# as it's ignored when used MinGW
IF (NOT WINDRES)
FIND_PROGRAM(WINDRES windres)
IF (NOT WINDRES)
MESSAGE(FATAL_ERROR "windres not found - aborting")
ENDIF (NOT WINDRES)
ENDIF (NOT WINDRES)
#############################################################
# application icon
# resource compilation for MinGW
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
COMMAND ${WINDRES} -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/../app/qgis_win32.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/icon.o )
SET(QGIS_APP_SRCS ${QGIS_APP_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
ENDIF (MSVC)
ENDIF (WIN32)
########################################################
# Build
QT4_WRAP_UI (HELP_UIS_H ${HELP_UIS})
QT4_WRAP_CPP (HELP_MOC_SRCS ${HELP_MOC_HDRS})
#QT4_ADD_RESOURCES(HELP_RCC_SRCS ${HELP_RCCS})
ADD_EXECUTABLE (qgis_help MACOSX_BUNDLE ${HELP_SRCS} ${HELP_MOC_SRCS} ${HELP_UIS_H})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../core
${CMAKE_CURRENT_BINARY_DIR}
)
IF (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(../core/spatialite/headers/spatialite)
ELSE (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ENDIF (WITH_INTERNAL_SPATIALITE)
TARGET_LINK_LIBRARIES(qgis_help qgis_core)
IF (NOT WITH_INTERNAL_SPATIALITE)
TARGET_LINK_LIBRARIES(qgis_help ${SQLITE3_LIBRARY})
ENDIF (NOT WITH_INTERNAL_SPATIALITE)
IF (${QTVERSION} STRLESS "4.3.0")
TARGET_LINK_LIBRARIES(qgis_help
${QT_LIBRARIES}
)
ELSE (${QTVERSION} STRLESS "4.3.0")
TARGET_LINK_LIBRARIES(qgis_help
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
)
ENDIF (${QTVERSION} STRLESS "4.3.0")
SET_TARGET_PROPERTIES(qgis_help PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${QGIS_LIB_DIR}
INSTALL_RPATH_USE_LINK_PATH true
)
########################################################
# Install
IF (APPLE AND NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS "2.6")
INSTALL (TARGETS qgis_help BUNDLE DESTINATION ${QGIS_BIN_DIR})
ELSE (APPLE AND NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS "2.6")
INSTALL (TARGETS qgis_help RUNTIME DESTINATION ${QGIS_BIN_DIR})
ENDIF (APPLE AND NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS "2.6")