CMake Variables and Options

openPASS uses CMake as default cross-platform build environment. CMake varibles describe configuration settings, which can be overriden by the user. To override any build configuration, the CMake variables have to be provided when CMake gets run.

If available, recommended options are shown in bold.

The following guide is structered as follows: The first part describes the available variables and options. There are standard CMake variables which are marked with the prefix CMAKE_ and other defined variables used internally to further specify the build of openPASS. As the result of a proper CMake call is a Makefile, which then acts as base for the actual build using make, the second part describes best practices around the make commands using make.

Note, this guide approaches CMake from the command line perspective. Adjustments for VSCode and QtCreator can be found under Working with Visual Studio Code and Working with Qt Creator.

See also

CMake Documentation:

CMake Generator

This is only important for Windows. To generate MSYS compatible makefiles use -G "MSYS Makefiles" (c.f. MSYS2).


This variable makes the prerequisites available to openPASS as semicolon-separated list of directories, specifying installation prefixes to be searched by cmake. Please refer to Installing Prerequisites for the list of mandatory packages and libraries. CMake will issue an error, if one prerequisite is missing.

Generally, cmake recognizes installed libraries (e.g. googletest) on its own. By setting an explicit CMAKE_PREFIX_PATH for a library, it is possible to override the system libraries. Use this, when an exact library version, or a customized library shall be used.


In the following example, non-standard libraries are assumed to be in the folder deps/thirdParty.

Example (system libraries not set):

cmake -G "MSYS Makefiles"
      -D <other variables>\


Please also read through USE_CCACHE for further useful hints, e.g. why explicitly setting the MinGW path might be a necessary in some situations.

Installation directory


  • Install directory used by install, when invoking make install

  • Recommendation: /openPASS/bin/core (Linux) | C:/openPASS/bin/core (Windows)


  • Used only in conjunction with Visual Studio Debug Builds (MSVC), as it distinguishes release/debug DLLs by a postfix d.

  • Options: OFF | ON



IDEs, as Qt Creator, might set this variable base on the current build type on their own.



IDEs, as Qt Creator, might set this variable via kit settings.



IDEs, as Qt Creator, might set this variable via kit settings.



  • Activates ccache (see Ccache)

  • Options: ON | OFF


  • Build OSI based scenario simulation, also know as openPASS simulation core (opSimulation).

  • Options: OFF | ON


  • Build sphinx based documentation

  • Options: OFF | ON


  • Build sphinx based developer documentation

  • Options: OFF | ON


Automatically activates WITH_DOC if ON


Building the API doc takes pretty long.


  • Add test targets for code coverage analysis (lcov) and HTML report generation (genhtml)

  • Options: OFF | ON

  • Use COVERAGE_EXCLUDE to remove folders from the analysis


The generated files are placed next to the test executable. Each test will be built without optimization, which will increase the testing run-time.


  • Build unit tests

  • Options: OFF | ON


  • Enables execution of end to end tests using EndToEnd Test Framework.

  • Tests can be ran by executing make install && make pyOpenPASS

  • Options: OFF | ON


  • Adjusts if builds are executed in the (CMake default) folder build or directly in the specified install directory. Latter let you skip the call make install.

  • Options: OFF | ON


When skipping make install, dependencies are not copied into the output folder, which could cause crashes due to missing or outdated libraries.



This feature is only available, if protobuf related libraries are also compiled with arenas (see Build and Install OSI). Fortunately, the implementation falls back to regular allocation if not, which simply results in less performance.


  • during installation step, this configuration copies detected system runtime dependencies to install directory (i.e. MinGW system libraries)

  • Options: ON | OFF


Under windows, automatic resolution might fail if other MinGW instances are installed. As several programs use MinGW under the hood, it is recommended to set the used MinGW path in the CMAKE_PREFIX_PATH explicitly:

CMAKE_PREFIX_PATH = mingw64/bin;\...


  • during installation step, this configuration copies detected runtime dependencies (i.e. required shared libraries) specified in CMAKE_PREFIX_PATH to install directory

  • Options: ON | OFF


  • If ON, opSimulation configuration examples are copied to the examples folder inside the installation directory (during the installation step).

  • Options: ON | OFF

Make Targets/Commands

openPASS defines build targets by major modules or components, such as opSimulation or Algorithm_FmuWrapper. After calling CMake, simply build openPASS by calling make.

Build and Install

  • make

  • make install

  • make <target>: Build a single target

Executing Tests

  • All tests: make test ARGS="--output-on-failure -j3"

  • Single test: make test opSimulation_Tests ARGS="--output-on-failure -j3"