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
41 changes: 17 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,28 @@ project (SEQAN_STD
DESCRIPTION "Implementation of several C++23/26 views"
)

get_filename_component (SEQAN_STD_DIR_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
if (NOT SEQAN_STD_DIR_NAME STREQUAL "seqan-std")
message (FATAL_ERROR "The directory name must be 'seqan-std'.")
endif ()

file (REAL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/.." SEQAN_STD_INCLUDE_DIR)

add_library (seqan-std INTERFACE)
target_sources (seqan-std INTERFACE
FILE_SET HEADERS
TYPE HEADERS
BASE_DIRS ${SEQAN_STD_INCLUDE_DIR}
BASE_DIRS ${PROJECT_SOURCE_DIR}/include
FILES
${SEQAN_STD_INCLUDE_DIR}/seqan-std/all_view.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/chunk_by_view.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/chunk_view.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/concepts.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/adaptor_base.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/adaptor_for_view_without_args.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/adaptor_from_functor.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/exposition_only.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/movable_box.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/detail/non_propagating_cache.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/enumerate_view.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/join_with_view.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/pair.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/to.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/tuple.hpp
${SEQAN_STD_INCLUDE_DIR}/seqan-std/zip_view.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/all_view.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/chunk_by_view.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/chunk_view.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/concepts.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/detail/adaptor_base.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/detail/adaptor_for_view_without_args.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/detail/adaptor_from_functor.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/detail/exposition_only.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/detail/movable_box.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/detail/non_propagating_cache.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/enumerate_view.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/join_with_view.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/pair.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/to.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/tuple.hpp
${PROJECT_SOURCE_DIR}/include/seqan-std/zip_view.hpp
)
target_compile_features (seqan-std INTERFACE cxx_std_20)
add_library (seqan::std ALIAS seqan-std)
Expand Down
6 changes: 3 additions & 3 deletions all_view.hpp → include/seqan-std/all_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ using std::ranges::views::all_t;

} // namespace seqan::stl::views
#else
# include "concepts.hpp"
# include "detail/adaptor_base.hpp"
# include "detail/exposition_only.hpp"
# include <seqan-std/concepts.hpp>
# include <seqan-std/detail/adaptor_base.hpp>
# include <seqan-std/detail/exposition_only.hpp>

namespace seqan::stl::ranges
{
Expand Down
10 changes: 5 additions & 5 deletions chunk_by_view.hpp → include/seqan-std/chunk_by_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ using std::ranges::views::chunk_by;

#else

# include "all_view.hpp"
# include "concepts.hpp"
# include "detail/adaptor_from_functor.hpp"
# include "detail/movable_box.hpp"
# include "detail/non_propagating_cache.hpp"
# include <seqan-std/all_view.hpp>
# include <seqan-std/concepts.hpp>
# include <seqan-std/detail/adaptor_from_functor.hpp>
# include <seqan-std/detail/movable_box.hpp>
# include <seqan-std/detail/non_propagating_cache.hpp>

namespace seqan::stl::ranges
{
Expand Down
10 changes: 5 additions & 5 deletions chunk_view.hpp → include/seqan-std/chunk_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ using std::ranges::views::chunk;

# include <algorithm>

# include "all_view.hpp"
# include "concepts.hpp"
# include "detail/adaptor_from_functor.hpp"
# include "detail/exposition_only.hpp"
# include "detail/non_propagating_cache.hpp"
# include <seqan-std/all_view.hpp>
# include <seqan-std/concepts.hpp>
# include <seqan-std/detail/adaptor_from_functor.hpp>
# include <seqan-std/detail/exposition_only.hpp>
# include <seqan-std/detail/non_propagating_cache.hpp>

namespace seqan::stl::detail::chunk
{
Expand Down
2 changes: 1 addition & 1 deletion concepts.hpp → include/seqan-std/concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using std::ranges::viewable_range;

}
#else
# include "detail/exposition_only.hpp"
# include <seqan-std/detail/exposition_only.hpp>
namespace seqan::stl::ranges
{

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifndef SEQAN_STD_DETAIL_ADAPTOR_FOR_VIEW_WITHOUT_ARGS
#define SEQAN_STD_DETAIL_ADAPTOR_FOR_VIEW_WITHOUT_ARGS

#include "adaptor_base.hpp"
#include <seqan-std/detail/adaptor_base.hpp>

namespace seqan::stl::detail
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#ifndef SEQAN_STD_DETAIL_ADAPTOR_FROM_FUNCTOR
#define SEQAN_STD_DETAIL_ADAPTOR_FROM_FUNCTOR

#include "adaptor_base.hpp"
#include <seqan-std/detail/adaptor_base.hpp>

namespace seqan::stl::detail
{
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions enumerate_view.hpp → include/seqan-std/enumerate_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ using std::ranges::views::enumerate;

#else

# include "all_view.hpp"
# include "concepts.hpp"
# include "detail/adaptor_from_functor.hpp"
# include "detail/exposition_only.hpp"
# include <seqan-std/all_view.hpp>
# include <seqan-std/concepts.hpp>
# include <seqan-std/detail/adaptor_from_functor.hpp>
# include <seqan-std/detail/exposition_only.hpp>

namespace seqan::stl::ranges
{
Expand Down
10 changes: 5 additions & 5 deletions join_with_view.hpp → include/seqan-std/join_with_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ using std::ranges::views::join_with;

# include <variant>

# include "all_view.hpp"
# include "concepts.hpp"
# include "detail/adaptor_from_functor.hpp"
# include "detail/exposition_only.hpp"
# include "detail/non_propagating_cache.hpp"
# include <seqan-std/all_view.hpp>
# include <seqan-std/concepts.hpp>
# include <seqan-std/detail/adaptor_from_functor.hpp>
# include <seqan-std/detail/exposition_only.hpp>
# include <seqan-std/detail/non_propagating_cache.hpp>

namespace seqan::stl::detail::join_with
{
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion to.hpp → include/seqan-std/to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using std::ranges::to;

# include <algorithm>

# include "detail/adaptor_from_functor.hpp"
# include <seqan-std/detail/adaptor_from_functor.hpp>

namespace seqan::stl
{
Expand Down
4 changes: 2 additions & 2 deletions tuple.hpp → include/seqan-std/tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ using std::tuple;

#else

# include "detail/exposition_only.hpp"
# include "pair.hpp"
# include <seqan-std/detail/exposition_only.hpp>
# include <seqan-std/pair.hpp>

namespace seqan::stl
{
Expand Down
10 changes: 5 additions & 5 deletions zip_view.hpp → include/seqan-std/zip_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ using std::ranges::views::zip;
# include <algorithm>
# include <functional>

# include "all_view.hpp"
# include "concepts.hpp"
# include "detail/exposition_only.hpp"
# include "pair.hpp"
# include "tuple.hpp"
# include <seqan-std/all_view.hpp>
# include <seqan-std/concepts.hpp>
# include <seqan-std/detail/exposition_only.hpp>
# include <seqan-std/pair.hpp>
# include <seqan-std/tuple.hpp>

namespace seqan::stl::detail::zip
{
Expand Down
3 changes: 2 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ target_link_libraries (${target} seqan-std_test)
add_test (NAME "header/${target}" COMMAND ${target})

get_target_property (header_files seqan-std HEADER_SET_HEADERS)
get_target_property (include_dir seqan-std HEADER_DIRS)
foreach (absolute_header_path ${header_files})
file (RELATIVE_PATH header "${SEQAN_STD_INCLUDE_DIR}" "${absolute_header_path}")
file (RELATIVE_PATH header "${include_dir}" "${absolute_header_path}")
get_filename_component (header_test_name "${absolute_header_path}" NAME_WE)

foreach (header_sub_test "header-guard" "no-self-include")
Expand Down
3 changes: 0 additions & 3 deletions test/generate_header_source.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ if (HEADER_SUB_TEST STREQUAL "no-self-include")

string (REGEX REPLACE "#[a-z]+ +(// +)?SEQAN_STD[A-Z_]+\n" "" header_content "${header_content}")

string (REPLACE "#include \"adaptor_base.hpp\"" "#include <seqan-std/detail/adaptor_base.hpp>" header_content "${header_content}")
string (REGEX REPLACE "include \"([a-z_./]+)\"" "include <seqan-std/\\1>" header_content "${header_content}")

file (APPEND "${HEADER_TARGET_SOURCE}"
"// header-test-no-self-include-start\n"
"${header_content}\n"
Expand Down
Loading