-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
33 lines (27 loc) · 944 Bytes
/
CMakeLists.txt
File metadata and controls
33 lines (27 loc) · 944 Bytes
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
cmake_minimum_required(VERSION 3.16)
project(CppPM VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Fetch nlohmann/json for JSON parsing
include(FetchContent)
FetchContent_Declare(nlohmann_json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.gz)
FetchContent_MakeAvailable(nlohmann_json)
# Main executable
add_executable(cppm
src/main.cpp
src/cli.cpp
src/manifest.cpp
src/semver.cpp
src/resolver.cpp
src/fetcher.cpp
src/filesystem.cpp
src/cmake_gen.cpp
)
target_link_libraries(cppm PRIVATE nlohmann_json::nlohmann_json CURL::libcurl)
target_include_directories(cppm PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
# Tests
enable_testing()
add_executable(cppm_tests tests/test_all.cpp)
target_link_libraries(cppm_tests PRIVATE cppm nlohmann_json::nlohmann_json)
add_test(NAME cppm_tests COMMAND cppm_tests)