-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathCMakeLists.txt
85 lines (57 loc) · 1.66 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
cmake_minimum_required(VERSION 3.12)
# cmake
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
# project
project(roq-cpp-samples)
# language
enable_language(CXX)
# conda
if(DEFINED ENV{CONDA_PREFIX} AND NOT DEFINED ENV{CONDA_BUILD})
set(CMAKE_INSTALL_PREFIX $ENV{CONDA_PREFIX})
set(CMAKE_FIND_ROOT_PATH $ENV{CONDA_PREFIX})
endif()
# rpath
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# c++
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 23)
endif()
# filesystem
include(GNUInstallDirs)
# dependencies
find_package(absl REQUIRED)
find_package(fmt REQUIRED)
find_package(magic_enum REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(pybind11 REQUIRED)
find_package(roq-algo REQUIRED)
find_package(roq-api REQUIRED)
find_package(roq-cache REQUIRED)
find_package(roq-client REQUIRED)
find_package(roq-codec REQUIRED)
find_package(roq-fix REQUIRED)
find_package(roq-flags REQUIRED)
find_package(roq-io REQUIRED)
find_package(roq-logging REQUIRED)
find_package(roq-market REQUIRED)
find_package(roq-utils REQUIRED)
find_package(roq-web REQUIRED)
find_package(tomlplusplus REQUIRED)
find_package(unordered_dense REQUIRED)
# autogen
find_program(ROQ_AUTOGEN roq-autogen REQUIRED)
set(TEMPLATE_DIR ${CMAKE_SOURCE_DIR}/scripts/templates)
# clang-format
find_program(CLANG_FORMAT clang-format REQUIRED)
# test
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)
endif()
if(BUILD_TESTING)
find_package(Catch2 REQUIRED)
endif()
# include
include_directories(${CMAKE_SOURCE_DIR}/src)
# sub-projects
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/roq/algo)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/roq/samples)