-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathCMakeLists.txt
52 lines (39 loc) · 1.49 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
SC_BEGIN_PACKAGE(COMMON)
OPTION(SC_TRUNK_DB_MYSQL "Add MYSQL support" ON)
OPTION(SC_TRUNK_DB_SQLITE3 "Add SQLite3 support" OFF)
OPTION(SC_TRUNK_DB_POSTGRESQL "Add PostgreSQL support" OFF)
SET(PROJECT_TEST_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/test/data)
IF(CMAKE_COMPILER_IS_GNUCC)
IF(GCC_VERSION VERSION_LESS "4.7")
MESSAGE(FATAL_ERROR "GCC version ${GCC_VERSION} found but 4.7 required as minimum")
ENDIF()
ENDIF()
#SET(Boost_DEBUG ON)
# Static Boost libs are not compiled with -fPIC on some
# systems so linking into a 64bit shared library does not work.
# Disabled it so far.
#SET(Boost_USE_STATIC_LIBS ON)
SET(Boost_DETAILED_FAILURE_MSG ON)
FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options thread filesystem iostreams regex)
IF (WIN32)
ADD_DEFINITIONS("-DBOOST_ALL_NO_LIB")
ADD_DEFINITIONS("-DBOOST_LIB_DIAGNOSTIC")
ENDIF (WIN32)
FIND_PACKAGE(OpenSSL REQUIRED)
IF (SC_TRUNK_DB_MYSQL)
FIND_PACKAGE(MySQL REQUIRED)
ENDIF (SC_TRUNK_DB_MYSQL)
IF (SC_TRUNK_DB_SQLITE3)
FIND_PACKAGE(SQLite3 REQUIRED)
ENDIF (SC_TRUNK_DB_SQLITE3)
IF (SC_TRUNK_DB_POSTGRESQL)
FIND_PACKAGE(PostgreSQL REQUIRED)
ENDIF (SC_TRUNK_DB_POSTGRESQL)
SET(THIRD_PARTY_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libs/3rd-party)
INCLUDE_DIRECTORIES(${THIRD_PARTY_DIRECTORY})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libs)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/libs)
SUBDIRS(apps libs plugins)