-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
78 lines (67 loc) · 3.01 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
#------------------------------------------------------------------------------
# Copyright (c) Pourya Shirazian
# All rights reserved.
#
# 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.20)
project(volmesh LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
#----------------------------------------------------------------------------------
# All build options
#----------------------------------------------------------------------------------
# We disabled building docs by default as it requires doxygen, sphinx and dot which
# may not be available on the user system.
option(BUILD_DOCS "Build documentation" OFF)
mark_as_advanced(BUILD_DOCS)
#----------------------------------------------------------------------------------
# Finds external packages
#----------------------------------------------------------------------------------
find_package(Eigen3 CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
find_package(tinyxml2 CONFIG REQUIRED)
enable_testing()
#----------------------------------------------------------------------------------
# Builds the main library
#----------------------------------------------------------------------------------
set(VOLMESH_LIB_NAME "volmesh")
add_library(${VOLMESH_LIB_NAME}
STATIC
src/volmesh/aabb.cpp
src/volmesh/halfedge.cpp
src/volmesh/index.cpp
src/volmesh/logger.cpp
src/volmesh/mathutils.cpp
src/volmesh/mergelist.cpp
src/volmesh/sampletetmeshes.cpp
src/volmesh/signeddistancefield.cpp
src/volmesh/stlserializer.cpp
src/volmesh/tetmesh.cpp
src/volmesh/tetrahedra.cpp
src/volmesh/trianglemesh.cpp
src/volmesh/voxel.cpp)
target_include_directories(${VOLMESH_LIB_NAME} PRIVATE
${CMAKE_SOURCE_DIR}/include)
target_link_libraries(${VOLMESH_LIB_NAME}
PRIVATE
Eigen3::Eigen
fmt::fmt
tinyxml2::tinyxml2)
#----------------------------------------------------------------------------------
# Builds tests
#----------------------------------------------------------------------------------
add_subdirectory(test)
#----------------------------------------------------------------------------------
# Builds apps
#----------------------------------------------------------------------------------
add_subdirectory(apps)
#----------------------------------------------------------------------------------
# Builds docs. Only enable if you have already installed doxygen, sphinx, and dot.
#----------------------------------------------------------------------------------
if(BUILD_DOCS)
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
add_subdirectory(docs)
endif()