forked from Corvusoft/restbed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
75 lines (58 loc) · 2.07 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
# Copyright 2013-2016, Corvusoft Ltd, All Rights Reserved.
project( "restbed" )
cmake_minimum_required( VERSION 2.8.10 )
#
# Build Options
#
option( BUILD_SHARED "Build shared library." OFF )
option( BUILD_SSL "Build Secure Socket Layer Support." ON )
option( BUILD_EXAMPLES "Build examples applications." OFF )
option( BUILD_TESTS "Build all available test suites." OFF )
#
# Configuration
#
include( "${CMAKE_SOURCE_DIR}/cmake/build_configuration.cmake" )
message( " ${Blue}Copyright 2013-2016, Corvusoft Ltd, All Rights Reserved.${Reset}" )
#
# Dependencies
#
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules" )
find_package( asio REQUIRED )
include_directories( SYSTEM ${asio_INCLUDE} )
if ( BUILD_SSL )
find_package( openssl REQUIRED )
include_directories( SYSTEM ${ssl_INCLUDE} )
endif ( )
#
# Build
#
include( "${CMAKE_SOURCE_DIR}/cmake/build_manifest.cmake" )
include_directories( ${INCLUDE_DIR} )
add_library( ${PROJECT_NAME} ${BUILD_MANIFEST} )
if ( BUILD_SSL )
target_link_libraries( ${PROJECT_NAME} LINK_PRIVATE ${ssl_LIBRARY} ${crypto_LIBRARY} )
else ( )
target_link_libraries( ${PROJECT_NAME} )
endif ( )
if ( BUILD_EXAMPLES )
find_package( pam )
find_package( syslog )
add_subdirectory( "${CMAKE_SOURCE_DIR}/example" )
endif ( )
if ( BUILD_TESTS )
find_package( catch REQUIRED )
enable_testing( )
add_subdirectory( "${CMAKE_SOURCE_DIR}/test/unit" "unit-tests" )
add_subdirectory( "${CMAKE_SOURCE_DIR}/test/acceptance" "acceptance-tests" )
add_subdirectory( "${CMAKE_SOURCE_DIR}/test/regression" "regression-tests" )
add_subdirectory( "${CMAKE_SOURCE_DIR}/test/integration" "integration-tests" )
endif ( )
#
# Install
#
include( "${CMAKE_SOURCE_DIR}/cmake/build_artifacts.cmake" )
install( FILES "${INCLUDE_DIR}/${PROJECT_NAME}" DESTINATION "include" )
install( FILES ${BUILD_ARTIFACTS} DESTINATION "include/corvusoft/${PROJECT_NAME}" )
install( TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION "library"
ARCHIVE DESTINATION "library" COMPONENT library )