-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
94 lines (81 loc) · 2.86 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
cmake_minimum_required (VERSION 3.14)
include (FetchContent)
set (FETCHCONTENT_QUIET FALSE)
project ("HexBox" VERSION 0.3)
add_compile_definitions(HMP_NAME=\"${CMAKE_PROJECT_NAME}\")
add_compile_definitions(HMP_VERSION=\"${CMAKE_PROJECT_VERSION}\")
option (HMP_GUI_ENABLE_DAG_VIEWER "Enable dag viewer widget" OFF)
option (HMP_GUI_ENABLE_AE3D2SHAPE_EXPORTER "Enable ae-3d2shape exporter" OFF)
option (HMP_ENABLE_ALT_PROJ "Enable alternative projection" ON)
option (HMP_AGGRESSIVE_DEBUG "Enable ASAN and debug libc" OFF)
option (HMP_AGGRESSIVE_WARNINGS "Enable a lot of warnings" OFF)
option (HMP_GUI_CAPTURE "Setup for recording modeling sessions" OFF)
# cinolib
set (CINOLIB_HEADER_ONLY OFF)
set (CINOLIB_USES_OPENGL_GLFW_IMGUI ON)
FetchContent_Declare (
cinolib
GIT_REPOSITORY "https://github.com/francescozoccheddu/cinolib.git"
GIT_TAG "ad8f8ca2884b56de958b237ff28eb47b0646daf3"
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable (cinolib)
# ogdf
if (HMP_GUI_ENABLE_DAG_VIEWER)
FetchContent_Declare (
ogdf
GIT_REPOSITORY "https://github.com/ogdf/ogdf.git"
GIT_TAG "dogwood-202202"
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable (ogdf)
endif()
# fprotais/hexsmoothing
if (HMP_ENABLE_ALT_PROJ)
add_compile_definitions(HMP_ENABLE_ALT_PROJ)
FetchContent_Declare (
fprotais
GIT_REPOSITORY "https://github.com/fprotais/hexsmoothing"
GIT_TAG "b538f7270d91a5e8baaa25287c06ab4a5c5d4cfb"
GIT_SHALLOW FALSE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable (fprotais)
endif()
# updatable_priority_queue
FetchContent_Declare (
updatable_priority_queue
GIT_REPOSITORY "https://github.com/Ten0/updatable_priority_queue.git"
GIT_TAG "8a7facc90855f64ad463d7edd393eff0fc6d97af"
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable (updatable_priority_queue)
# cpputils
FetchContent_Declare (
cpputils
GIT_REPOSITORY "https://github.com/francescozoccheddu/cpputils.git"
GIT_TAG "56414519fe56d47413def942ecd29073d1c5be8e"
GIT_SHALLOW FALSE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable (cpputils)
# hexa-modeling-prototype
add_subdirectory ("core")
add_subdirectory ("gui")
# compile options
if (HMP_AGGRESSIVE_DEBUG)
add_compile_definitions(_GLIBCXX_DEBUG HMP_AGGRESSIVE_DEBUG)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()
if (HMP_AGGRESSIVE_WARNINGS)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(core PRIVATE -Wall -Wextra -Wpedantic -Wconversion -Wunused)
target_compile_options(gui PRIVATE -Wall -Wextra -Wpedantic -Wconversion -Wunused)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(core PRIVATE /W4)
target_compile_options(gui PRIVATE /W4)
endif()
endif()