Skip to content

Commit 566c948

Browse files
authored
Merge pull request #6 from talregev/TalR/cmake_export
Add cmake export
2 parents 2cb643d + f65042d commit 566c948

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,32 @@ project(TriangleMeshDistance)
33
set(CMAKE_CXX_STANDARD 11)
44

55
add_subdirectory(tests)
6+
7+
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
8+
SET(CMAKE_INSTALL_INCLUDEDIR include CACHE
9+
PATH "Output directory for header files")
10+
endif()
11+
12+
add_library(trianglemeshdistance INTERFACE)
13+
14+
target_include_directories(trianglemeshdistance
15+
INTERFACE
16+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/TriangleMeshDistance/include>
17+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
18+
)
19+
20+
install(
21+
DIRECTORY TriangleMeshDistance/include/
22+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
23+
)
24+
25+
install(
26+
TARGETS trianglemeshdistance
27+
EXPORT TriangleMeshDistanceTargets
28+
)
29+
30+
install(EXPORT TriangleMeshDistanceTargets
31+
FILE trianglemeshdistance-config.cmake
32+
NAMESPACE trianglemeshdistance::
33+
DESTINATION share/trianglemeshdistance
34+
)

0 commit comments

Comments
 (0)