-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
77 lines (58 loc) · 1.77 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
IF(DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ELSE()
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ENDIF()
PROJECT(karazeh)
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX ${EXECUTABLE_OUTPUT_PATH} CACHE PATH "Karazeh install prefix" FORCE)
ENDIF()
INCLUDE(CheckIncludeFileCXX)
INCLUDE(CMakeDependentOption)
SET(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/cmake/modules
${CMAKE_SOURCE_DIR}/deps/librsync-2.0.0/cmake
${CMAKE_MODULE_PATH}
)
SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}")
SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}")
SET(Boost_USE_MULTITHREAD ON)
IF(WIN32)
ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS")
ADD_DEFINITIONS("-DCURL_STATICLIB")
ENDIF()
IF(UNIX)
ADD_DEFINITIONS("-DENABLE_BINRELOC")
ENDIF()
IF(APPLE)
SET(CMAKE_MACOSX_RPATH 1)
ENDIF()
# Options
OPTION(KARAZEH_BUILD_TESTS OFF "Build the tests")
OPTION(KARAZEH_BUILD_EXAMPLES OFF "Build the examples")
FIND_PACKAGE(Boost 1.49 COMPONENTS filesystem system REQUIRED)
FIND_PACKAGE(CURL REQUIRED)
INCLUDE_DIRECTORIES(
${Boost_INCLUDE_DIRS}
${CURL_INCLUDE_DIRS}
)
LINK_DIRECTORIES(
${BOOST_LIBRARY_DIRS}
# on windows it's like this...
${Boost_LIBRARY_DIRS}
${CURL_LIBRARY_DIRS}
)
LINK_LIBRARIES(
${Boost_LIBRARIES}
${CURL_LIBRARIES}
)
ADD_SUBDIRECTORY(deps/librsync-2.0.0)
ADD_SUBDIRECTORY(src)
IF (KARAZEH_BUILD_TESTS)
ADD_SUBDIRECTORY(test)
ENDIF()
IF (KARAZEH_BUILD_EXAMPLES)
ADD_SUBDIRECTORY(examples)
ENDIF()