This is a template for C++ app developers. You can easily use this template and modify the existing code to suit your needs. It provides an elementary CMake set-up, some useful SeqAn libraries, and an example application.
For requirements, check the Software section of the SeqAn3 Quick Setup.
If you want to build an app, do the following:
- You need to be signed in with a GitHub account.
- Press the
Use this template
-Button to create your own repository. See GitHub's documentation for more information. - Wait for GitHub actions to create a commit in your new repository. The commit message will be
Initialise repository
and it will replace placeholders in the code. Afterwards, the README in your repository will be customised to your repository, among other things.
From here on out, follow the instructions in your repository.
You will probably need to reload your repository page to see the changes.
The instructions below are for the template repository and will not work for your repository.
-
Clone your repository locally:
git clone [email protected]:seqan/app-template.git
-
Build and test the app (example)
In your local repository clone, you can do the following to build and test your app:mkdir build # create build directory cd build # step into build directory cmake .. # call cmake on the repository make # build the app app-template make check # build and run tests ./bin/app-template # Execute the app (prints a short help page)
- Go to https://codecov.io/gh/seqan/app-template.
- Sign in with your GitHub account.
- Go to https://app.codecov.io/gh/seqan/app-template/config/general.
If the repository cannot be found, go to https://app.codecov.io/gh/seqan and clickResync
.
Then try again. - Copy the
Repository Upload Token
. - Go to https://github.com/seqan/app-template/settings/secrets/actions.
- Add a
New repository secret
with the nameCODECOV_TOKEN
and the value of theRepository Upload Token
. - Done! The next push to your repository will create a Codecov report.
- Go to https://github.com/seqan/app-template/settings/actions.
- Under
Workflow permissions
, at the very bottom, tickAllow GitHub Actions to create and approve pull requests
and clickSave
. - You can go to https://github.com/seqan/app-template/actions/workflows/lint.yml and click
Run workflow
to run linting.
If you just some quick hands-on experience with SeqAn Libraries, you can also just clone this repository and start editing the src/main.cpp
file.
If you want to add a new cpp file (e.g., tutorial1.cpp
) that is compiled and linked with the current infrastructure, do the following:
-
Create a new file
tutorial1.cpp
in thesrc/
directory.The file content could look like this:
#include <seqan3/core/debug_stream.hpp> int main() { seqan3::debug_stream << "Hello, World!" << std::endl; }
-
Add the following lines at the bottom of
src/CMakeLists.txt
# Add another cpp file. add_executable (tutorial01 tutorial01.cpp) target_link_libraries (tutorial01 PRIVATE "${PROJECT_NAME}_lib")
-
Go to the build directory
cd build
-
Refresh CMake
cmake .
-
Build your new cpp file
make tutorial01
-
Execute your new binary with
./tutorial01