-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
26 lines (18 loc) · 898 Bytes
/
CMakeLists.txt
File metadata and controls
26 lines (18 loc) · 898 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
cmake_minimum_required(VERSION 3.10)
project(Peck CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_EXTENSIONS OFF)
# Include the project's include directory
include_directories(include)
# Include the external directory for nlohmann/json
include_directories(external)
# Find libcurl
find_package(CURL REQUIRED)
add_executable(peck src/main.cpp src/cli.cpp src/network.cpp src/package_index.cpp src/git.cpp src/installer.cpp src/file_utils.cpp)
# Link libcurl using CURL_LIBRARIES.
target_link_libraries(peck PRIVATE ${CURL_LIBRARIES})
# Common system libraries, now without explicit std::filesystem linking
target_link_libraries(peck PRIVATE -ldl -lpthread) # stdc++ is usually linked by default for CXX projects
# Explicitly set CXX11 ABI to ensure consistency across all compilation units.
target_compile_options(peck PRIVATE -D_GLIBCXX_USE_CXX11_ABI=1)