-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
75 lines (62 loc) · 1.12 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
cmake_minimum_required(VERSION 3.14)
project(
dr
VERSION 0.1.0
LANGUAGES C CXX
)
#
# Global config
#
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
list(
PREPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_LIST_DIR}/cmake/"
)
# Show FetchContent download progress
set(FETCHCONTENT_QUIET FALSE)
#
# Library target
#
add_library(
dr STATIC
"src/halfedge.cpp"
"src/memory.cpp"
"src/mesh_primitives.cpp"
)
add_library(dr::dr ALIAS dr)
target_include_directories(
dr
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/include"
)
include("deps/eigen")
include("deps/fmt")
include("deps/openmp")
include("deps/unordered-dense")
target_link_libraries(
dr
PUBLIC
Eigen3::Eigen
fmt::fmt
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
unordered_dense::unordered_dense
)
target_compile_options(
dr
PRIVATE
-Wall -Wextra -Wpedantic -Werror
)
target_compile_definitions(
dr
PUBLIC
EIGEN_INITIALIZE_MATRICES_BY_ZERO
)
#
# Optional targets
#
option(DR_TEST "Generate test target" OFF)
if(DR_TEST)
enable_testing()
add_subdirectory(test)
endif()