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.
Screenshot TODO
-
Clone your repository locally:
git clone git@github.com:max/my-repo-name.git
Note: The subsequent steps are not necessary but a recommendation and quick setup.
-
Adapt the project name in
my-repo-name/CMakeLists.txt
, e.g., fromapp-template
toMyDragonApp
The project name is defined in these lines:
project (app-template LANGUAGES CXX VERSION 1.0.0 DESCRIPTION "My application description" )
Change it e.g. to this:
project (MyDragonApp LANGUAGES CXX VERSION 1.0.0 DESCRIPTION "Let dragons fly" )
-
Build and test the app (example)
Next to your local repository clone (e.g.
my-repo-name
), you can do the following to build and test your app:mkdir build # create build directory cd build # step into build directory cmake ../my-repo-name # call cmake on the repository make # build the app MyDragonApp make check # build and run tests *1 ./bin/MyDragonApp # Execute the app (prints a short help page)
If you just want some hands-on experience with SeqAn Libraries or a quick setup for our tutorials, do the following:
- Clone this repository:
git clone https://github.com/seqan/app-template.git
- Create a build directory and visit it:
mkdir build && cd build
- Run CMake:
cmake ../app-template
- Build the application:
make
- Try executing the app:
./bin/app-template
You can now start your hands-on experience by looking at or editing the file src/main.cpp
.
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