-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
38 lines (32 loc) · 1.39 KB
/
Copy pathCMakeLists.txt
File metadata and controls
38 lines (32 loc) · 1.39 KB
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
cmake_minimum_required(VERSION 3.16)
project(feed_handler CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# WITH_KDB links against the real kdb+ C API (k.h/k.c from KX, not
# redistributed here - copy them into third_party/kdb/ to enable this).
# When off, the build still works and falls back to ConsolePublisher.
option(WITH_KDB "Build against the kdb+ C API for live tickerplant publishing" OFF)
add_library(normalizer
src/source_normalizer.cpp
src/tick_publisher.cpp
src/csv_curve_publisher.cpp
)
target_include_directories(normalizer PUBLIC include)
if(WITH_KDB)
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/third_party/kdb/k.h")
message(FATAL_ERROR "WITH_KDB=ON but third_party/kdb/k.h is missing. "
"Copy k.h/k.c from your kdb+ install into third_party/kdb/.")
endif()
target_compile_definitions(normalizer PUBLIC WITH_KDB)
target_include_directories(normalizer PUBLIC third_party/kdb)
target_sources(normalizer PRIVATE third_party/kdb/k.c)
if(UNIX AND NOT APPLE)
target_link_libraries(normalizer PUBLIC pthread dl)
endif()
endif()
add_executable(feed_handler src/main.cpp)
target_link_libraries(feed_handler PRIVATE normalizer)
enable_testing()
add_executable(test_normalize tests/test_normalize.cpp)
target_link_libraries(test_normalize PRIVATE normalizer)
add_test(NAME test_normalize COMMAND test_normalize)