Skip to content

Commit

Permalink
Do not install headers when the project is not top-level
Browse files Browse the repository at this point in the history
  • Loading branch information
madmann91 committed Jan 1, 2025
1 parent 82123ac commit d76b871
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions cmake/Install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ if (BVH_BUILD_C_API)
list(APPEND bvh_targets bvh_c)
endif()

install(
DIRECTORY ${PROJECT_SOURCE_DIR}/src/bvh
DESTINATION include
FILES_MATCHING PATTERN "*.h"
PATTERN "c_api" EXCLUDE)
install(
FILES ${PROJECT_SOURCE_DIR}/src/bvh/v2/c_api/bvh.h
DESTINATION include/bvh/v2/c_api/)
install(
TARGETS ${bvh_targets}
EXPORT bvh_exports
Expand Down
6 changes: 0 additions & 6 deletions src/bvh/v2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ target_include_directories(bvh INTERFACE

set_target_properties(bvh PROPERTIES CXX_STANDARD 20)

install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION include/bvh/v2
FILES_MATCHING PATTERN "*.h"
PATTERN "c_api" EXCLUDE)

if (BVH_BUILD_C_API)
add_subdirectory(c_api)
endif()
2 changes: 0 additions & 2 deletions src/bvh/v2/c_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,3 @@ endif()
if (BVH_C_API_UNSAFE_CASTS)
target_compile_definitions(bvh_c PRIVATE -DBVH_C_API_UNSAFE_CASTS)
endif()

install(FILES bvh.h DESTINATION include/bvh/v2/c_api/)

0 comments on commit d76b871

Please sign in to comment.