Skip to content

Commit 81ded2c

Browse files
authored
Merge pull request #34 from ClausKlein/develop
Cleanup the cmake files
2 parents a4e2837 + 6884b2b commit 81ded2c

File tree

5 files changed

+31
-33
lines changed

5 files changed

+31
-33
lines changed

CMakeLists.txt

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
# cmake-format: on
55

6-
cmake_minimum_required(VERSION 3.27)
6+
cmake_minimum_required(VERSION 3.27...3.31)
77

88
project(
99
beman.iterator_interface
@@ -23,15 +23,19 @@ beman_iterator_check_deducing_this(COMPILER_SUPPORTS_DEDUCING_THIS)
2323

2424
set(TARGETS_EXPORT_NAME ${CMAKE_PROJECT_NAME}Targets)
2525

26-
option(BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS
26+
option(
27+
BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS
2728
"Make use of C++23 \"deducing this\" feature (P0847R7). Turn this off for non-conforming compilers."
2829
${COMPILER_SUPPORTS_DEDUCING_THIS})
2930

30-
option(BEMAN_ITERATOR_INTERFACE_BUILD_TESTS
31-
"Enable building tests and test infrastructure. Default: ON. Values: {ON, OFF}." ${PROJECT_IS_TOP_LEVEL})
31+
option(
32+
BEMAN_ITERATOR_INTERFACE_BUILD_TESTS
33+
"Enable building tests and test infrastructure. Default: ON. Values: {ON, OFF}."
34+
${PROJECT_IS_TOP_LEVEL})
3235

3336
option(BEMAN_ITERATOR_INTERFACE_BUILD_EXAMPLES
34-
"Enable building examples. Default: ON. Values: {ON, OFF}." ${PROJECT_IS_TOP_LEVEL})
37+
"Enable building examples. Default: ON. Values: {ON, OFF}."
38+
${PROJECT_IS_TOP_LEVEL})
3539

3640
if(BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS
3741
AND NOT COMPILER_SUPPORTS_DEDUCING_THIS)
@@ -67,16 +71,10 @@ target_sources(
6771
TYPE
6872
HEADERS
6973
BASE_DIRS
70-
src
71-
include)
72-
73-
target_include_directories(
74-
beman.iterator_interface
75-
PUBLIC
76-
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
77-
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
78-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME}>
79-
)
74+
${PROJECT_BINARY_DIR}/include
75+
${PROJECT_SOURCE_DIR}/include
76+
FILES
77+
${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp)
8078

8179
add_subdirectory(src/beman/iterator_interface)
8280
add_subdirectory(include/beman/iterator_interface)
@@ -99,6 +97,3 @@ add_custom_target(
9997
COMMENT "Running gcovr to process coverage results"
10098
COMMAND mkdir -p coverage
10199
COMMAND gcovr --config gcovr.cfg .)
102-
103-
install(FILES ${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp
104-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/beman/iterator_interface)

CMakePresets.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@
1414
"name": "_debug-base",
1515
"hidden": true,
1616
"cacheVariables": {
17-
"CMAKE_BUILD_TYPE": "Debug",
18-
"CMAKE_CXX_FLAGS": "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined"
17+
"CMAKE_BUILD_TYPE": "Debug"
1918
}
2019
},
2120
{
2221
"name": "_release-base",
2322
"hidden": true,
2423
"cacheVariables": {
25-
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
26-
"CMAKE_CXX_FLAGS": "-O3"
24+
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
2725
}
2826
},
2927
{

Makefile

100755100644
File mode changed.

include/beman/iterator_interface/CMakeLists.txt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55

66
target_sources(
77
beman.iterator_interface
8-
PUBLIC FILE_SET
9-
beman_iterator_interface_headers
10-
TYPE
11-
HEADERS
12-
FILES
13-
iterator_interface.hpp
14-
iterator_interface_access.hpp
15-
detail/stl_interfaces/config.hpp
16-
detail/stl_interfaces/fwd.hpp
17-
detail/stl_interfaces/iterator_interface.hpp)
8+
PUBLIC
9+
FILE_SET
10+
beman_iterator_interface_headers
11+
TYPE
12+
HEADERS
13+
BASE_DIRS
14+
${PROJECT_BINARY_DIR}/include
15+
${PROJECT_SOURCE_DIR}/include
16+
FILES
17+
iterator_interface.hpp
18+
iterator_interface_access.hpp
19+
detail/stl_interfaces/config.hpp
20+
detail/stl_interfaces/fwd.hpp
21+
detail/stl_interfaces/iterator_interface.hpp)

tests/beman/iterator_interface/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ target_link_libraries(
1818
beman.iterator_interface.tests PRIVATE beman::iterator_interface GTest::gtest
1919
GTest::gtest_main)
2020

21-
# [Issue #18](https://github.com/bemanproject/iterator_interface/issues/18): Re-enable ASAN run CI/clang-19.
21+
# [Issue #18](https://github.com/bemanproject/iterator_interface/issues/18):
22+
# Re-enable ASAN run CI/clang-19.
2223
#
2324
# Note: clang-19 + gtest_discover_tests + Asan setup causes errors on some
2425
# platforms. Temporary switch to gtest_add_tests and skip some Asan checks.

0 commit comments

Comments
 (0)