-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
38 lines (28 loc) · 865 Bytes
/
CMakeLists.txt
File metadata and controls
38 lines (28 loc) · 865 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
34
35
36
37
38
cmake_minimum_required(VERSION 3.10)
project(multitool++ VERSION 1.1.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Find and link libcurl
find_package(CURL REQUIRED)
# include ./src/*.cpp
file(GLOB_RECURSE SOURCES "src/*.cpp")
# add include directories
include_directories("src")
# define executable
add_executable(multitool++ ${SOURCES})
# Link libcurl
target_link_libraries(multitool++ PRIVATE CURL::libcurl)
# enable testing
enable_testing()
# Default to Release if nothing is set
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the build type." FORCE)
endif()
# Compiler-specific optimization flags
if (MSVC)
# MSVC optimization flags
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /DNDEBUG")
else()
# GCC/Clang optimization flags
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
endif()