forked from crypto-crawler/crypto-crawler-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
52 lines (45 loc) · 1.53 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
cmake_minimum_required(VERSION 3.16)
include(FetchContent)
include(GoogleTest)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
find_program(VCPKG "vcpkg")
if(!VCPKG)
message(
FATAL_ERROR
"Could not find vcpkg, please install it following https://vcpkg.io/en/getting-started.html."
)
endif()
project(
"crypto_crawler"
LANGUAGES CXX
VERSION 1.7.8
DESCRIPTION
"A parser library to parser websocket messages from cryptocurrency exchanges."
HOMEPAGE_URL "https://github.com/soulmachine/crypto-crawler-cpp")
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt
ON
CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
FetchContent_Declare(
crypto_crawler_ffi
GIT_REPOSITORY https://github.com/soulmachine/crypto-crawler-ffi
GIT_TAG main)
FetchContent_MakeAvailable(crypto_crawler_ffi)
add_library(crypto_crawler STATIC crypto_crawler.cpp)
target_link_libraries(crypto_crawler crypto_crawler_ffi)
target_include_directories(crypto_crawler PUBLIC include)
include(GNUInstallDirs)
install(
TARGETS crypto_crawler
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
enable_testing()
add_executable(crypto_crawler_test crypto_crawler_test.cpp)
target_link_libraries(crypto_crawler_test PRIVATE crypto_crawler gtest_main)
gtest_discover_tests(crypto_crawler_test)