-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (37 loc) · 1.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
cmake_minimum_required(VERSION 3.18)
project(btcpp)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# dependencies
include(cmake/external/libbase58.cmake)
include(cmake/external/libbech32.cmake)
find_package(
Boost
COMPONENTS random headers
REQUIRED
)
find_package(PkgConfig REQUIRED)
pkg_check_modules(crypto++ REQUIRED IMPORTED_TARGET libcrypto++)
# on ubuntu version is still 0.1, once on more recent version, move to cmake-based project
pkg_check_modules(libsecp256k1 REQUIRED IMPORTED_TARGET libsecp256k1)
#### library
add_subdirectory(src)
#### tests
if(NOT ENABLE_TESTS)
return()
endif()
enable_testing()
find_package(GTest REQUIRED)
include(GoogleTest)
add_executable(
bips
test/data/testvectors.cpp
test/data/testvectors.hpp
test/bip39.cpp
test/bip32.cpp
test/encoding.cpp
)
target_link_libraries(bips PRIVATE btc++ GTest::GTest GTest::Main Boost::headers)
target_include_directories(bips PRIVATE ${CMAKE_SOURCE_DIR}/src)
gtest_discover_tests(bips)