From 50723700d253c83e4b68930370c3b0819e529be3 Mon Sep 17 00:00:00 2001 From: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> Date: Tue, 8 Dec 2020 20:09:54 +0100 Subject: Create specification for example section --- manifest-reference.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/manifest-reference.md b/manifest-reference.md index f1394cb..43e20d3 100644 --- a/manifest-reference.md +++ b/manifest-reference.md @@ -260,6 +260,41 @@ executable = [ ``` +### Example targets + +Example applications for a project are defined as *example* sections. +If no example section is specified the ``example`` directory is searched for program definitions. +For explicitly specified examples the *name* entry must always be specified. +The source directory for each example can be adjusted in the *source-dir* entry. +Paths for the source directory are given relative to the project root and use ``/`` as path separator on all platforms. +The source file containing the program body can be specified in the *main* entry. + +Examples can have their own dependencies. +See [specifying dependencies](#specifying-dependencies) for more details. + +> Dependencies supported in Bootstrap fpm only + +Examples can also specify their own external library dependencies. +See [external libraries](#link-external-libraries) for more details. + +> Linking against libraries is supported in Fortran fpm only + +*Example:* + +```toml +[[ example ]] +name = "demo-app" +source-dir = "demo" +main = "program.f90" + +[[ example ]] +name = "example-tool" +link = "z" +[example.dependencies] +helloff = { git = "https://gitlab.com/everythingfunctional/helloff.git" } +``` + + ### Test targets Test targets are Fortran programs defined as *test* sections. -- cgit v1.2.3