Minimal example
CMake file to find Feel++ and create a minimal application
cmake_minimum_required(VERSION 3.0) (1)
project(minimal) (2)
# find Feel++ package
find_package(Feel++
PATHS
$ENV{FEELPP_DIR}/share/feelpp/feel/cmake/modules
/usr/share/feelpp/feel/cmake/modules
/usr/share/feelpp/cmake/modules
/usr/local/share/feelpp/feel/cmake/modules
REQUIRED) (3)
# create application feelpp_minimal
feelpp_add_application( app SRCS minimal.cpp) (4)
1 | defines the minimal version of CMake to use |
2 | defines the project name |
3 | finds the Feel++ package in the PATHS defined afterwards, it is required that Feel++ is found in order to compile the application |
4 | defines the application feelpp_minimal_app using the following scheme <feelpp>_<project name>_<application name> and the source file minimal.cpp |
To compile you need
-
to define the environment variable
FEELPP_DIR
is Feel++ is not installed in a standard directory prefix such as/usr
or/usr/local
. For example if Feel++ is installed in/opt/feelpp
,export FEELPP_DIR=/opt/feelpp
-
to define a C++ compiler, e.g.
clang++-6.0
, to compile the applicationexport CXX=clang++-6.0
Then, the compilation command line is as follows:
git clone https://github.com/feelpp/minimal.git (1)
mkdir build && cd build (2)
cmake ../minimal (3)
make (4)
1 | git clone the minimal example repository |
2 | create a build directory out of the sources |
3 | call CMake |
4 | build the application feelpp_minimal_app |
1. What’s next ?
The next steps are:
-
start from the minimal or a quickstart application to develop your own Feel++ C++ application.
-
read the reference manual.