CMakeLists.txt
7.65 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
cmake_minimum_required(VERSION 2.6)
if (DEFINED ENV{TREPS_INSTALL_DIR})
message("TREPS_INSTALL_DIR is defined")
else()
message( FATAL_ERROR "TREPS_INSTALL_DIR is NOT defined" )
endif()
SET(TREPS_KERNEL_VALIDATION false)
if (DEFINED ENV{TREPS_VALIDATION})
if ("$ENV{TREPS_VALIDATION}" STREQUAL 1)
message("Use TREPS Kernel Validation !")
SET(TREPS_KERNEL_VALIDATION true)
endif()
endif()
SET(TREPS_VERSION_MAJOR "1")
SET(TREPS_VERSION_MINOR "8")
SET(TREPS_VERSION_PATCH "0")
SET(TREPS_SONAR_PORT "8090")
SET(TREPS_MYSQL_PORT "3306")
SET(TREPS_FITNESSE_PORT "8081")
SET(TREPS_3DVIEW_BASEDIR "http://3dview.cdpp.eu")
SET(TREPS_3DVIEW_WSDL "${TREPS_3DVIEW_BASEDIR}/CdppServices?wsdl")
SET(TREPS_INSTALL_DIR "$ENV{TREPS_INSTALL_DIR}")
SET(TREPS_COTS_INSTALL_DIR "${TREPS_INSTALL_DIR}/bin/COTS")
SET(TREPS_GSOAP_INSTALL_DIR "${TREPS_COTS_INSTALL_DIR}/gsoap")
SET(TREPS_LOG4CXX_INSTALL_DIR "${TREPS_COTS_INSTALL_DIR}/log4cxx")
SET(TREPS_CPPUNIT_INSTALL_DIR "${TREPS_COTS_INSTALL_DIR}/cppunit")
SET(TREPS_FILE_INSTALL_DIR "${TREPS_COTS_INSTALL_DIR}/file")
SET(TREPS_NETCDF_INSTALL_DIR "${TREPS_COTS_INSTALL_DIR}/netcdf")
SET(TREPS_CDF_INSTALL_DIR "${TREPS_COTS_INSTALL_DIR}/cdf")
SET(TREPS_FITNESSE_INSTALL_DIR "${TREPS_COTS_INSTALL_DIR}/fitnesse")
SET(TREPS_SONAR_INSTALL_DIR "${TREPS_COTS_INSTALL_DIR}/sonar")
SET(TREPS_SONARRUNNER_INSTALL_DIR "${TREPS_COTS_INSTALL_DIR}/sonar-runner")
SET(TREPS_CPPCHECK_INSTALL_DIR "${TREPS_COTS_INSTALL_DIR}/cppcheck")
SET(TREPS_KERNEL_SRC "${CMAKE_SOURCE_DIR}")
SET(TREPS_CMAKE_MODULES "${CMAKE_SOURCE_DIR}/cmake/modules/")
project(TREPS-KERNEL)
execute_process(
COMMAND ${TREPS_KERNEL_SRC}/scripts/generate3DViewSOAPClient.sh ${TREPS_GSOAP_INSTALL_DIR} ${TREPS_3DVIEW_WSDL} RESULT_VARIABLE ret_var
)
if (NOT "${ret_var}" STREQUAL 0)
message( FATAL_ERROR "Unable to generate code for 3DView SOAP client!")
endif()
configure_file (
"src/Common/TREPS_kernel_config.h.in"
"src/Common/TREPS_kernel_config.h"
@ONLY
)
configure_file (
"scripts/framesUpdateList.sh.in"
"scripts/framesUpdateList.sh"
)
configure_file (
"test/Fitnesse/CSlimServer/CMakeLists.txt.in"
"test/Fitnesse/CSlimServer/CMakeLists.txt"
@ONLY
)
configure_file (
"test/Fitnesse/FitNesseRoot/SuiteTests/content.txt.in"
"test/Fitnesse/FitNesseRoot/SuiteTests/content.txt"
@ONLY
)
configure_file (
"test/Fitnesse/scripts/fitnesse_start_server.sh.in"
"test/Fitnesse/scripts/fitnesse_start_server.sh"
@ONLY
)
configure_file (
"test/Fitnesse/scripts/fitnesse_run_suite.sh.in"
"test/Fitnesse/scripts/fitnesse_run_suite.sh"
@ONLY
)
configure_file (
"test/Fitnesse/requests/request_newop_votable.xml.in"
"test/Fitnesse/requests/request_newop_votable.xml"
@ONLY
)
configure_file (
"test/Fitnesse/requests/request_newop_ascii_1.xml.in"
"test/Fitnesse/requests/request_newop_ascii_1.xml"
@ONLY
)
configure_file (
"test/Fitnesse/requests/request_newop_ascii_2.xml.in"
"test/Fitnesse/requests/request_newop_ascii_2.xml"
@ONLY
)
configure_file (
"test/Fitnesse/requests/request_newop_ascii_nan.xml.in"
"test/Fitnesse/requests/request_newop_ascii_nan.xml"
@ONLY
)
configure_file (
"test/Fitnesse/requests/request_newop_cdf.xml.in"
"test/Fitnesse/requests/request_newop_cdf.xml"
@ONLY
)
configure_file (
"test/Fitnesse/requests/request_newop_netcdf.xml.in"
"test/Fitnesse/requests/request_newop_netcdf.xml"
@ONLY
)
configure_file (
"test/Sonar/scripts/sonar_start_server.sh.in"
"test/Sonar/scripts/sonar_start_server.sh"
@ONLY
)
configure_file (
"test/Sonar/scripts/sonar_stop_server.sh.in"
"test/Sonar/scripts/sonar_stop_server.sh"
@ONLY
)
configure_file (
"test/Sonar/scripts/sonar_create_report.sh.in"
"test/Sonar/scripts/sonar_create_report.sh"
@ONLY
)
configure_file (
"test/Sonar/conf/sonar-runner.properties.in"
"test/Sonar/conf/sonar-runner.properties"
@ONLY
)
configure_file (
"test/Sonar/conf/sonar.properties.in"
"test/Sonar/conf/sonar.properties"
@ONLY
)
configure_file (
"test/Sonar/conf/sonar-project.properties.in"
"test/Sonar/conf/sonar-project.properties"
@ONLY
)
set(EXECUTABLE_OUTPUT_PATH bin/${CMAKE_BUILD_TYPE})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${TREPS_CMAKE_MODULES})
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -fPIC -ggdb -DLINUX -Dlinux -D_REENTRANT -malign-double -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -fPIC -DLINUX -Dlinux -D_REENTRANT -malign-double -O3 -DNDEBUG")
find_package(LibXML2 REQUIRED)
include_directories(
${TREPS_LOG4CXX_INSTALL_DIR}/include
${TREPS_CPPUNIT_INSTALL_DIR}/include
${TREPS_FILE_INSTALL_DIR}/include
${LIBXML2_INCLUDE_DIR}
${TREPS_GSOAP_INSTALL_DIR}/include
${TREPS_NETCDF_INSTALL_DIR}/include
${TREPS_CDF_INSTALL_DIR}/include
)
link_directories(
${TREPS_LOG4CXX_INSTALL_DIR}/lib
${TREPS_CPPUNIT_INSTALL_DIR}/lib
${TREPS_FILE_INSTALL_DIR}/lib
${LIBXML2_LIBRARIES}
${TREPS_GSOAP_INSTALL_DIR}/lib
${TREPS_NETCDF_INSTALL_DIR}/lib
${TREPS_CDF_INSTALL_DIR}/lib
)
file(
GLOB_RECURSE
source_files
src/*
CDPP3DViewSOAPClient/*
)
add_executable(
treps_kernel
${source_files}
)
target_link_libraries(
treps_kernel
log4cxx
cppunit
xml2
magic
gsoap++
netcdf
cdf
)
install(TARGETS treps_kernel DESTINATION ${TREPS_INSTALL_DIR}/bin/kernel/)
install(DIRECTORY config DESTINATION ${TREPS_INSTALL_DIR}/bin/kernel/
DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY xsd DESTINATION ${TREPS_INSTALL_DIR}/bin/kernel/
DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY data DESTINATION ${TREPS_INSTALL_DIR}/bin/kernel/
DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(PROGRAMS scripts/framesUpdateList.sh DESTINATION ${TREPS_INSTALL_DIR}/bin/kernel/scripts)
if (TREPS_KERNEL_VALIDATION)
install(DIRECTORY test/Fitnesse/FitNesseRoot DESTINATION ${TREPS_INSTALL_DIR}/test/Fitnesse/
DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(PROGRAMS test/Fitnesse/scripts/fitnesse_start_server.sh DESTINATION ${TREPS_INSTALL_DIR}/test/Fitnesse/scripts)
install(PROGRAMS test/Fitnesse/scripts/fitnesse_run_suite.sh DESTINATION ${TREPS_INSTALL_DIR}/test/Fitnesse/scripts)
install(DIRECTORY test/Fitnesse/requests DESTINATION ${TREPS_INSTALL_DIR}/test/Fitnesse/
DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(PROGRAMS test/Sonar/scripts/sonar_start_server.sh DESTINATION ${TREPS_INSTALL_DIR}/test/Sonar/scripts)
install(PROGRAMS test/Sonar/scripts/sonar_stop_server.sh DESTINATION ${TREPS_INSTALL_DIR}/test/Sonar/scripts)
install(PROGRAMS test/Sonar/scripts/sonar_create_report.sh DESTINATION ${TREPS_INSTALL_DIR}/test/Sonar/scripts)
install(DIRECTORY test/Sonar/mysql DESTINATION ${TREPS_INSTALL_DIR}/test/Sonar/
DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES test/Sonar/conf/sonar-runner.properties DESTINATION ${TREPS_SONARRUNNER_INSTALL_DIR}/conf/)
install(FILES test/Sonar/conf/sonar.properties DESTINATION ${TREPS_SONAR_INSTALL_DIR}/conf/)
endif()