-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
71 lines (56 loc) · 2.52 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
cmake_minimum_required(VERSION 3.15.0)
project(cbpro++ LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
include(GNUInstallDirs)
# gather headers
file(GLOB cbpro++_TOP_HEADERS include/*.h)
file(GLOB cbpro++_MDATA_HEADERS include/marketdata/*.h)
file(GLOB cbpro++_ACCOUNTS_HEADERS include/accounts/*.h)
file(GLOB cbpro++_ORDERS_HEADERS include/orders/*.h)
file(GLOB_RECURSE cbpro++_PRIVATE_HEADERS src/*.hpp)
file(GLOB_RECURSE cbpro++_SOURCES src/*.cpp)
source_group("Header Files\\cbpro++" FILES ${cbpro++_TOP_HEADERS})
source_group("Header Files\\cbpro++\\marketdata" FILES ${cbpro++_MDATA_HEADERS})
source_group("Header Files\\cbpro++\\accounts" FILES ${cbpro++_ACCOUNTS_HEADERS})
source_group("Header Files\\cbpro++\\orders" FILES ${cbpro++_ORDERS_HEADERS})
set(cbpro++_PUBLIC_HEADERS ${cbpro++_TOP_HEADERS} ${cbpro++_MDATA_HEADERS} ${cbpro++_ACCOUNTS_HEADERS} ${cbpro++_ORDERS_HEADERS})
# dependency handling
set(OPENSSL_USE_STATIC_LIBS TRUE)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Boost REQUIRED)
add_library(cbpro++ ${cbpro++_SOURCES} ${cbpro++_PUBLIC_HEADERS} ${cbpro++_PRIVATE_HEADERS})
target_link_libraries(cbpro++ PRIVATE OpenSSL::SSL OpenSSL::Crypto ${CMAKE_THREAD_LIBS_INIT} ${BOOST_INCLUDE_LIBS})
target_include_directories(cbpro++ PRIVATE SYSTEM ${OPENSSL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
target_include_directories(
cbpro++
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
#target_compile_options(cbpro++ PRIVATE -Wall)
install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(TARGETS cbpro++
EXPORT cbpro++_export
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
configure_file("cmake/cbpro++-config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cbpro++-config.cmake" @ONLY)
install(
EXPORT cbpro++_export
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cbpro++"
NAMESPACE "cbpro++::"
FILE cbpro++-targets.cmake
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cbpro++-config.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cbpro++")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "cbpro++")
SET(CPACK_PACKAGE_VENDOR "bbottoml")
SET(CPACK_PACKAGE_VERSION "1.0.0")
SET(CPACK_GENERATOR "RPM;DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "N/A")
INCLUDE(CPack)