forked from TheLartians/MiniCppStarter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
30 lines (23 loc) · 933 Bytes
/
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
# Compile and execute : `cmake -S. -Bbuild && cmake --build build && ./build/App`
cmake_minimum_required(VERSION 3.16)
# ---- Project ----
project(App LANGUAGES CXX)
# ---- Fetch CPM ----
file(
DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.39.0/CPM.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake
EXPECTED_HASH SHA256=66639BCAC9DD2907B2918DE466783554C1334446B9874E90D38E3778D404C2EF
)
include(${CMAKE_CURRENT_BINARY_DIR}/cmake/CPM.cmake)
# ---- Add dependencies via CPM ----
# See https://github.com/TheLartians/CPM.cmake for details and examples
# ---- Create executable ----
# add your source files here
add_subdirectory(lib)
include_directories(lib)
add_executable(${PROJECT_NAME} main.cpp)
# link to your dependencies' targets here
target_link_libraries(${PROJECT_NAME} lib${PROJECT_NAME})
# setup your target's properties
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)