-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
74 lines (58 loc) · 1.79 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
cmake_minimum_required(VERSION 3.17)
project(MeshIO
VERSION 0.1.0
DESCRIPTION "Header only library to read/write polygonal meshes"
LANGUAGES CXX)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(meshioBuildType)
include(meshioChecks)
option(MeshIO_BUILD_DOCS "Build MeshIO Documentation" OFF)
option(MeshIO_BUILD_EXAMPLES "Build MeshIO Examples" OFF)
option(MeshIO_BUILD_COVERAGE "Generate MeshIO coverage report" OFF)
option(MeshIO_BUILD_TESTS "Build unit tests" OFF)
add_library(meshio INTERFACE)
target_include_directories(meshio INTERFACE
$<BUILD_INTERFACE:${MeshIO_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_compile_features(meshio INTERFACE cxx_std_17)
if(MeshIO_BUILD_TESTS OR MeshIO_BUILD_COVERAGE)
include(CTest)
add_subdirectory(test)
endif()
if(MeshIO_BUILD_DOCS)
add_subdirectory(docs)
endif(MeshIO_BUILD_DOCS)
if (MeshIO_BUILD_EXAMPLES)
add_subdirectory(examples)
endif ()
include(CMakePackageConfigHelpers)
set(INCLUDE_DIRS include)
set(CMAKE_DIR share/meshio/cmake)
configure_package_config_file(
"${MeshIO_SOURCE_DIR}/cmake/MeshIOConfig.cmake.in"
"cmake_install/MeshIOConfig.cmake"
INSTALL_DESTINATION share/meshio/cmake
PATH_VARS INCLUDE_DIRS CMAKE_DIR
)
install(TARGETS meshio EXPORT MeshIOTargets COMPONENT meshio)
install(EXPORT MeshIOTargets
NAMESPACE MeshIO::
DESTINATION share/meshio/cmake
COMPONENT meshio
)
install(FILES
${MeshIO_BINARY_DIR}/cmake_install/MeshIOConfig.cmake
DESTINATION share/meshio/cmake
COMPONENT cmake
)
install(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/include"
DESTINATION .
COMPONENT Headers
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.inl"
)
mark_as_advanced(MeshIO_BUILD_COVERAGE)
mark_as_advanced(MeshIO_BUILD_EXAMPLES)