CMakeLists.txt 1.33 KB
cmake_minimum_required(VERSION 2.6)

PROJECT(DDServer)

configure_file (
 "${CMAKE_SOURCE_DIR}/scripts/StartServer.in"
 "${CMAKE_SOURCE_DIR}/scripts/StartServer"
)

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
  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")
else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
  #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")
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")

find_package( Threads REQUIRED )
find_package( CRYPT REQUIRED )
find_package( NetCDF REQUIRED )

MESSAGE( STATUS "Build DDServer Project" )
add_subdirectory(src/CLIENT)
add_subdirectory(src/SERVER)

install(FILES "scripts/StartServer" DESTINATION . PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(DIRECTORY "src/INCLUDE/" DESTINATION include)

SET(CMAKE_VERBOSE_MAKEFILE ON)