-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
93 lines (80 loc) · 2.64 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
91
92
93
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
PROJECT(asio-protocols)
set (VERSION_MAJOR 1)
set (VERSION_MINOR 2)
set (VERSION_PATCH 2)
set (PROJECT_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
set (PROJECT_VERSION_REVISION 1)
option(USE_CLANG "build application with clang" OFF)
if(USE_CLANG)
set(CMAKE_CXX_COMPILER "/usr/bin/clang++-3.7")
endif()
include(set_cxx_norm.cmake)
set_cxx_norm(${CXX_NORM_CXX14})
enable_testing()
set(Protocols_LIBRARY asio-protocols)
set(Boost_USE_MULTITHREADED ON)
add_definitions(-DBOOST_LOG_DYN_LINK)
include_directories(include/ src/)
find_package(Boost COMPONENTS chrono system regex thread log)
find_package(OpenSSL REQUIRED)
find_package(Threads REQUIRED)
find_package(Future REQUIRED)
find_package(AMQP REQUIRED)
include_directories(${AMQP_INCLUDE_DIR})
add_subdirectory(test)
add_library(
${Protocols_LIBRARY}
src/buffer.cpp
src/source.cpp
src/sink.cpp
src/stream.cpp
src/amqp.cpp
)
install(
DIRECTORY include/
DESTINATION "include"
)
install(
TARGETS ${Protocols_LIBRARY}
ARCHIVE DESTINATION lib
)
include (CTest)
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY
)
add_custom_target(
doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)
include (InstallRequiredSystemLibraries)
set (CPACK_PACKAGE_NAME "libasio-protocols")
set (CPACK_PACKAGE_VENDOR "")
set (CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
set (CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
set (CPACK_PACKAGE_CONTACT "Tom Molesworth <[email protected]>")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "C++ network protocols implementation using ASIO")
set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.debian")
set (CPACK_GENERATOR "TGZ;DEB")
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
find_program(DPKG_PROGRAM dpkg)
if(DPKG_PROGRAM)
execute_process(
COMMAND ${DPKG_PROGRAM} --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${PROJECT_VERSION}-${PROJECT_VERSION_REVISION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
else(DPKG_PROGRAM)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${PROJECT_VERSION}-${PROJECT_VERSION_REVISION}_${CMAKE_SYSTEM_NAME}")
endif(DPKG_PROGRAM)
# set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
include (CPack)