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
19 changes: 0 additions & 19 deletions .github/workflows/cookiecutter_test.yml

This file was deleted.

33 changes: 25 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.25)
cmake_minimum_required(VERSION 3.28...4.2)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR coming for examplar to update this -- 3.28 is minimum for modules and should be our standard now. We've decided range for cmake is best practice


project(
beman.take_before # CMake Project Name, which is also the name of the top-level
# targets (e.g., library, executable, etc.).
DESCRIPTION "A Beman Library for take_before"
beman.take_before
DESCRIPTION "take_before_view"
LANGUAGES CXX
VERSION 2.2.1
VERSION 0.0.1
)

# gersemi: off

# [CMAKE.SKIP_TESTS]
option(
BEMAN_TAKE_BEFORE_BUILD_TESTS
Expand All @@ -24,12 +25,28 @@ option(
${PROJECT_IS_TOP_LEVEL}
)

include(CTest)

add_subdirectory(src/beman/take_before)
add_library(beman.take_before INTERFACE)
target_sources(
beman.take_before
INTERFACE
FILE_SET HEADERS
BASE_DIRS include
FILES include/beman/take_before/take_before.hpp
)

add_library(beman::take_before ALIAS beman.take_before)
set_target_properties(beman.take_before PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)

set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/infra/cmake)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?



find_package(beman-install-library REQUIRED)
beman_install_library(beman.take_before)

if(BEMAN_TAKE_BEFORE_BUILD_TESTS)
add_subdirectory(tests/beman/take_before)
enable_testing()
add_subdirectory(tests/beman/take_before)
endif()

if(BEMAN_TAKE_BEFORE_BUILD_EXAMPLES)
Expand Down
21 changes: 5 additions & 16 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

set(ALL_EXAMPLES take_before_direct_usage)

# Example `take_before_as_default_projection` need ranges support:
include(CheckCXXSymbolExists)
check_cxx_symbol_exists(__cpp_lib_ranges "ranges" HAS_RANGES)
# gersemi: off

if(HAS_RANGES)
list(APPEND ALL_EXAMPLES take_before_as_default_projection)
else()
message(
WARNING
"Missing range support! Skip: take_before_as_default_projection"
)
endif()
set(ALL_EXAMPLES take_before_direct_usage)

message("Examples to be built: ${ALL_EXAMPLES}")

foreach(example ${ALL_EXAMPLES})
add_executable(beman.take_before.examples.${example})
target_sources(beman.take_before.examples.${example} PRIVATE ${example}.cpp)
add_executable(${example})
target_sources(${example} PRIVATE ${example}.cpp)
target_link_libraries(
beman.take_before.examples.${example}
${example}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplifies naming before

jeff@ub25-04:~/dev/take_before/build$ ls -ltr examples/
total 196
-rwxrwxr-x 1 jeff jeff 92448 Dec 25 08:13 beman.take_before.examples.take_before_as_default_projection
-rwxrwxr-x 1 jeff jeff 89344 Dec 25 08:13 beman.take_before.examples.take_before_direct_usage

after:

-rwxrwxr-x 1 jeff jeff 92448 Dec 25 08:16 take_before_as_default_projection
-rwxrwxr-x 1 jeff jeff 89344 Dec 25 08:16 take_before_direct_usage

PRIVATE beman::take_before
)
endforeach()
2 changes: 2 additions & 0 deletions examples/take_before_direct_usage.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <beman/take_before/take_before.hpp>

#include <iostream>
Expand Down
6 changes: 6 additions & 0 deletions include/beman/take_before/take_before.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
#include <type_traits>
#include <utility>

// clang-format off
#if __cpp_concepts > 202002L
#error "C++20 concepts is required"
#endif
// clang-format on
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also needs to be added to our best practices -- give a nice user error if the CXX version isn't high enough


namespace beman::take_before {

// ============================================================================
Expand Down
23 changes: 0 additions & 23 deletions src/beman/take_before/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/beman/take_before/take_before.cpp

This file was deleted.

10 changes: 5 additions & 5 deletions tests/beman/take_before/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

find_package(GTest REQUIRED)
find_package(GTest QUIET)

add_executable(beman.take_before.tests.take_before)
target_sources(beman.take_before.tests.take_before PRIVATE take_before.test.cpp)
add_executable(beman_take_before.test)
target_sources(beman_take_before.test PRIVATE take_before.test.cpp)
target_link_libraries(
beman.take_before.tests.take_before
beman_take_before.test
PRIVATE beman::take_before GTest::gtest GTest::gtest_main
)

include(GoogleTest)
gtest_discover_tests(beman.take_before.tests.take_before)
gtest_discover_tests(beman_take_before.test)
2 changes: 2 additions & 0 deletions tests/beman/take_before/take_before.test.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <beman/take_before/take_before.hpp>

#include <gtest/gtest.h>
Expand Down