Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Beman Standard and add more examples/docs #28

Merged
merged 15 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 14 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
17 changes: 11 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
neatudarius marked this conversation as resolved.
Show resolved Hide resolved
"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,14 @@ 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)
neatudarius marked this conversation as resolved.
Show resolved Hide resolved
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