-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
82 lines (67 loc) · 1.97 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
cmake_minimum_required(VERSION 3.18)
option(KIGUMI_BUILD_BENCHES "Build the benchmarks" OFF)
option(KIGUMI_BUILD_CLI "Build the command-line interface" ON)
option(KIGUMI_BUILD_TESTS "Build the unit tests" ON)
if(KIGUMI_BUILD_BENCHES)
list(APPEND VCPKG_MANIFEST_FEATURES "bench-geogram" "bench-libigl" "bench-manifold" "bench-mcut")
endif()
project(kigumi CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(Boost CONFIG REQUIRED COMPONENTS container container_hash endian iterator program_options range unordered)
find_package(CGAL CONFIG REQUIRED)
find_package(FastFloat CONFIG REQUIRED)
find_package(GTest CONFIG REQUIRED)
include(GNUInstallDirs)
set(TARGET kigumi)
add_library(${TARGET} INTERFACE)
target_include_directories(${TARGET} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(${TARGET} INTERFACE
Boost::container
Boost::container_hash
Boost::endian
Boost::iterator
Boost::range
Boost::unordered
CGAL::CGAL
FastFloat::fast_float
)
if(KIGUMI_BUILD_BENCHES)
add_subdirectory(benches)
endif()
if(KIGUMI_BUILD_CLI)
add_subdirectory(cli)
install(TARGETS kigumi_cli)
endif()
if(KIGUMI_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
install(
TARGETS ${TARGET}
EXPORT ${PROJECT_NAME}Targets
)
install(
FILES cmake/kigumiConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
EXPORT ${PROJECT_NAME}Targets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
NAMESPACE ${PROJECT_NAME}::
)
export(
EXPORT ${PROJECT_NAME}Targets
FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
)