CMakeLists.txt
3.69 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
cmake_minimum_required(VERSION 2.6)
PROJECT(DDServer)
add_definitions( -DLINUX )
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/bin/)
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/lib/)
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
#64 bits
MESSAGE( STATUS "64 bits" )
set(CMAKE_C_FLAGS_DEBUG "-ggdb -DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread")
set(CMAKE_C_FLAGS_RELEASE "-DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread")
set(USRLIB_DIR "/usr/lib64/:/usr/local/lib64/")
else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
#32 bits
MESSAGE( STATUS "32 bits" )
set(CMAKE_C_FLAGS_DEBUG "-ggdb -DLINUX -march=i686 -fPIC -Dlinux -D_REENTRANT -malign-double -pthread")
set(CMAKE_C_FLAGS_DEBUG "-DLINUX -march=i686 -fPIC -Dlinux -D_REENTRANT -malign-double -pthread")
set(USRLIB_DIR "/usr/lib/:/usr/local/lib/")
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set (USERLOCAL_ROOT "/usr/local/lib/")
if (EXISTS "$ENV{USERLOCAL_ROOT}")
set(USERLOCAL_ROOT "$ENV{USERLOCAL_ROOT}")
message("USERLOCAL_ROOT forced to ${USERLOCAL_ROOT}")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
find_package( Threads REQUIRED )
find_package( CRYPT REQUIRED )
find_package( NetCDF REQUIRED )
find_package( DDClient REQUIRED )
find_package( CDF REQUIRED )
find_package( LibXML2 REQUIRED )
get_filename_component(NETCDFLIB_DIR ${NETCDFLIBRARIES} PATH)
get_filename_component(DDCLIENTLIB_DIR ${DDCLIENTLIBRARIES} PATH)
set(DDSERVICE_URL $ENV{DDSERVICE_URL})
set(DDRESPATH $ENV{DDRESPATH})
set(DDBASEDATA "$ENV{DDBASEPATH}/DATA")
set(DDBASEINFO "$ENV{DDBASEPATH}/INFO")
set(PROXY_HOST $ENV{PROXY_HOST})
set(PROXY_USERPWD $ENV{PROXY_USERPWD})
configure_file (
"${CMAKE_SOURCE_DIR}/scripts/DDServer.env.in"
"${CMAKE_SOURCE_DIR}/scripts/DDServer.env"
)
configure_file (
"${CMAKE_SOURCE_DIR}/src/DDSERVICES/SOAP/DDserverWeb_ini.php.in"
"${CMAKE_SOURCE_DIR}/src/DDSERVICES/SOAP/DDserverWeb_ini.php"
)
configure_file (
"${CMAKE_SOURCE_DIR}/src/DDSERVICES/SOAP/dd.wsdl.in"
"${CMAKE_SOURCE_DIR}/src/DDSERVICES/SOAP/dd.wsdl"
)
MESSAGE( STATUS "Build DD_Server Project" )
add_subdirectory(src/SERVER)
add_subdirectory(src/DECODERS/ascii2nc)
add_subdirectory(src/DECODERS/cdf2nc)
add_subdirectory(src/DECODERS/cdfnew2nc)
add_subdirectory(src/DECODERS/nc2nc)
add_subdirectory(src/DECODERS/themis)
add_subdirectory(src/DATA/TOOLS)
add_subdirectory(src/DDSERVICES/TOOLS)
add_subdirectory(src/DDADMIN/TOOLS)
add_subdirectory(tests)
install(FILES "scripts/StartServer" DESTINATION . PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES "scripts/DDServer.env" DESTINATION . PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
file(GLOB scripts "scripts/*.sh")
install(FILES ${scripts} DESTINATION . PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY "src/CALLEXT/" DESTINATION bin/CALLEXT)
install(DIRECTORY "src/DATA/MANAGER/" DESTINATION bin/DATAMANAGER)
install(DIRECTORY "src/DATA/TEMPLATES/" DESTINATION bin)
install(DIRECTORY "src/REMOTEDATA/" DESTINATION bin/REMOTEDATA)
install(DIRECTORY "src/DDADMIN/MANAGER/" DESTINATION bin/USERMANAGER)
install(DIRECTORY "src/DDSERVICES/SOAP/" DESTINATION DDService)
install(DIRECTORY "src/DDSERVICES/REST/" DESTINATION DDService)
install(FILES "src/DECODERS/cdf2nc/cdf_to_netcdf_mapping.dat" DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
file(GLOB config_files "info/REMOTEDATA/*.xml")
install(FILES ${config_files} DESTINATION ${DDBASEINFO} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
SET(CMAKE_VERBOSE_MAKEFILE ON)