We use CMake for building the SeqAn demos, applications and tests. This wiki page explains our usage of CMake, the variables we define and how to extend the build scripts for new demos, apps etc. CMake’s documentation (v2.8) supplements this document. The documentation of CTest (v2.8) could also be of interest.
The CMake files live in projects/library/cmake:
$ cd projects/library/cmake $ tree . |-- CMakeLists.txt |-- apps | `-- CMakeLists.txt |-- demos | `-- CMakeLists.txt |-- seqan | `-- CMakeLists.txt `-- tests |-- CMakeLists.txt `-- CTestConfig.cmake
There is a target for each program to be built.
Additionally, there is a target called Seqan that represents the library. When using the GCC, we need to build the generated forward headers. In this case, Seqan also depends on the generated forward headers and the CMakeList.txt files define how to generate these generated forwards.
The policy is to install these external dependencies on your system and let CMake find them.
The policy for missing dependencies is not to build the programs that depend on them and print an error message.
The process of adding a new demo, test or app is really simple: create a new directory my_app under projects/library/app, ‘’my_test” under projects/test or my_demo under projects/demos. Within this directory create a new file my_app.cpp, my_test.cpp or my_demo.cpp and write your program.
Go to projects/library/cmake in your shell and execute cmake . again. The new target will appear in your IDE. If you use Makefiles then you can now type make my_app, make my_test or make my_demo.