C++ Utilities  4.10.0
Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
Build system

Documents variables to control the build system and provided CMake modules

Variables passable as CMake arguments

Useful variables provided by CMake itself

Custom variables

The following variables are read by the CMake modules provided by c++utilities and qtutilities.

None of these are enabled or set by default, unless stated otherwise.

Variables for specifying location of 3rd party dependencies

The build script tries to find the required dependencies at standard loctions using the CMake functions find_library and find_package. The behaviour of those functions can be controlled by setting some variables, eg. using a toolchain file. Checkout the CMake documentation for this.

If the detection does not work as expected or a library from a non-standard location should be used, the following variables can be used to specify the location of libraries and include directories directly:

Example of passing location of dynamic iconv and zlib to CMake:

/opt/osxcross/bin/x86_64-apple-darwin15-cmake \
-Diconv_DYNAMIC_LIB:FILEPATH=/opt/osxcross/SDK/MacOSX10.11.sdk/usr/lib/libiconv.2.tbd \
-Diconv_DYNAMIC_INCLUDE_DIR:PATH=/opt/osxcross/SDK/MacOSX10.11.sdk/usr/include \
-Dz_DYNAMIC_LIB:FILEPATH=/opt/osxcross/SDK/MacOSX10.11.sdk/usr/lib/libz.1.tbd \
-Dz_DYNAMIC_INCLUDE_DIR:PATH=/opt/osxcross/SDK/MacOSX10.11.sdk/usr/include \
...

Note about Qt: Qt modules must be located via find_package. So using the variables described above to specify a custom location does not work. Instead, the variable CMAKE_PREFIX_PATH can be used to specify the install prefix of the Qt build to use. Set QT_LINKAGE to STATIC if it is a static build of Qt.

Windows specific

MacOS specific

Qt specific

Variables to be set in project file

The following variables are read by the CMake modules provided by c++utilities and qtutilities.

Meta data

Files

Additional build variables

Provided modules

c++utilities and qtutilities provide CMake modules to reduce boilerplate code in the CMake files of my projects. Those modules implement the functionality controlled by the variables documented above. Most important modules are:

Since those modules make use of the variables explained above, the modules must be included after setting those variables. The inclusion order of the modules matters as well.

For an example, checkout the project file of c++utilities itself. The project files of Syncthing Tray should cover everything (library, plugin, application, tests, desktop file, Qt resources and translations, ...).