Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ option(BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS
"Make use of C++23 \"deducing this\" feature (P0847R7). Turn this off for non-conforming compilers."
${COMPILER_SUPPORTS_DEDUCING_THIS})

option(ITERATOR_INTERFACE_ENABLE_TESTING
"Enable building tests and test infrastructure" ${PROJECT_IS_TOP_LEVEL})
option(BEMAN_ITERATOR_INTERFACE_BUILD_TESTS
"Enable building tests and test infrastructure. Default: ON. Values: {ON, OFF}." ${PROJECT_IS_TOP_LEVEL})

option(BEMAN_ITERATOR_INTERFACE_BUILD_EXAMPLES
"Enable building examples. Default: ON. Values: {ON, OFF}." ${PROJECT_IS_TOP_LEVEL})

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

# Build the tests if enabled via the option ITERATOR_INTERFACE_ENABLE_TESTING
if(ITERATOR_INTERFACE_ENABLE_TESTING)
if(BEMAN_ITERATOR_INTERFACE_BUILD_TESTS)
# Fetch GoogleTest
FetchContent_Declare(
googletest
Expand Down Expand Up @@ -79,11 +81,15 @@ target_include_directories(
add_subdirectory(src/beman/iterator_interface)
add_subdirectory(include/beman/iterator_interface)

add_subdirectory(examples)
if(ITERATOR_INTERFACE_ENABLE_TESTING)
if(BEMAN_ITERATOR_INTERFACE_BUILD_TESTS)
enable_testing()
add_subdirectory(tests/beman/iterator_interface)
endif()

if(BEMAN_ITERATOR_INTERFACE_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

# Coverage
configure_file("cmake/gcovr.cfg.in" gcovr.cfg @ONLY)

Expand Down
Loading
Loading