@@ -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
3336if (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(
7981add_subdirectory (src/beman/iterator_interface)
8082add_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)
8587endif ()
8688
89+ if (BEMAN_ITERATOR_INTERFACE_BUILD_EXAMPLES)
90+ add_subdirectory (examples)
91+ endif ()
92+
8793# Coverage
8894configure_file ("cmake/gcovr.cfg.in" gcovr.cfg @ONLY)
8995
0 commit comments