Skip to content

Commit 7bae844

Browse files
authored
Merge pull request #28 from neatudarius/examples
Apply Beman Standard and add more examples/docs
2 parents c935543 + 4c9339b commit 7bae844

File tree

8 files changed

+562
-328
lines changed

8 files changed

+562
-328
lines changed

CMakeLists.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ option(BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS
2727
"Make use of C++23 \"deducing this\" feature (P0847R7). Turn this off for non-conforming compilers."
2828
${COMPILER_SUPPORTS_DEDUCING_THIS})
2929

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

3336
if(BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS
3437
AND NOT COMPILER_SUPPORTS_DEDUCING_THIS)
@@ -42,8 +45,7 @@ configure_file(
4245
"${PROJECT_SOURCE_DIR}/include/beman/iterator_interface/config.hpp.in"
4346
"${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp" @ONLY)
4447

45-
# Build the tests if enabled via the option ITERATOR_INTERFACE_ENABLE_TESTING
46-
if(ITERATOR_INTERFACE_ENABLE_TESTING)
48+
if(BEMAN_ITERATOR_INTERFACE_BUILD_TESTS)
4749
# Fetch GoogleTest
4850
FetchContent_Declare(
4951
googletest
@@ -79,11 +81,15 @@ target_include_directories(
7981
add_subdirectory(src/beman/iterator_interface)
8082
add_subdirectory(include/beman/iterator_interface)
8183

82-
add_subdirectory(examples)
83-
if(ITERATOR_INTERFACE_ENABLE_TESTING)
84+
if(BEMAN_ITERATOR_INTERFACE_BUILD_TESTS)
85+
enable_testing()
8486
add_subdirectory(tests/beman/iterator_interface)
8587
endif()
8688

89+
if(BEMAN_ITERATOR_INTERFACE_BUILD_EXAMPLES)
90+
add_subdirectory(examples)
91+
endif()
92+
8793
# Coverage
8894
configure_file("cmake/gcovr.cfg.in" gcovr.cfg @ONLY)
8995

0 commit comments

Comments
 (0)