-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
137 lines (117 loc) · 3.46 KB
/
CMakeLists.txt
File metadata and controls
137 lines (117 loc) · 3.46 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
cmake_minimum_required(VERSION 3.16.3)
project(axel)
include(GNUInstallDirs)
#===============================================================================
# Find dependencies
#===============================================================================
find_package(drjit CONFIG REQUIRED)
find_package(Eigen3 3.4.0 CONFIG REQUIRED)
find_package(Microsoft.GSL CONFIG REQUIRED)
find_package(Dispenso CONFIG REQUIRED)
#===============================================================================
# Build axel
#===============================================================================
set(target_name axel)
add_library(${target_name})
set(headers
axel/common/Constants.h
axel/common/Types.h
axel/common/VectorizationTypes.h
axel/math/BoundingBoxUtils.h
axel/math/MeshHoleFilling.h
axel/math/PointTriangleProjection.h
axel/math/PointTriangleProjectionDefinitions.h
axel/math/RayTriangleIntersection.h
axel/BoundingBox.h
axel/Bvh.h
axel/BvhBase.h
axel/BvhCommon.h
axel/DualContouring.h
axel/MeshToSdf.h
axel/Ray.h
axel/SignedDistanceField.h
axel/SimdKdTree.h
axel/TriBvh.h
)
set(sources
axel/math/MeshHoleFilling.cpp
axel/math/PointTriangleProjection.cpp
axel/math/RayTriangleIntersection.cpp
axel/BoundingBox.cpp
axel/Bvh.cpp
axel/DualContouring.cpp
axel/MeshToSdf.cpp
axel/SignedDistanceField.cpp
axel/SimdKdTree.cpp
axel/TriBvh.cpp
)
target_sources(${target_name}
PRIVATE
${headers}
${sources}
)
target_include_directories(${target_name}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/axel>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/axel>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_features(${target_name} PUBLIC cxx_std_20)
target_link_libraries(${target_name}
PUBLIC
Eigen3::Eigen
Microsoft.GSL::GSL
Dispenso::dispenso
drjit
)
if(MSVC)
set_target_properties(${target_name} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
if(MOMENTUM_ENABLE_PROFILING)
target_link_libraries(${target_name} PUBLIC Tracy::TracyClient)
target_compile_definitions(${target_name} PUBLIC -DAXEL_WITH_TRACY_PROFILER=1)
endif()
#===============================================================================
# Install axel
#===============================================================================
# Generate required install artifacts for CMake buildsystem
include(CMakePackageConfigHelpers)
set(AXEL_CONFIG_INPUT axel-config.cmake.in)
set(AXEL_CONFIG_OUTPUT ${CMAKE_BINARY_DIR}/cmake/axel-config.cmake)
set(AXEL_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
configure_package_config_file(
${AXEL_CONFIG_INPUT}
${AXEL_CONFIG_OUTPUT}
INSTALL_DESTINATION ${AXEL_CONFIG_INSTALL_DIR}
)
install(
FILES ${AXEL_CONFIG_OUTPUT}
DESTINATION ${AXEL_CONFIG_INSTALL_DIR}
)
# Install headers
install(
DIRECTORY axel
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT headers
FILES_MATCHING PATTERN "*.h"
PATTERN "*/examples/*" EXCLUDE
PATTERN "*/test/*" EXCLUDE
PATTERN "*/website/*" EXCLUDE
)
# Install targets (lib)
install(
TARGETS axel
EXPORT axelTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
install(
EXPORT axelTargets
NAMESPACE axel::
DESTINATION ${AXEL_CONFIG_INSTALL_DIR}
)