Commit 3c7c7fa73aca1979dfad64354578d2c01ad9cf3e
1 parent
4243d674
Exists in
master
and in
10 other branches
Set library path in StartServer script + Fix error with the executable name
Showing
4 changed files
with
20 additions
and
16 deletions
Show diff stats
CMakeLists.txt
@@ -2,11 +2,6 @@ cmake_minimum_required(VERSION 2.6) | @@ -2,11 +2,6 @@ cmake_minimum_required(VERSION 2.6) | ||
2 | 2 | ||
3 | PROJECT(DDServer) | 3 | PROJECT(DDServer) |
4 | 4 | ||
5 | -configure_file ( | ||
6 | - "${CMAKE_SOURCE_DIR}/scripts/StartServer.in" | ||
7 | - "${CMAKE_SOURCE_DIR}/scripts/StartServer" | ||
8 | -) | ||
9 | - | ||
10 | set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/bin/) | 5 | set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/bin/) |
11 | set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/lib/) | 6 | set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/lib/) |
12 | 7 | ||
@@ -14,10 +9,12 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) | @@ -14,10 +9,12 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) | ||
14 | #64 bits | 9 | #64 bits |
15 | set(CMAKE_C_FLAGS_DEBUG "-ggdb -DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread") | 10 | set(CMAKE_C_FLAGS_DEBUG "-ggdb -DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread") |
16 | set(CMAKE_C_FLAGS_RELEASE "-DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread") | 11 | set(CMAKE_C_FLAGS_RELEASE "-DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread") |
12 | + set(USRLIB_DIR "/usr/lib64/:/usr/local/lib64/") | ||
17 | else( CMAKE_SIZEOF_VOID_P EQUAL 8 ) | 13 | else( CMAKE_SIZEOF_VOID_P EQUAL 8 ) |
18 | #32 bits | 14 | #32 bits |
19 | set(CMAKE_C_FLAGS_DEBUG "-ggdb -DLINUX -march=i686 -fPIC -Dlinux -D_REENTRANT -malign-double -pthread") | 15 | set(CMAKE_C_FLAGS_DEBUG "-ggdb -DLINUX -march=i686 -fPIC -Dlinux -D_REENTRANT -malign-double -pthread") |
20 | set(CMAKE_C_FLAGS_DEBUG "-DLINUX -march=i686 -fPIC -Dlinux -D_REENTRANT -malign-double -pthread") | 16 | set(CMAKE_C_FLAGS_DEBUG "-DLINUX -march=i686 -fPIC -Dlinux -D_REENTRANT -malign-double -pthread") |
17 | + set(USRLIB_DIR "/usr/lib/:/usr/local/lib/") | ||
21 | endif( CMAKE_SIZEOF_VOID_P EQUAL 8 ) | 18 | endif( CMAKE_SIZEOF_VOID_P EQUAL 8 ) |
22 | 19 | ||
23 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") | 20 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") |
@@ -26,7 +23,14 @@ find_package( Threads REQUIRED ) | @@ -26,7 +23,14 @@ find_package( Threads REQUIRED ) | ||
26 | find_package( CRYPT REQUIRED ) | 23 | find_package( CRYPT REQUIRED ) |
27 | find_package( NetCDF REQUIRED ) | 24 | find_package( NetCDF REQUIRED ) |
28 | 25 | ||
29 | -MESSAGE( STATUS "Build DDServer Project" ) | 26 | +get_filename_component(NETCDFLIB_DIR ${NETCDFLIBRARIES} PATH) |
27 | + | ||
28 | +configure_file ( | ||
29 | + "${CMAKE_SOURCE_DIR}/scripts/StartServer.in" | ||
30 | + "${CMAKE_SOURCE_DIR}/scripts/StartServer" | ||
31 | +) | ||
32 | + | ||
33 | +MESSAGE( STATUS "Build DD_Server Project" ) | ||
30 | add_subdirectory(src/CLIENT) | 34 | add_subdirectory(src/CLIENT) |
31 | add_subdirectory(src/SERVER) | 35 | add_subdirectory(src/SERVER) |
32 | 36 |
scripts/StartServer.in
@@ -6,7 +6,7 @@ DDBASE=@CMAKE_INSTALL_PREFIX@/DDBASE/DATA | @@ -6,7 +6,7 @@ DDBASE=@CMAKE_INSTALL_PREFIX@/DDBASE/DATA | ||
6 | DDPATH=@CMAKE_INSTALL_PREFIX@/DDBASE | 6 | DDPATH=@CMAKE_INSTALL_PREFIX@/DDBASE |
7 | DDLIB=@CMAKE_INSTALL_PREFIX@/lib | 7 | DDLIB=@CMAKE_INSTALL_PREFIX@/lib |
8 | DDBASEBIN=@CMAKE_INSTALL_PREFIX@/bin | 8 | DDBASEBIN=@CMAKE_INSTALL_PREFIX@/bin |
9 | -LD_LIBRARY_PATH=$DDLIB/:/usr/local/lib64/ | 9 | +LD_LIBRARY_PATH=$DDLIB/:@NETCDFLIB_DIR@:@USRLIB_DIR@ |
10 | export DDBASE DDPATH DDBASEBIN DDLIB LD_LIBRARY_PATH | 10 | export DDBASE DDPATH DDBASEBIN DDLIB LD_LIBRARY_PATH |
11 | 11 | ||
12 | #$DDBASEBIN/DD_Server 1>/dev/null 2>/dev/null& | 12 | #$DDBASEBIN/DD_Server 1>/dev/null 2>/dev/null& |
src/CLIENT/CMakeLists.txt
1 | 1 | ||
2 | -PROJECT(DDClient) | 2 | +PROJECT(DD_Client) |
3 | 3 | ||
4 | include_directories( | 4 | include_directories( |
5 | ${CMAKE_HOME_DIRECTORY}/src/INCLUDE/ | 5 | ${CMAKE_HOME_DIRECTORY}/src/INCLUDE/ |
@@ -12,11 +12,11 @@ file( | @@ -12,11 +12,11 @@ file( | ||
12 | ./* | 12 | ./* |
13 | ) | 13 | ) |
14 | 14 | ||
15 | -ADD_LIBRARY( DDClient SHARED ${source_files} ) | 15 | +ADD_LIBRARY( DD_Client SHARED ${source_files} ) |
16 | 16 | ||
17 | target_link_libraries( | 17 | target_link_libraries( |
18 | - DDClient | 18 | + DD_Client |
19 | ${CMAKE_THREAD_LIBS_INIT} | 19 | ${CMAKE_THREAD_LIBS_INIT} |
20 | ) | 20 | ) |
21 | 21 | ||
22 | -install (TARGETS DDClient DESTINATION lib) | 22 | +install (TARGETS DD_Client DESTINATION lib) |
src/SERVER/CMakeLists.txt
1 | 1 | ||
2 | -PROJECT(DDServer) | 2 | +PROJECT(DD_Server) |
3 | 3 | ||
4 | include_directories( | 4 | include_directories( |
5 | ${CMAKE_HOME_DIRECTORY}/src/INCLUDE/ | 5 | ${CMAKE_HOME_DIRECTORY}/src/INCLUDE/ |
@@ -13,14 +13,14 @@ file( | @@ -13,14 +13,14 @@ file( | ||
13 | ./* | 13 | ./* |
14 | ) | 14 | ) |
15 | 15 | ||
16 | -ADD_EXECUTABLE (DDServer ${source_files} ) | 16 | +ADD_EXECUTABLE (DD_Server ${source_files} ) |
17 | 17 | ||
18 | target_link_libraries( | 18 | target_link_libraries( |
19 | - DDServer | 19 | + DD_Server |
20 | ${CMAKE_THREAD_LIBS_INIT} | 20 | ${CMAKE_THREAD_LIBS_INIT} |
21 | - DDClient | 21 | + DD_Client |
22 | ${NETCDFLIBRARY} | 22 | ${NETCDFLIBRARY} |
23 | ${CRYPT_LIBRARY} | 23 | ${CRYPT_LIBRARY} |
24 | ) | 24 | ) |
25 | 25 | ||
26 | -install (TARGETS DDServer DESTINATION bin) | 26 | +install (TARGETS DD_Server DESTINATION bin) |