-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
93 lines (79 loc) · 2.05 KB
/
Copy pathCMakeLists.txt
File metadata and controls
93 lines (79 loc) · 2.05 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
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
86
87
88
89
90
91
92
93
cmake_minimum_required(VERSION 3.10)
project(quip-cli)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Include FetchContent
include(FetchContent)
# Fetch nlohmann_json
FetchContent_Declare(
json
URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(json)
# Set hashsigs library path
set(HASHSIGS_ROOT "${CMAKE_SOURCE_DIR}/../hashsigs-cpp")
set(HASHSIGS_LIBRARY_PATH "${HASHSIGS_ROOT}/build/lib/libhashsigs.a")
if(NOT EXISTS "${HASHSIGS_LIBRARY_PATH}")
message(FATAL_ERROR "hashsigs library not found at ${HASHSIGS_LIBRARY_PATH}. Please build hashsigs-cpp first.")
endif()
# Find required packages
find_package(CURL REQUIRED)
find_package(GTest REQUIRED)
find_package(OpenSSL REQUIRED)
# Common source files
set(QUIP_CLI_SOURCES
src/main.cpp
src/cli.cpp
src/common.cpp
src/quip_factory.cpp
src/quip_wallet.cpp
)
# Main executable
add_executable(quip-cli ${QUIP_CLI_SOURCES})
target_include_directories(quip-cli
PRIVATE
${CMAKE_SOURCE_DIR}/include
${HASHSIGS_ROOT}/include
${OPENSSL_INCLUDE_DIR}
${CMAKE_BINARY_DIR}/_deps/json-src/include
)
target_link_libraries(quip-cli
PRIVATE
${HASHSIGS_LIBRARY_PATH}
CURL::libcurl
nlohmann_json::nlohmann_json
OpenSSL::SSL
OpenSSL::Crypto
)
# Test executable
enable_testing()
add_executable(quip-cli-tests
test/cli_test.cpp
test/quip_factory_test.cpp
test/quip_wallet_test.cpp
src/cli.cpp
src/common.cpp
src/quip_factory.cpp
src/quip_wallet.cpp
)
target_include_directories(quip-cli-tests
PRIVATE
${CMAKE_SOURCE_DIR}/include
${HASHSIGS_ROOT}/include
${CMAKE_SOURCE_DIR}/test
${GTEST_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
${CMAKE_BINARY_DIR}/_deps/json-src/include
)
target_link_libraries(quip-cli-tests
PRIVATE
${HASHSIGS_LIBRARY_PATH}
CURL::libcurl
nlohmann_json::nlohmann_json
GTest::GTest
GTest::Main
OpenSSL::SSL
OpenSSL::Crypto
)
add_test(NAME quip-cli-tests COMMAND quip-cli-tests)