-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
74 lines (64 loc) · 2.04 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
cmake_minimum_required(VERSION 3.13)
project(m2c-udp-process VERSION 0.1.0 LANGUAGES CXX)
# Default as Release
if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
find_package(ryml REQUIRED)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_NO_WARN_NEW_VERSIONS ON)
if (UNIX AND NOT APPLE) # Linux
find_package(
Boost 1.70 REQUIRED
COMPONENTS iostreams program_options
)
else()
find_package(
Boost 1.70 REQUIRED
COMPONENTS iostreams program_options filesystem
)
endif()
set(ARROW_HTTP OFF CACHE BOOL "Do not want http" FORCE)
set(ARROW_WITH_CURL OFF CACHE BOOL "Do not want curl dependency" FORCE)
find_package(Arrow REQUIRED)
find_package(Parquet REQUIRED)
if (UNIX)
set(USE_THREADS TRUE BOOL "Use Threads in Unix")
else()
set(USE_THREADS FALSE BOOL "Do not use Threads in Windows")
endif()
if (USE_THREADS)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
endif()
include_directories(
${CMAKE_SOURCE_DIR}/include
${Boost_INCLUDE_DIR}
)
link_directories(${Boost_LIBRARY_DIRS})
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# work around for issue with Boost library
# which is shown https://github.com/bitcoin/bitcoin/pull/24415
set(CMAKE_CXX_FLAGS -Wno-error=narrowing)
endif()
set(SOURCES
"src/pkt_receive.cpp"
"src/pkt_parse.cpp"
"src/cli_cmd.cpp"
"src/cfg_read.cpp"
"src/main.cpp"
)
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} LINK_PRIVATE ${Boost_LIBRARIES} ryml::ryml
Arrow::arrow_shared Parquet::parquet_shared)
if (UNIX AND NOT APPLE)
target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl)
endif()
if (USE_THREADS)
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
endif()