添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 can be found under Working with Visual Studio Code .

See also

CMake Documentation: https://cmake.org/cmake/help/latest/index.html

CMake Generator

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

CMAKE_PREFIX_PATH

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 CMAKE_PREFIX_PATH="\
         /mingw64/bin;\
         $PWD/../deps/thirdParty/win64/FMILibrary;\
         $PWD/../deps/thirdParty/win64/osi;\
         $PWD/../deps/thirdParty/win64/minizip;\
      -D <other variables>\