Skip to content

[INFRA] Proper project#8

Merged
eseiler merged 1 commit intoseqan:mainfrom
eseiler:infra/package
Aug 20, 2025
Merged

[INFRA] Proper project#8
eseiler merged 1 commit intoseqan:mainfrom
eseiler:infra/package

Conversation

@eseiler
Copy link
Member

@eseiler eseiler commented Aug 20, 2025

This PR:

  • Makes seqan-std a CMake project
  • seqan-std can now be added via CPM

In #9, I also added CI. I did have to make a separate PR for that to make the actions run on this PR.
It is a simple compile/header test:

  • Including a header twice does not cause errors (include guard check)
  • A header does not include itself (Compile a file with the header content and remove the include guard. If it includes itself/the original header, there will be multiple-definition-errors.)

Follow-up

I think I'll also change the test's main.cpp to include all headers in a follow-up PR. This way, we would catch if some headers have the same include guards.
I'll also try to add a test that checks whether the FILE_SET HEADERS does indeed contain all headers.

Comments

Why

Instead of adding an include/seqan-std directory, I opted for:

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)

That is, the parent directory is the include directory. It allows for, e.g.

#include <seqan-std/chunk_view.hpp>

I haven't found any sources on whether this is considered bad style or not.

Alternative 1

I also tried to use an include/seqan-std directory. For CPM-usage that works just as fine.
The main disadvantage is that it's not trivial to use seqan-std as git subtree in seqan3 and hibf.

  • Either:
    The includes would need to be
    #include <seqan3/contrib/seqan-std/include/seqan-std/chunk_view.hpp>
  • Or:
    We would need to add seqan3/contrib/seqan-std to the include path.

I don't like either option much.
By keeping the headers in the top-level directory, we don't need to change anything about the git subtree usage.

Alternative 2

An alternative would be to just include seqan-std via CPM.
But because we do not install seqan-std, we would have to ship it in our source packages or when installing seqan3/hibf.

Here is what this would look like: eseiler/seqan3@713ca0e
And here is a patch for posterity: seqan3_use_seqan-std_via_CPM.patch
While it works, it's far too much complexity.

@eseiler eseiler force-pushed the infra/package branch 5 times, most recently from 4210702 to 9eb5882 Compare August 20, 2025 15:15
@eseiler eseiler enabled auto-merge August 20, 2025 15:20
@eseiler eseiler merged commit fd3f552 into seqan:main Aug 20, 2025
81 checks passed
@eseiler eseiler deleted the infra/package branch August 20, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant