Skip to content

Commit

Permalink
fix: do not add include/roaring to the includes
Browse files Browse the repository at this point in the history
Only add `include/`, so includes must be done as `<roaring/xxx.h>`. Also, fix
an issue where `CMAKE_INSTALL_INCDIR` was referenced, the correct variable is
`CMAKE_INSTALL_INCLUDEDIR`:

https://cmake.org/cmake/help/latest/command/install.html
  • Loading branch information
Dr-Emann committed Sep 5, 2024
1 parent 7d6a387 commit dc48d7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/roaring.pc" DESTINATION ${CMAKE_INSTA

add_library(roaring-headers INTERFACE)
target_include_directories(roaring-headers INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/roaring>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCDIR}>)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
add_library(roaring-headers-cpp INTERFACE)
target_include_directories(roaring-headers-cpp INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cpp>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCDIR}>)
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

####
### Some users want the C++ header files to be installed as well.
Expand All @@ -93,7 +93,7 @@ install(TARGETS roaring-headers roaring-headers-cpp
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCDIR})
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
include(CTest)

##################################
Expand Down
8 changes: 1 addition & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ if(ROARING_DISABLE_NEON)
target_compile_definitions(roaring PUBLIC DISABLENEON=1)
endif(ROARING_DISABLE_NEON)


target_include_directories(roaring
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(roaring PUBLIC roaring-headers)
target_link_libraries(roaring PUBLIC roaring-headers-cpp)
#
Expand All @@ -75,7 +69,7 @@ install(TARGETS roaring
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(EXPORT roaring-config
FILE roaring-config.cmake
Expand Down

0 comments on commit dc48d7c

Please sign in to comment.