WSL/SLF GitLab Repository

CMakeLists.txt 6.77 KB
Newer Older
1
INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}/")
2
3

if(COMMAND cmake_policy)
4
	cmake_policy(SET CMP0003 NEW)
5
6
endif(COMMAND cmake_policy)

7
set(LIBPREFIX "lib") #make sure ALL plugins are libXXX for ALL plateforms
8
set(CMAKE_IMPORT_LIBRARY_PREFIX "lib") #for Visual C++ import libraries
9
set(PLUGIN_DIR ${PROJECT_SOURCE_DIR}/lib/plugins)
10

11
IF(DEST MATCHES "par")
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
	SET(CMAKE_CXX_OUTPUT_EXTENSION "popc.o")
	SET(ARCIONAME arciopopc)
	SET(ARPSIONAME arpsiopopc)
	SET(PGMIONAME pgmiopopc)
	SET(SMETIONAME smetiopopc)
	SET(GRASSIONAME grassiopopc)
	SET(GEOTOPIONAME geotopiopopc)
	SET(SNIONAME sniopopc)
	SET(GSNIONAME gsniopopc)
	SET(IMISIONAME imisiopopc)
	SET(BORMAIONAME bormaiopopc)
	SET(COSMOXMLIONAME cosmoxmliopopc)

	INCLUDE(CMakeForceCompiler)
	CMAKE_FORCE_C_COMPILER(popcc POPCC)
	CMAKE_FORCE_CXX_COMPILER(popcc POPCC)
	SET(SHAREDNAME ${PROJECT_NAME}popc)
29
ELSE(DEST)
30
31
32
33
34
35
36
37
38
39
40
41
	SET(GRASSIONAME grassio)
	SET(ARCIONAME arcio)
	SET(ARPSIONAME arpsio)
	SET(PGMIONAME pgmio)
	SET(SMETIONAME smetio)
	SET(GEOTOPIONAME geotopio)
	SET(SNIONAME snio)
	SET(GSNIONAME gsnio)
	SET(IMISIONAME imisio)
	SET(BORMAIONAME bormaio)
	SET(COSMOXMLIONAME cosmoxmlio)
	SET(SHAREDNAME ${PROJECT_NAME})
42
ENDIF(DEST MATCHES "par")
43

44
#LINK_DIRECTORIES(lib)
45

