-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
90 lines (77 loc) · 3.22 KB
/
CMakeLists.txt
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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(SEGS)
IF(CMAKE_CXX_COMPILER MATCHES cl.exe)
add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
ELSE()
SET(CMAKE_CXX_FLAGS "-Wall -std=c++11" )
endif()
add_definitions(-D__STDC_FORMAT_MACROS)
SET(MAIN_INCLUDE_PATH ${PROJECT_SOURCE_DIR}/3rd_party/include CACHE PATH "Includes")
SET(MAIN_LIB_PATH ${PROJECT_SOURCE_DIR}/3rd_party/lib CACHE PATH "Libraries")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/out)
SET(CMAKE_INCLUDE_PATH ${MAIN_INCLUDE_PATH})
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeScripts;${CMAKE_MODULE_PATH})
SET(UNICODE TRUE)
OPTION(ENABLE_SCRIPTING_ENGINE "Build experimental scripting engine ?" OFF)
OPTION(ENABLE_TESTS "Enable testing unit and functional tests" OFF)
SET(PostgreSQL_ADDITIONAL_VERSIONS "9.2")
########################################################################################
# Prerequisites
########################################################################################
include(ExternalProject)
ExternalProject_Add(
ACE_BUILD
SOURCE_DIR ${PROJECT_SOURCE_DIR}/3rd_party/naked_ace
UPDATE_COMMAND ""
INSTALL_DIR ${PROJECT_SOURCE_DIR}/3rd_party/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
)
SET(ACE_path ${PROJECT_SOURCE_DIR}/3rd_party)
SET(ACE_LIBRARIES ACE)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
find_package(PostgreSQL REQUIRED) # PostgreSQL
########################################################################################
# Optional components
########################################################################################
if(ENABLE_SCRIPTING_ENGINE)
ADD_DEFINITIONS(-DSCRIPTING_ENABLED=1)
FIND_PACKAGE(Ruby REQUIRED)
ExternalProject_Add(
MRUBY_BUILD
DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/3rd_party/mruby
GIT_REPOSITORY git://github.com/mruby/mruby.git
GIT_TAG master # will have to set it to a specific git-hash in the future.
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
SOURCE_DIR ${PROJECT_SOURCE_DIR}/3rd_party/mruby
BUILD_COMMAND ${RUBY_EXECUTABLE} ./minirake
BUILD_IN_SOURCE 1
INSTALL_COMMAND ""
INSTALL_DIR ${PROJECT_SOURCE_DIR}/3rd_party/
)
SET(MRuby_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/3rd_party/mruby/include)
LINK_DIRECTORIES(${PROJECT_SOURCE_DIR}/3rd_party/mruby/build/host/lib)
SET(MRuby_LIBRARIES mruby)
endif()
if(ENABLE_TESTS)
enable_testing()
ExternalProject_Add(
GMOCK_BUILD
DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/3rd_party/gmock
URL http://googlemock.googlecode.com/files/gmock-1.6.0.zip
UPDATE_COMMAND ""
PATCH_COMMAND patch -N -t -p1 < ../gmock.patch
SOURCE_DIR ${PROJECT_SOURCE_DIR}/3rd_party/gmock
INSTALL_DIR ${PROJECT_SOURCE_DIR}/3rd_party/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
)
set(GTest_LIBRARIES gtest gtest_main ${CMAKE_THREAD_LIBS_INIT})
endif()
link_directories(${PROJECT_SOURCE_DIR}/3rd_party/lib)
include_directories(${PROJECT_SOURCE_DIR}/3rd_party/include)
include_directories(${PROJECT_SOURCE_DIR}/include)
include(SEGS_Components)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/include)
add_subdirectory(Components)
add_subdirectory(Projects)