Skip to content

Commit d76b871

Browse files
committed
Do not install headers when the project is not top-level
1 parent 82123ac commit d76b871

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cmake/Install.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ if (BVH_BUILD_C_API)
33
list(APPEND bvh_targets bvh_c)
44
endif()
55

6+
install(
7+
DIRECTORY ${PROJECT_SOURCE_DIR}/src/bvh
8+
DESTINATION include
9+
FILES_MATCHING PATTERN "*.h"
10+
PATTERN "c_api" EXCLUDE)
11+
install(
12+
FILES ${PROJECT_SOURCE_DIR}/src/bvh/v2/c_api/bvh.h
13+
DESTINATION include/bvh/v2/c_api/)
614
install(
715
TARGETS ${bvh_targets}
816
EXPORT bvh_exports

src/bvh/v2/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ target_include_directories(bvh INTERFACE
1212

1313
set_target_properties(bvh PROPERTIES CXX_STANDARD 20)
1414

15-
install(
16-
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
17-
DESTINATION include/bvh/v2
18-
FILES_MATCHING PATTERN "*.h"
19-
PATTERN "c_api" EXCLUDE)
20-
2115
if (BVH_BUILD_C_API)
2216
add_subdirectory(c_api)
2317
endif()

src/bvh/v2/c_api/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,3 @@ endif()
1717
if (BVH_C_API_UNSAFE_CASTS)
1818
target_compile_definitions(bvh_c PRIVATE -DBVH_C_API_UNSAFE_CASTS)
1919
endif()
20-
21-
install(FILES bvh.h DESTINATION include/bvh/v2/c_api/)

0 commit comments

Comments
 (0)