46
IF(PLUGIN_SMETIO)
47
48
49
50
51
52
53
54
55
	ADD_LIBRARY(${SMETIONAME} SMETIO.cc)
	TARGET_LINK_LIBRARIES(${SMETIONAME} ${SHAREDNAME})
	SET_TARGET_PROPERTIES(${SMETIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	SET(MYPLUGINS ${MYPLUGINS} ${SMETIONAME})
56
ENDIF(PLUGIN_SMETIO)
57

58
IF(PLUGIN_ARCIO)
59
60
61
62
63
64
65
66
67
	ADD_LIBRARY(${ARCIONAME} ARCIO.cc)
	TARGET_LINK_LIBRARIES(${ARCIONAME} ${SHAREDNAME})
	SET_TARGET_PROPERTIES(${ARCIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	SET(MYPLUGINS ${MYPLUGINS} ${ARCIONAME})
68
ENDIF(PLUGIN_ARCIO)
69

70
IF(PLUGIN_PGMIO)
71
72
73
74
75
76
77
78
79
	ADD_LIBRARY(${PGMIONAME} PGMIO.cc)
	TARGET_LINK_LIBRARIES(${PGMIONAME} ${SHAREDNAME})
	SET_TARGET_PROPERTIES(${PGMIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	SET(MYPLUGINS ${MYPLUGINS} ${PGMIONAME})
80
ENDIF(PLUGIN_PGMIO)
81

82
IF(PLUGIN_ARPSIO)
83
84
85
86
87
88
89
90
91
	ADD_LIBRARY(${ARPSIONAME} ARPSIO.cc)
	TARGET_LINK_LIBRARIES(${ARPSIONAME} ${SHAREDNAME})
	SET_TARGET_PROPERTIES(${ARPSIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	SET(MYPLUGINS ${MYPLUGINS} ${ARPSIONAME})
92
ENDIF(PLUGIN_ARPSIO)
93

94
IF(PLUGIN_GRASSIO)
95
96
97
98
99
100
101
102
103
	ADD_LIBRARY(${GRASSIONAME} GrassIO.cc)
	TARGET_LINK_LIBRARIES(${GRASSIONAME} ${SHAREDNAME})
	SET_TARGET_PROPERTIES(${GRASSIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	SET(MYPLUGINS ${MYPLUGINS} ${GRASSIONAME})
104
ENDIF(PLUGIN_GRASSIO)
105

106
IF(PLUGIN_GEOTOPIO)
107
108
109
110
111
112
113
114
115
	ADD_LIBRARY(${GEOTOPIONAME} GeotopIO.cc)
	TARGET_LINK_LIBRARIES(${GEOTOPIONAME} ${SHAREDNAME})
	SET_TARGET_PROPERTIES(${GEOTOPIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	SET(MYPLUGINS ${MYPLUGINS} ${GEOTOPIONAME})
116
ENDIF(PLUGIN_GEOTOPIO)
117

118
IF(PLUGIN_SNIO)
119
120
121
122
123
124
125
126
127
	ADD_LIBRARY(${SNIONAME} SNIO.cc)
	TARGET_LINK_LIBRARIES(${SNIONAME} ${SHAREDNAME})
	SET_TARGET_PROPERTIES(${SNIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	SET(MYPLUGINS ${MYPLUGINS} ${SNIONAME})
128
ENDIF(PLUGIN_SNIO)
129

130
IF(PLUGIN_GSNIO)
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
	INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} "/usr/include")
	#gsoap generates files that do lots of warnings, there is nothing we can do about it -> off
	SET_SOURCE_FILES_PROPERTIES(gsn/soapC.cpp PROPERTIES COMPILE_FLAGS "-w")
	SET_SOURCE_FILES_PROPERTIES(gsn/soapC.cpp PROPERTIES GENERATED TRUE)
	SET_SOURCE_FILES_PROPERTIES(gsn/soapA3DWebServiceSoap12BindingProxy.cpp PROPERTIES GENERATED TRUE)
	ADD_LIBRARY(${GSNIONAME} GSNIO.cc gsn/soapA3DWebServiceSoap12BindingProxy.cpp gsn/soapC.cpp)
	TARGET_LINK_LIBRARIES(${GSNIONAME} ${GSOAPPP} ${SHAREDNAME})
	ADD_DEPENDENCIES(${GSNIONAME} wsdl2cpp gsnclient)
	SET_TARGET_PROPERTIES(${GSNIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	#necessary because gsoap uses long long
	SET_TARGET_PROPERTIES(${GSNIONAME} PROPERTIES COMPILE_FLAGS "-Wno-long-long")
	SET(MYPLUGINS ${MYPLUGINS} ${GSNIONAME})
148
ENDIF(PLUGIN_GSNIO)
149

150
IF(PLUGIN_IMISIO)
151
152
153
154
155
156
157
158
159
160
161
	FIND_PACKAGE(OCCI)
	INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${OCCI_INCLUDE_DIR})
	ADD_LIBRARY(${IMISIONAME} ImisIO.cc)
	TARGET_LINK_LIBRARIES(${IMISIONAME} ${OCCI_LIBRARIES} ${SHAREDNAME})
	SET_TARGET_PROPERTIES(${IMISIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	SET(MYPLUGINS ${MYPLUGINS} ${IMISIONAME})
162
ENDIF(PLUGIN_IMISIO)
163

164
IF(PLUGIN_BORMAIO)
165
166
167
168
169
170
171
172
173
174
175
	FIND_PACKAGE(LibXML++ REQUIRED)
	INCLUDE_DIRECTORIES(${LibXML++_INCLUDE_DIRS})
	ADD_LIBRARY(${BORMAIONAME} BormaIO.cc)
	TARGET_LINK_LIBRARIES(${BORMAIONAME} ${LibXML++_LIBRARIES} ${SHAREDNAME})
	SET_TARGET_PROPERTIES(${BORMAIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	SET(MYPLUGINS ${MYPLUGINS} ${BORMAIONAME})
176
ENDIF(PLUGIN_BORMAIO)
177

178
IF(PLUGIN_COSMOXMLIO)
179
180
181
182
183
184
185
186
187
188
189
	FIND_PACKAGE(LibXML++ REQUIRED)
	INCLUDE_DIRECTORIES(${LibXML++_INCLUDE_DIRS})
	ADD_LIBRARY(${COSMOXMLIONAME} CosmoXMLIO.cc)
	TARGET_LINK_LIBRARIES(${COSMOXMLIONAME} ${LibXML++_LIBRARIES} ${SHAREDNAME})
	SET_TARGET_PROPERTIES(${COSMOXMLIONAME} PROPERTIES
		PREFIX "${LIBPREFIX}"
		LIBRARY_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		RUNTIME_OUTPUT_DIRECTORY ${PLUGIN_DIR}
		VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
		SOVERSION ${VERSION_MAJOR})
	SET(MYPLUGINS ${MYPLUGINS} ${COSMOXMLIONAME})
190
191
ENDIF(PLUGIN_COSMOXMLIO)

192
INSTALL(TARGETS ${MYPLUGINS}
193
194
195
196
	RUNTIME DESTINATION bin
	LIBRARY DESTINATION lib/meteoio/plugins
	ARCHIVE DESTINATION lib/meteoio/plugins
	COMPONENT plugins
197
)