Skip to content

Commit

Permalink
Merge pull request #28 from neatudarius/examples
Browse files Browse the repository at this point in the history
Apply Beman Standard and add more examples/docs
  • Loading branch information
neatudarius authored Nov 15, 2024
2 parents c935543 + 4c9339b commit 7bae844
Show file tree
Hide file tree
Showing 8 changed files with 562 additions and 328 deletions.
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

0 comments on commit 7bae844

Please sign in to comment.