forked from CoroModLoader/viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
78 lines (61 loc) · 2.72 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
cmake_minimum_required(VERSION 3.12)
project(viewer LANGUAGES CXX VERSION 1.0)
# --------------------------------------------------------------------------------------------------------
# Setup library
# --------------------------------------------------------------------------------------------------------
add_executable(${PROJECT_NAME})
add_executable(cormon::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 CXX_EXTENSIONS OFF CXX_STANDARD_REQUIRED ON)
if (UNIX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror -pedantic -pedantic-errors -Wfatal-errors)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-missing-field-initializers)
endif()
# --------------------------------------------------------------------------------------------------------
# Setup includes
# --------------------------------------------------------------------------------------------------------
target_include_directories(${PROJECT_NAME} PUBLIC "include")
target_include_directories(${PROJECT_NAME} PRIVATE "private")
target_include_directories(${PROJECT_NAME} PRIVATE "interface")
# --------------------------------------------------------------------------------------------------------
# Setup sources
# --------------------------------------------------------------------------------------------------------
file(GLOB src "src/*.cpp")
target_sources(${PROJECT_NAME} PRIVATE ${src})
# --------------------------------------------------------------------------------------------------------
# Setup required libraries
# --------------------------------------------------------------------------------------------------------
include("cmake/cpm.cmake")
CPMAddPackage(
NAME spdlog
VERSION 1.12.0
GIT_REPOSITORY "https://github.com/gabime/spdlog"
)
CPMAddPackage(
NAME reproc
GIT_TAG 1c07bdbec3f2ecba7125b9499b9a8a77bf9aa8c7
GIT_REPOSITORY "https://github.com/DaanDeMeyer/reproc"
OPTIONS "REPROC++ ON"
)
CPMAddPackage(
NAME nlohmann_json
VERSION 3.11.2
GIT_REPOSITORY "https://github.com/nlohmann/json"
)
CPMAddPackage(
NAME fmt
GIT_TAG 10.1.0
GIT_REPOSITORY "https://github.com/fmtlib/fmt"
)
CPMAddPackage(
NAME saucer
GIT_TAG very-experimental
GIT_REPOSITORY "https://github.com/saucer/saucer"
)
CPMAddPackage(
NAME nfd
VERSION 1.1.0
GIT_REPOSITORY "https://github.com/btzy/nativefiledialog-extended"
OPTIONS "NFD_PORTAL ON"
)
target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog fmt::fmt nfd saucer reproc++ nlohmann_json)