-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
30 lines (21 loc) · 1.19 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
cmake_minimum_required(VERSION 3.20)
project(CurseForge)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
include(FetchContent)
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
GIT_TAG 3b15fa82ea74739b574d705fea44959b58142eb8) # Replace with your desired git commit from: https://github.com/libcpr/cpr/releases
FetchContent_MakeAvailable(cpr)
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
FetchContent_MakeAvailable(json)
file(GLOB SOURCES "src/*.cpp")
file(GLOB HEADERS "include/*.hpp")
add_library(curseforge SHARED ${SOURCES} ${HEADERS})
add_library(curseforge-static STATIC ${SOURCES} ${HEADERS})
add_library(curseforge::shared ALIAS curseforge)
add_library(curseforge::static ALIAS curseforge-static)
target_include_directories(curseforge PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(curseforge-static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(curseforge PUBLIC cpr::cpr nlohmann_json::nlohmann_json)
target_link_libraries(curseforge-static PUBLIC cpr::cpr nlohmann_json::nlohmann_json)
add_subdirectory(tests)