-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
80 lines (69 loc) · 2.95 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
# This is the build file to build libdts2
# It can be build as a stand-alone project as well as a sub-project
# You may simply do the following:
cmake_minimum_required(VERSION 3.19)
project(dts2)
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/libratss/cmake"
)
set(MY_CXX_FLAGS "-Wall -Wextra -Wstrict-overflow=3")
set(MY_C_FLAGS "-Wall -Wextra -Wstrict-overflow=3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}")
set(MY_INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/include"
)
find_package(CGAL 5.3...5.4 REQUIRED Core )
add_subdirectory(vendor/libratss libratss)
set(LIB_SOURCES_CPP
src/debug.cpp
src/util.cpp
src/Constrained_delaunay_triangulation_s2.cpp
src/Kernel_sp/Point_sp.cpp
src/Kernel_sp/Kernel_sp.cpp
src/vendor/signed_wider.cpp
)
set(LIB_SOURCES_H
include/libdts2/constants.h
include/libdts2/debug.h
include/libdts2/util.h
include/libdts2/Constrained_delaunay_triangulation_with_exact_intersections_traits_s2.h
include/libdts2/Constrained_Triangulation_base_s2.h
include/libdts2/Constrained_delaunay_triangulation_with_intersections_base_traits_s2.h
include/libdts2/Delaunay_triangulation_traits_s2.h
include/libdts2/Delaunay_triangulation_s2.h
include/libdts2/Constrained_delaunay_triangulation_s2.h
include/libdts2/Kernel_sp/Kernel_sp.h
include/libdts2/Kernel_sp/Kernel_sp_base.h
include/libdts2/Kernel_sp/Point_sp.h
include/libdts2/Constrained_delaunay_triangulation_base_traits_s2.h
include/libdts2/Constrained_delaunay_triangulation_traits_s2.h
include/libdts2/Triangulation_base_s2.h
include/libdts2/Constrained_delaunay_triangulation_with_exact_intersections_spherical_traits_s2.h
include/libdts2/Constrained_delaunay_triangulation_with_inexact_intersections_traits_s2.h
include/libdts2/vendor/wider/signed_wider.h
include/libdts2/vendor/wider/wider.h
)
add_library(${PROJECT_NAME} STATIC
${LIB_SOURCES_CPP}
${LIB_SOURCES_H}
)
target_link_libraries(${PROJECT_NAME} ratss CGAL::CGAL CGAL::CGAL_Core)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)
target_include_directories(${PROJECT_NAME} PUBLIC ${MY_INCLUDE_DIRS})
if (LIBDTS2_BUILD_SUB_PROJECTS)
set(LIBDTS2_BUILD_SUB_PROJECTS TRUE CACHE BOOL "Build all libdts2 subprojects as part of all target" FORCE)
add_subdirectory(common ${PROJECT_NAME}common)
add_subdirectory(bench ${PROJECT_NAME}bench)
add_subdirectory(tests ${PROJECT_NAME}tests)
add_subdirectory(tools ${PROJECT_NAME}tools)
add_subdirectory(examples ${PROJECT_NAME}examples)
else()
set(LIBDTS2_BUILD_SUB_PROJECTS FALSE CACHE BOOL "Build all libdts2 subprojects as part of all target" FORCE)
add_subdirectory(common ${PROJECT_NAME}common EXCLUDE_FROM_ALL)
add_subdirectory(bench ${PROJECT_NAME}bench EXCLUDE_FROM_ALL)
add_subdirectory(tests ${PROJECT_NAME}tests EXCLUDE_FROM_ALL)
add_subdirectory(tools ${PROJECT_NAME}tools EXCLUDE_FROM_ALL)
add_subdirectory(examples ${PROJECT_NAME}examples EXCLUDE_FROM_ALL)
endif()