Skip to content

Commit

Permalink
Cleanup the cmake files
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausKlein committed Dec 13, 2024
1 parent 5e6714e commit c6adc57
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
28 changes: 16 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,20 @@ target_sources(
TYPE
HEADERS
BASE_DIRS
src
include)

target_include_directories(
beman.iterator_interface
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME}>
)
# XXX src
${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/include
FILES
${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp
)

# target_include_directories(
# beman.iterator_interface
# PUBLIC
# $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
# $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
# $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME}>
# )

add_subdirectory(src/beman/iterator_interface)
add_subdirectory(include/beman/iterator_interface)
Expand All @@ -100,5 +104,5 @@ add_custom_target(
COMMAND mkdir -p coverage
COMMAND gcovr --config gcovr.cfg .)

install(FILES ${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/beman/iterator_interface)
# install(FILES ${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp
# DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/beman/iterator_interface)
6 changes: 2 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
"name": "_debug-base",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS": "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined"
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "_release-base",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CXX_FLAGS": "-O3"
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
Expand Down
13 changes: 8 additions & 5 deletions include/beman/iterator_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ target_sources(
beman_iterator_interface_headers
TYPE
HEADERS
BASE_DIRS
${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/include
FILES
iterator_interface.hpp
iterator_interface_access.hpp
detail/stl_interfaces/config.hpp
detail/stl_interfaces/fwd.hpp
detail/stl_interfaces/iterator_interface.hpp)
${CMAKE_CURRENT_SOURCE_DIR}/iterator_interface.hpp
${CMAKE_CURRENT_SOURCE_DIR}/iterator_interface_access.hpp
${CMAKE_CURRENT_SOURCE_DIR}/detail/stl_interfaces/config.hpp
${CMAKE_CURRENT_SOURCE_DIR}/detail/stl_interfaces/fwd.hpp
${CMAKE_CURRENT_SOURCE_DIR}/detail/stl_interfaces/iterator_interface.hpp)
2 changes: 1 addition & 1 deletion tests/beman/iterator_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ target_sources(
PRIVATE FILE_SET beman_iterator_interface_tests_headers TYPE HEADERS)

target_link_libraries(
beman.iterator_interface.tests PRIVATE beman::iterator_interface GTest::gtest
beman.iterator_interface.tests PRIVATE beman::iterator_interface # XXX GTest::gtest
GTest::gtest_main)

# [Issue #18](https://github.com/bemanproject/iterator_interface/issues/18): Re-enable ASAN run CI/clang-19.
Expand Down

0 comments on commit c6adc57

Please sign in to comment.