-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
47 lines (36 loc) · 1.83 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.21)
project(pdfcomp LANGUAGES CXX VERSION 2.1.0)
# --------------------------------------------------------------------------------------------------------
# Setup Executable
# --------------------------------------------------------------------------------------------------------
add_executable(${PROJECT_NAME} "src/main.cpp" "src/pdf.cpp")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 23 CXX_EXTENSIONS OFF CXX_STANDARD_REQUIRED ON)
if (PROJECT_IS_TOP_LEVEL)
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX /external:anglebrackets /external:W0)
else()
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror -pedantic -pedantic-errors -Wfatal-errors)
endif()
endif()
# --------------------------------------------------------------------------------------------------------
# Include directories
# --------------------------------------------------------------------------------------------------------
target_include_directories(${PROJECT_NAME} PUBLIC "include")
# --------------------------------------------------------------------------------------------------------
# Setup Dependencies
# --------------------------------------------------------------------------------------------------------
include("cmake/cpm.cmake")
include("cmake/magick.cmake")
CPMFindPackage(
NAME clap
VERSION 0.4.3
GIT_REPOSITORY "https://github.com/karnkaul/clap"
)
CPMFindPackage(
NAME expected
VERSION 1.1.0
GIT_REPOSITORY "https://github.com/TartanLlama/expected"
OPTIONS "EXPECTED_BUILD_TESTS OFF"
)
target_link_libraries(${PROJECT_NAME} PUBLIC clap::clap tl::expected ImageMagick::MagickCore ImageMagick::Magick++)