cmake-variables man page

cmake-variables — CMake Variables Reference

Variables That Provide Information

Cmake_argc

Number of command line arguments passed to CMake in script mode.

When run in -P script mode, CMake sets this variable to the number of command line arguments. See also Cmake_argv0, 1, 2 ...

Cmake_argv0

Command line argument passed to CMake in script mode.

When run in -P script mode, CMake sets this variable to the first command line argument. It then also sets CMAKE_ARGV1, CMAKE_ARGV2, ... and so on, up to the number of command line arguments given. See also Cmake_argc.

Cmake_ar

Name of archiving tool for static libraries.

This specifies the name of the program that creates archive or static libraries.

Cmake_binary_dir

The path to the top level of the build tree.

This is the full path to the top level of the current CMake build tree. For an in-source build, this would be the same as Cmake_source_dir.

When run in -P script mode, CMake sets the variables Cmake_binary_dir, Cmake_source_dir, Cmake_current_binary_dir and Cmake_current_source_dir to the current working directory.

Cmake_build_tool

This variable exists only for backwards compatibility. It contains the same value as Cmake_make_program. Use that variable instead.

Cmake_cachefile_dir

The directory with the CMakeCache.txt file.

This is the full path to the directory that has the CMakeCache.txt file in it. This is the same as Cmake_binary_dir.

Cmake_cache_major_version

Major version of CMake used to create the CMakeCache.txt file

This stores the major version of CMake used to write a CMake cache file. It is only different when a different version of CMake is run on a previously created cache file.

Cmake_cache_minor_version

Minor version of CMake used to create the CMakeCache.txt file

This stores the minor version of CMake used to write a CMake cache file. It is only different when a different version of CMake is run on a previously created cache file.

Cmake_cache_patch_version

Patch version of CMake used to create the CMakeCache.txt file

This stores the patch version of CMake used to write a CMake cache file. It is only different when a different version of CMake is run on a previously created cache file.

Cmake_cfg_intdir

Build-time reference to per-configuration output subdirectory.

For native build systems supporting multiple configurations in the build tree (such as Visual Studio Generators and Xcode), the value is a reference to a build-time variable specifying the name of the per-configuration output subdirectory. On Makefile Generators this evaluates to . because there is only one configuration in a build tree. Example values:

$(ConfigurationName) = Visual Studio 7, 8, 9
$(Configuration)     = Visual Studio 10
$(CONFIGURATION)     = Xcode
.                    = Make-based tools

Since these values are evaluated by the native build system, this variable is suitable only for use in command lines that will be evaluated at build time. Example of intended usage:

add_executable(mytool mytool.c)
add_custom_command(
  OUTPUT out.txt
  COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mytool
          ${CMAKE_CURRENT_SOURCE_DIR}/in.txt out.txt
  DEPENDS mytool in.txt
  )
add_custom_target(drive ALL DEPENDS out.txt)

Note that Cmake_cfg_intdir is no longer necessary for this purpose but has been left for compatibility with existing projects. Instead add_custom_command() recognizes executable target names in its COMMAND option, so ${Cmake_current_binary_dir}/${Cmake_cfg_intdir}/mytool can be replaced by just mytool.

This variable is read-only. Setting it is undefined behavior. In multi-configuration build systems the value of this variable is passed as the value of preprocessor symbol CMAKE_INTDIR to the compilation of all source files.

Cmake_command

The full path to the cmake(1) executable.

This is the full path to the CMake executable cmake(1) which is useful from custom commands that want to use the cmake -E option for portable system commands. (e.g. /usr/local/bin/cmake)

Cmake_crosscompiling

Is CMake currently cross compiling.

This variable will be set to true by CMake if CMake is cross compiling. Specifically if the build platform is different from the target platform.

Cmake_crosscompiling_emulator

This variable is only used when Cmake_crosscompiling is on. It should point to a command on the host system that can run executable built for the target system.

The command will be used to run try_run() generated executables, which avoids manual population of the TryRunResults.cmake file.

It is also used as the default value for the CROSSCOMPILING_EMULATOR target property of executables.

Cmake_ctest_command

Full path to ctest(1) command installed with CMake.

This is the full path to the CTest executable ctest(1) which is useful from custom commands that want to use the cmake(1) -E option for portable system commands.

Cmake_current_binary_dir

The path to the binary directory currently being processed.

This the full path to the build directory that is currently being processed by cmake. Each directory added by add_subdirectory() will create a binary directory in the build tree, and as it is being processed this variable will be set. For in-source builds this is the current source directory being processed.

When run in -P script mode, CMake sets the variables Cmake_binary_dir, Cmake_source_dir, Cmake_current_binary_dir and Cmake_current_source_dir to the current working directory.

Cmake_current_list_dir

Full directory of the listfile currently being processed.

As CMake processes the listfiles in your project this variable will always be set to the directory where the listfile which is currently being processed (Cmake_current_list_file) is located. The value has dynamic scope. When CMake starts processing commands in a source file it sets this variable to the directory where this file is located. When CMake finishes processing commands from the file it restores the previous value. Therefore the value of the variable inside a macro or function is the directory of the file invoking the bottom-most entry on the call stack, not the directory of the file containing the macro or function definition.

See also Cmake_current_list_file.

Cmake_current_list_file

Full path to the listfile currently being processed.

As CMake processes the listfiles in your project this variable will always be set to the one currently being processed. The value has dynamic scope. When CMake starts processing commands in a source file it sets this variable to the location of the file. When CMake finishes processing commands from the file it restores the previous value. Therefore the value of the variable inside a macro or function is the file invoking the bottom-most entry on the call stack, not the file containing the macro or function definition.

See also Cmake_parent_list_file.

Cmake_current_list_line

The line number of the current file being processed.

This is the line number of the file currently being processed by cmake.

Cmake_current_source_dir

The path to the source directory currently being processed.

This the full path to the source directory that is currently being processed by cmake.

When run in -P script mode, CMake sets the variables Cmake_binary_dir, Cmake_source_dir, Cmake_current_binary_dir and Cmake_current_source_dir to the current working directory.

Cmake_dl_libs

Name of library containing dlopen and dlcose.

The name of the library that has dlopen and dlclose in it, usually -ldl on most Unix machines.

Cmake_edit_command

Full path to cmake-gui(1) or ccmake(1). Defined only for Makefile Generators when not using an "extra" generator for an IDE.

This is the full path to the CMake executable that can graphically edit the cache. For example, cmake-gui(1) or ccmake(1).

Cmake_executable_suffix

The suffix for executables on this platform.

The suffix to use for the end of an executable filename if any, .exe on Windows.

CMAKE_EXECUTABLE_SUFFIX_<LANG> overrides this for language <LANG>.

Cmake_extra_generator

The extra generator used to build the project. See cmake-generators(7).

When using the Eclipse, CodeBlocks or KDevelop generators, CMake generates Makefiles (Cmake_generator) and additionally project files for the respective IDE. This IDE project file generator is stored in Cmake_extra_generator (e.g. Eclipse CDT4).

Cmake_extra_shared_library_suffixes

Additional suffixes for shared libraries.

Extensions for shared libraries other than that specified by Cmake_shared_library_suffix, if any. CMake uses this to recognize external shared library files during analysis of libraries linked by a target.

Cmake_find_package_name

Defined by the find_package() command while loading a find module to record the caller-specified package name. See command documentation for details.

Cmake_find_package_sort_direction

The sorting direction used by Cmake_find_package_sort_order. It can assume one of the following values:

DEC
Default. Ordering is done in descending mode. The highest folder found will be tested first.
ASC
Ordering is done in ascending mode. The lowest folder found will be tested first.

If Cmake_find_package_sort_order is not set or is set to NONE this variable has no effect.

Cmake_find_package_sort_order

The default order for sorting packages found using find_package(). It can assume one of the following values:

NONE
Default. No attempt is done to sort packages. The first valid package found will be selected.
NAME
Sort packages lexicographically before selecting one.
NATURAL
Sort packages using natural order (see strverscmp(3) manual), i.e. such that contiguous digits are compared as whole numbers.

Natural sorting can be employed to return the highest version when multiple versions of the same library are found by find_package(). For example suppose that the following libraries have been found:

·
libX-1.1.0
·
libX-1.2.9
·
libX-1.2.10

By setting NATURAL order we can select the one with the highest version number libX-1.2.10.

set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
find_package(libX CONFIG)

The sort direction can be controlled using the Cmake_find_package_sort_direction variable (by default decrescent, e.g. lib-B will be tested before lib-A).

Cmake_generator

The generator used to build the project. See cmake-generators(7).

The name of the generator that is being used to generate the build files. (e.g. Unix Makefiles, Ninja, etc.)

Cmake_generator_platform

Generator-specific target platform name specified by user.

Some CMake generators support a target platform name to be given to the native build system to choose a compiler toolchain. If the user specifies a platform name (e.g. via the cmake(1) -A option) the value will be available in this variable.

The value of this variable should never be modified by project code. A toolchain file specified by the Cmake_toolchain_file variable may initialize Cmake_generator_platform. Once a given build tree has been initialized with a particular value for this variable, changing the value has undefined behavior.

Cmake_generator_toolset

Native build system toolset name specified by user.

Some CMake generators support a toolset name to be given to the native build system to choose a compiler. If the user specifies a toolset name (e.g. via the cmake(1) -T option) the value will be available in this variable.

The value of this variable should never be modified by project code. A toolchain file specified by the Cmake_toolchain_file variable may initialize Cmake_generator_toolset. Once a given build tree has been initialized with a particular value for this variable, changing the value has undefined behavior.

Cmake_home_directory

Path to top of source tree.

This is the path to the top level of the source tree.

Cmake_import_library_prefix

The prefix for import libraries that you link to.

The prefix to use for the name of an import library if used on this platform.

CMAKE_IMPORT_LIBRARY_PREFIX_<LANG> overrides this for language <LANG>.

Cmake_import_library_suffix

The suffix for import libraries that you link to.

The suffix to use for the end of an import library filename if used on this platform.

CMAKE_IMPORT_LIBRARY_SUFFIX_<LANG> overrides this for language <LANG>.

Cmake_job_pool_compile

This variable is used to initialize the JOB_POOL_COMPILE property on all the targets. See JOB_POOL_COMPILE for additional information.

Cmake_major_version

First version number component of the Cmake_version variable.

Cmake_make_program

Tool that can launch the native build system. The value may be the full path to an executable or just the tool name if it is expected to be in the PATH.

The tool selected depends on the Cmake_generator used to configure the project:

·
The Makefile Generators set this to make, gmake, or a generator-specific tool (e.g. nmake for NMake Makefiles).

These generators store Cmake_make_program in the CMake cache so that it may be edited by the user.
·
The Ninja generator sets this to ninja.

This generator stores Cmake_make_program in the CMake cache so that it may be edited by the user.
·
The Xcode generator sets this to xcodebuild (or possibly an otherwise undocumented cmakexbuild wrapper implementing some workarounds).

This generator prefers to lookup the build tool at build time rather than to store Cmake_make_program in the CMake cache ahead of time. This is because xcodebuild is easy to find, the cmakexbuild wrapper is needed only for older Xcode versions, and the path to cmakexbuild may be outdated if CMake itself moves.

For compatibility with versions of CMake prior to 3.2, if a user or project explicitly adds Cmake_make_program to the CMake cache then CMake will use the specified value.
·
The Visual Studio Generators set this to the full path to MSBuild.exe (VS >= 10), devenv.com (VS 7,8,9), or VCExpress.exe (VS Express 8,9). (See also variables Cmake_vs_msbuild_command and Cmake_vs_devenv_command.

These generators prefer to lookup the build tool at build time rather than to store Cmake_make_program in the CMake cache ahead of time. This is because the tools are version-specific and can be located using the Windows Registry. It is also necessary because the proper build tool may depend on the project content (e.g. the Intel Fortran plugin to VS 10 and 11 requires devenv.com to build its .vfproj project files even though MSBuild.exe is normally preferred to support the Cmake_generator_toolset).

For compatibility with versions of CMake prior to 3.0, if a user or project explicitly adds Cmake_make_program to the CMake cache then CMake will use the specified value if possible.
·
The Green Hills MULTI generator sets this to gbuild. If a user or project explicitly adds Cmake_make_program to the CMake cache then CMake will use the specified value.

The Cmake_make_program variable is set for use by project code. The value is also used by the cmake(1) --build and ctest(1) --build-and-test tools to launch the native build process.

Cmake_match_count

The number of matches with the last regular expression.

When a regular expression match is used, CMake fills in CMAKE_MATCH_<n> variables with the match contents. The Cmake_match_count variable holds the number of match expressions when these are filled.

Cmake_minimum_required_version

Version specified to cmake_minimum_required() command

Variable containing the VERSION component specified in the cmake_minimum_required() command.

Cmake_minor_version

Second version number component of the Cmake_version variable.

Cmake_parent_list_file

Full path to the CMake file that included the current one.

While processing a CMake file loaded by include() or find_package() this variable contains the full path to the file including it. The top of the include stack is always the CMakeLists.txt for the current directory. See also Cmake_current_list_file.

Cmake_patch_version

Third version number component of the Cmake_version variable.

Cmake_project_name

The name of the current project.

This specifies name of the current project from the closest inherited project() command.

Cmake_ranlib

Name of randomizing tool for static libraries.

This specifies name of the program that randomizes libraries on Unix, not used on Windows, but may be present.

Cmake_root

Install directory for running cmake.

This is the install root for the running CMake and the Modules directory can be found here. This is commonly used in this format: ${Cmake_root}/Modules

Cmake_script_mode_file

Full path to the cmake(1) -P script file currently being processed.

When run in cmake(1) -P script mode, CMake sets this variable to the full path of the script file. When run to configure a CMakeLists.txt file, this variable is not set.

Cmake_shared_library_prefix

The prefix for shared libraries that you link to.

The prefix to use for the name of a shared library, lib on Unix.

CMAKE_SHARED_LIBRARY_PREFIX_<LANG> overrides this for language <LANG>.

Cmake_shared_library_suffix

The suffix for shared libraries that you link to.

The suffix to use for the end of a shared library filename, .dll on Windows.

CMAKE_SHARED_LIBRARY_SUFFIX_<LANG> overrides this for language <LANG>.

Cmake_shared_module_prefix

The prefix for loadable modules that you link to.

The prefix to use for the name of a loadable module on this platform.

CMAKE_SHARED_MODULE_PREFIX_<LANG> overrides this for language <LANG>.

Cmake_shared_module_suffix

The suffix for shared libraries that you link to.

The suffix to use for the end of a loadable module filename on this platform

CMAKE_SHARED_MODULE_SUFFIX_<LANG> overrides this for language <LANG>.

Cmake_sizeof_void_p

Size of a void pointer.

This is set to the size of a pointer on the target machine, and is determined by a try compile. If a 64-bit size is found, then the library search path is modified to look for 64-bit libraries first.

Cmake_skip_install_rules

Whether to disable generation of installation rules.

If TRUE, cmake will neither generate installaton rules nor will it generate cmake_install.cmake files. This variable is FALSE by default.

Cmake_skip_rpath

If true, do not add run time path information.

If this is set to TRUE, then the rpath information is not added to compiled executables. The default is to add rpath information if the platform supports it. This allows for easy running from the build tree. To omit RPATH in the install step, but not the build step, use Cmake_skip_install_rpath instead.

Cmake_source_dir

The path to the top level of the source tree.

This is the full path to the top level of the current CMake source tree. For an in-source build, this would be the same as Cmake_binary_dir.

When run in -P script mode, CMake sets the variables Cmake_binary_dir, Cmake_source_dir, Cmake_current_binary_dir and Cmake_current_source_dir to the current working directory.

Cmake_static_library_prefix

The prefix for static libraries that you link to.

The prefix to use for the name of a static library, lib on Unix.

CMAKE_STATIC_LIBRARY_PREFIX_<LANG> overrides this for language <LANG>.

Cmake_static_library_suffix

The suffix for static libraries that you link to.

The suffix to use for the end of a static library filename, .lib on Windows.

CMAKE_STATIC_LIBRARY_SUFFIX_<LANG> overrides this for language <LANG>.

Cmake_toolchain_file

Path to toolchain file supplied to cmake(1).

This variable is specified on the command line when cross-compiling with CMake. It is the path to a file which is read early in the CMake run and which specifies locations for compilers and toolchain utilities, and other target platform and compiler related information.

Cmake_tweak_version

Defined to 0 for compatibility with code written for older CMake versions that may have defined higher values.

NOTE:

In CMake versions 2.8.2 through 2.8.12, this variable holds the fourth version number component of the Cmake_version variable.

Cmake_verbose_makefile

Enable verbose output from Makefile builds.

This variable is a cache entry initialized (to FALSE) by the project() command. Users may enable the option in their local build tree to get more verbose output from Makefile builds and show each command line as it is launched.

Cmake_version

The CMake version string as three non-negative integer components separated by . and possibly followed by - and other information. The first two components represent the feature level and the third component represents either a bug-fix level or development date.

Release versions and release candidate versions of CMake use the format:

<major>.<minor>.<patch>[-rc<n>]

where the <patch> component is less than 20000000. Development versions of CMake use the format:

<major>.<minor>.<date>[-<id>]

where the <date> component is of format CCYYMMDD and <id> may contain arbitrary text. This represents development as of a particular date following the <major>.<minor> feature release.

Individual component values are also available in variables:

·
Cmake_major_version
·
Cmake_minor_version
·
Cmake_patch_version
·
Cmake_tweak_version

Use the if() command VERSION_LESS, VERSION_GREATER, VERSION_EQUAL, VERSION_LESS_EQUAL, or VERSION_GREATER_EQUAL operators to compare version string values against Cmake_version using a component-wise test. Version component values may be 10 or larger so do not attempt to compare version strings as floating-point numbers.

NOTE:

CMake versions 2.8.2 through 2.8.12 used three components for the feature level. Release versions represented the bug-fix level in a fourth component, i.e. <major>.<minor>.<patch>[.<tweak>][-rc<n>]. Development versions represented the development date in the fourth component, i.e. <major>.<minor>.<patch>.<date>[-<id>].

CMake versions prior to 2.8.2 used three components for the feature level and had no bug-fix component. Release versions used an even-valued second component, i.e. <major>.<even-minor>.<patch>[-rc<n>]. Development versions used an odd-valued second component with the development date as the third component, i.e. <major>.<odd-minor>.<date>.

The Cmake_version variable is defined by CMake 2.6.3 and higher. Earlier versions defined only the individual component variables.

Cmake_vs_devenv_command

The generators for Visual Studio 7 and above set this variable to the devenv.com command installed with the corresponding Visual Studio version. Note that this variable may be empty on Visual Studio Express editions because they do not provide this tool.

This variable is not defined by other generators even if devenv.com is installed on the computer.

The Cmake_vs_msbuild_command is also provided for Visual Studio 10 2010 and above. See also the Cmake_make_program variable.

CMAKE_VS_INTEL_Fortran_PROJECT_VERSION

When generating for Visual Studio 7 or greater with the Intel Fortran plugin installed, this specifies the .vfproj project file format version. This is intended for internal use by CMake and should not be used by project code.

Cmake_vs_msbuild_command

The generators for Visual Studio 10 2010 and above set this variable to the MSBuild.exe command installed with the corresponding Visual Studio version.

This variable is not defined by other generators even if MSBuild.exe is installed on the computer.

The Cmake_vs_devenv_command is also provided for the non-Express editions of Visual Studio. See also the Cmake_make_program variable.

CMAKE_VS_NsightTegra_VERSION

When using a Visual Studio generator with the Cmake_system_name variable set to Android, this variable contains the version number of the installed NVIDIA Nsight Tegra Visual Studio Edition.

Cmake_vs_platform_name

Visual Studio target platform name.

VS 8 and above allow project files to specify a target platform. CMake provides the name of the chosen platform in this variable.

Cmake_vs_platform_toolset

Visual Studio Platform Toolset name.

VS 10 and above use MSBuild under the hood and support multiple compiler toolchains. CMake may specify a toolset explicitly, such as v110 for VS 11 or Windows7.1SDK for 64-bit support in VS 10 Express. CMake provides the name of the chosen toolset in this variable.

Cmake_vs_windows_target_platform_version

Visual Studio Windows Target Platform Version.

When targeting Windows 10 and above Visual Studio 2015 and above support specification of a target Windows version to select a corresponding SDK. The Cmake_system_version variable may be set to specify a version. Otherwise CMake computes a default version based on the Windows SDK versions available. The chosen Windows target version number is provided in Cmake_vs_windows_target_platform_version. If no Windows 10 SDK is available this value will be empty.

Cmake_xcode_platform_toolset

Xcode compiler selection.

Xcode supports selection of a compiler from one of the installed toolsets. CMake provides the name of the chosen toolset in this variable, if any is explicitly selected (e.g. via the cmake(1) -T option).

Project_binary_dir

Full path to build directory for project.

This is the binary directory of the most recent project() command.

<Project-Name>_binary_dir

Top level binary directory for the named project.

A variable is created with the name used in the project() command, and is the binary directory for the project. This can be useful when add_subdirectory() is used to connect several projects.

Project_name

Name of the project given to the project command.

This is the name given to the most recent project() command.

<Project-Name>_source_dir

Top level source directory for the named project.

A variable is created with the name used in the project() command, and is the source directory for the project. This can be useful when add_subdirectory() is used to connect several projects.

<Project-Name>_version

Value given to the VERSION option of the most recent call to the project() command with project name <PROJECT-NAME>, if any.

See also the component-wise version variables <PROJECT-NAME>_VERSION_MAJOR, <PROJECT-NAME>_VERSION_MINOR, <PROJECT-NAME>_VERSION_PATCH, and <PROJECT-NAME>_VERSION_TWEAK.

<Project-Name>_version_major

First version number component of the <PROJECT-NAME>_VERSION variable as set by the project() command.

<Project-Name>_version_minor

Second version number component of the <PROJECT-NAME>_VERSION variable as set by the project() command.

<Project-Name>_version_patch

Third version number component of the <PROJECT-NAME>_VERSION variable as set by the project() command.

<Project-Name>_version_tweak

Fourth version number component of the <PROJECT-NAME>_VERSION variable as set by the project() command.

Project_source_dir

Top level source directory for the current project.

This is the source directory of the most recent project() command.

Project_version

Value given to the VERSION option of the most recent call to the project() command, if any.

See also the component-wise version variables Project_version_major, Project_version_minor, Project_version_patch, and Project_version_tweak.

Project_version_major

First version number component of the Project_version variable as set by the project() command.

Project_version_minor

Second version number component of the Project_version variable as set by the project() command.

Project_version_patch

Third version number component of the Project_version variable as set by the project() command.

Project_version_tweak

Fourth version number component of the Project_version variable as set by the project() command.

Variables That Change Behavior

Build_shared_libs

Global flag to cause add_library() to create shared libraries if on.

If present and true, this will cause all libraries to be built shared unless the library was explicitly added as a static library. This variable is often added to projects as an option() so that each user of a project can decide if they want to build the project using shared or static libraries.

Cmake_absolute_destination_files

List of files which have been installed using an ABSOLUTE DESTINATION path.

This variable is defined by CMake-generated cmake_install.cmake scripts. It can be used (read-only) by programs or scripts that source those install scripts. This is used by some CPack generators (e.g. RPM).

Cmake_appbundle_path

;-list of directories specifying a search path for OS X application bundles used by the find_program(), and find_package() commands.

Cmake_automoc_relaxed_mode

Switch between strict and relaxed automoc mode.

By default, AUTOMOC behaves exactly as described in the documentation of the AUTOMOC target property. When set to TRUE, it accepts more input and tries to find the correct input file for moc even if it differs from the documented behaviour. In this mode it e.g. also checks whether a header file is intended to be processed by moc when a "foo.moc" file has been included.

Relaxed mode has to be enabled for KDE4 compatibility.

Cmake_backwards_compatibility

Deprecated. See CMake Policy CMP0001 documentation.

Cmake_build_type

Specifies the build type on single-configuration generators.

This statically specifies what build type (configuration) will be built in this build tree. Possible values are empty, Debug, Release, RelWithDebInfo and MinSizeRel. This variable is only meaningful to single-configuration generators (such as Makefile Generators and Ninja) i.e. those which choose a single configuration when CMake runs to generate a build tree as opposed to multi-configuration generators which offer selection of the build configuration within the generated build environment. There are many per-config properties and variables (usually following clean SOME_VAR_<CONFIG> order conventions), such as CMAKE_C_FLAGS_<CONFIG>, specified as uppercase: CMAKE_C_FLAGS_[DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL]. For example, in a build tree configured to build type Debug, CMake will see to having CMAKE_C_FLAGS_DEBUG settings get added to the CMAKE_C_FLAGS settings. See also Cmake_configuration_types.

Cmake_codelite_use_targets

Change the way the CodeLite generator creates projectfiles.

If this variable evaluates to ON at the end of the top-level CMakeLists.txt file, the generator creates projectfiles based on targets rather than projects.

Cmake_color_makefile

Enables color output when using the Makefile Generators.

When enabled, the generated Makefiles will produce colored output. Default is ON.

Cmake_configuration_types

Specifies the available build types on multi-config generators.

This specifies what build types (configurations) will be available such as Debug, Release, RelWithDebInfo etc. This has reasonable defaults on most platforms, but can be extended to provide other build types. See also Cmake_build_type for details of managing configuration data, and Cmake_cfg_intdir.

Cmake_debug_target_properties

Enables tracing output for target properties.

This variable can be populated with a list of properties to generate debug output for when evaluating target properties. Currently it can only be used when evaluating the INCLUDE_DIRECTORIES, COMPILE_DEFINITIONS, COMPILE_OPTIONS, AUTOUIC_OPTIONS, SOURCES, COMPILE_FEATURES, POSITION_INDEPENDENT_CODE target properties and any other property listed in COMPATIBLE_INTERFACE_STRING and other COMPATIBLE_INTERFACE_ properties. It outputs an origin for each entry in the target property. Default is unset.

Cmake_depends_in_project_only

When set to TRUE in a directory, the build system produced by the Makefile Generators is set up to only consider dependencies on source files that appear either in the source or in the binary directories. Changes to source files outside of these directories will not cause rebuilds.

This should be used carefully in cases where some source files are picked up through external headers during the build.

CMAKE_DISABLE_FIND_PACKAGE_<PackageName>

Variable for disabling find_package() calls.

Every non-REQUIRED find_package() call in a project can be disabled by setting the variable CMAKE_DISABLE_FIND_PACKAGE_<PackageName> to TRUE. This can be used to build a project without an optional package, although that package is installed.

This switch should be used during the initial CMake run. Otherwise if the package has already been found in a previous CMake run, the variables which have been stored in the cache will still be there. In that case it is recommended to remove the cache variables for this package from the cache using the cache editor or cmake(1) -U

Cmake_eclipse_generate_linked_resources

This cache variable is used by the Eclipse project generator. See cmake-generators(7).

The Eclipse project generator generates so-called linked resources e.g. to the subproject root dirs in the source tree or to the source files of targets. This can be disabled by setting this variable to FALSE.

Cmake_eclipse_generate_source_project

This cache variable is used by the Eclipse project generator. See cmake-generators(7).

If this variable is set to TRUE, the Eclipse project generator will generate an Eclipse project in Cmake_source_dir . This project can then be used in Eclipse e.g. for the version control functionality. Cmake_eclipse_generate_source_project defaults to FALSE; so nothing is written into the source directory.

Cmake_eclipse_make_arguments

This cache variable is used by the Eclipse project generator. See cmake-generators(7).

This variable holds arguments which are used when Eclipse invokes the make tool. By default it is initialized to hold flags to enable parallel builds (using -j typically).

Cmake_eclipse_version

This cache variable is used by the Eclipse project generator. See cmake-generators(7).

When using the Eclipse project generator, CMake tries to find the Eclipse executable and detect the version of it. Depending on the version it finds, some features are enabled or disabled. If CMake doesn't find Eclipse, it assumes the oldest supported version, Eclipse Callisto (3.2).

Cmake_error_deprecated

Whether to issue errors for deprecated functionality.

If TRUE, use of deprecated functionality will issue fatal errors. If this variable is not set, CMake behaves as if it were set to FALSE.

Cmake_error_on_absolute_install_destination

Ask cmake_install.cmake script to error out as soon as a file with absolute INSTALL DESTINATION is encountered.

The fatal error is emitted before the installation of the offending file takes place. This variable is used by CMake-generated cmake_install.cmake scripts. If one sets this variable to ON while running the script, it may get fatal error messages from the script.

Cmake_export_compile_commands

Enable/Disable output of compile commands during generation.

If enabled, generates a compile_commands.json file containing the exact compiler calls for all translation units of the project in machine-readable form. The format of the JSON file looks like:

[
  {
    "directory": "/home/user/development/project",
    "command": "/usr/bin/c++ ... -c ../foo/foo.cc",
    "file": "../foo/foo.cc"
  },

  ...

  {
    "directory": "/home/user/development/project",
    "command": "/usr/bin/c++ ... -c ../foo/bar.cc",
    "file": "../foo/bar.cc"
  }
]

NOTE:

This option is implemented only by Makefile Generators and the Ninja. It is ignored on other generators.

Cmake_export_no_package_registry

Disable the export(PACKAGE) command.

In some cases, for example for packaging and for system wide installations, it is not desirable to write the user package registry. If the Cmake_export_no_package_registry variable is enabled, the export(PACKAGE) command will do nothing.

See also Disabling the Package Registry.

Cmake_sysroot

Path to pass to the compiler in the --sysroot flag.

The Cmake_sysroot content is passed to the compiler in the --sysroot flag, if supported. The path is also stripped from the RPATH/RUNPATH if necessary on installation. The Cmake_sysroot is also used to prefix paths searched by the find_* commands.

This variable may only be set in a toolchain file specified by the Cmake_toolchain_file variable.

Cmake_find_appbundle

This variable affects how find_* commands choose between OS X Application Bundles and unix-style package components.

On Darwin or systems supporting OS X Application Bundles, the Cmake_find_appbundle variable can be set to empty or one of the following:

FIRST
Try to find application bundles before standard programs. This is the default on Darwin.
LAST
Try to find application bundles after standard programs.
ONLY
Only try to find application bundles.
NEVER
Never try to find application bundles.

Cmake_find_framework

This variable affects how find_* commands choose between OS X Frameworks and unix-style package components.

On Darwin or systems supporting OS X Frameworks, the Cmake_find_framework variable can be set to empty or one of the following:

FIRST
Try to find frameworks before standard libraries or headers. This is the default on Darwin.
LAST
Try to find frameworks after standard libraries or headers.
ONLY
Only try to find frameworks.
NEVER
Never try to find frameworks.

Cmake_find_library_prefixes

Prefixes to prepend when looking for libraries.

This specifies what prefixes to add to library names when the find_library() command looks for libraries. On Unix systems this is typically lib, meaning that when trying to find the foo library it will look for libfoo.

Cmake_find_library_suffixes

Suffixes to append when looking for libraries.

This specifies what suffixes to add to library names when the find_library() command looks for libraries. On Windows systems this is typically .lib and .dll, meaning that when trying to find the foo library it will look for foo.dll etc.

Cmake_find_no_install_prefix

Ignore the Cmake_install_prefix when searching for assets.

CMake adds the Cmake_install_prefix and the Cmake_staging_prefix variable to the Cmake_system_prefix_path by default. This variable may be set on the command line to control that behavior.

Set Cmake_find_no_install_prefix to TRUE to tell find_package() not to search in the Cmake_install_prefix or Cmake_staging_prefix by default. Note that the prefix may still be searched for other reasons, such as being the same prefix as the CMake installation, or for being a built-in system prefix.

Cmake_find_package_no_package_registry

Skip User Package Registry in find_package() calls.

In some cases, for example to locate only system wide installations, it is not desirable to use the User Package Registry when searching for packages. If the Cmake_find_package_no_package_registry variable is enabled, all the find_package() commands will skip the User Package Registry as if they were called with the NO_CMAKE_PACKAGE_REGISTRY argument.

See also Disabling the Package Registry.

Cmake_find_package_no_system_package_registry

Skip System Package Registry in find_package() calls.

In some cases, it is not desirable to use the System Package Registry when searching for packages. If the Cmake_find_package_no_system_package_registry variable is enabled, all the find_package() commands will skip the System Package Registry as if they were called with the NO_CMAKE_SYSTEM_PACKAGE_REGISTRY argument.

See also Disabling the Package Registry.

Cmake_find_package_warn_no_module

Tell find_package() to warn if called without an explicit mode.

If find_package() is called without an explicit mode option (MODULE, CONFIG, or NO_MODULE) and no Find<pkg>.cmake module is in Cmake_module_path then CMake implicitly assumes that the caller intends to search for a package configuration file. If no package configuration file is found then the wording of the failure message must account for both the case that the package is really missing and the case that the project has a bug and failed to provide the intended Find module. If instead the caller specifies an explicit mode option then the failure message can be more specific.

Set Cmake_find_package_warn_no_module to TRUE to tell find_package() to warn when it implicitly assumes Config mode. This helps developers enforce use of an explicit mode in all calls to find_package() within a project.

Cmake_find_root_path

;-list of root paths to search on the filesystem.

This variable is most useful when cross-compiling. CMake uses the paths in this list as alternative roots to find filesystem items with find_package(), find_library() etc.

Cmake_find_root_path_mode_include

This variable controls whether the Cmake_find_root_path and Cmake_sysroot are used by find_file() and find_path().

If set to ONLY, then only the roots in Cmake_find_root_path will be searched. If set to NEVER, then the roots in Cmake_find_root_path will be ignored and only the host system root will be used. If set to BOTH, then the host system paths and the paths in Cmake_find_root_path will be searched.

Cmake_find_root_path_mode_library

This variable controls whether the Cmake_find_root_path and Cmake_sysroot are used by find_library().

If set to ONLY, then only the roots in Cmake_find_root_path will be searched. If set to NEVER, then the roots in Cmake_find_root_path will be ignored and only the host system root will be used. If set to BOTH, then the host system paths and the paths in Cmake_find_root_path will be searched.

Cmake_find_root_path_mode_package

This variable controls whether the Cmake_find_root_path and Cmake_sysroot are used by find_package().

If set to ONLY, then only the roots in Cmake_find_root_path will be searched. If set to NEVER, then the roots in Cmake_find_root_path will be ignored and only the host system root will be used. If set to BOTH, then the host system paths and the paths in Cmake_find_root_path will be searched.

Cmake_find_root_path_mode_program

This variable controls whether the Cmake_find_root_path and Cmake_sysroot are used by find_program().

If set to ONLY, then only the roots in Cmake_find_root_path will be searched. If set to NEVER, then the roots in Cmake_find_root_path will be ignored and only the host system root will be used. If set to BOTH, then the host system paths and the paths in Cmake_find_root_path will be searched.

Cmake_framework_path

;-list of directories specifying a search path for OS X frameworks used by the find_library(), find_package(), find_path(), and find_file() commands.

Cmake_ignore_path

;-list of directories to be ignored by the find_program(), find_library(), find_file(), and find_path() commands. This is useful in cross-compiling environments where some system directories contain incompatible but possibly linkable libraries. For example, on cross-compiled cluster environments, this allows a user to ignore directories containing libraries meant for the front-end machine.

By default this is empty; it is intended to be set by the project. Note that Cmake_ignore_path takes a list of directory names, not a list of prefixes. To ignore paths under prefixes (bin, include, lib, etc.), specify them explicitly.

See also the Cmake_prefix_path, Cmake_library_path, Cmake_include_path, and Cmake_program_path variables.

Cmake_include_path

;-list of directories specifying a search path for the find_file() and find_path() commands. By default it is empty, it is intended to be set by the project. See also Cmake_system_include_path and Cmake_prefix_path.

Cmake_include_directories_before

Whether to append or prepend directories by default in include_directories().

This variable affects the default behavior of the include_directories() command. Setting this variable to ON is equivalent to using the BEFORE option in all uses of that command.

Cmake_include_directories_project_before

Whether to force prepending of project include directories.

This variable affects the order of include directories generated in compiler command lines. If set to ON, it causes the Cmake_source_dir and the Cmake_binary_dir to appear first.

Cmake_install_default_component_name

Default component used in install() commands.

If an install() command is used without the COMPONENT argument, these files will be grouped into a default component. The name of this default install component will be taken from this variable. It defaults to Unspecified.

Cmake_install_message

Specify verbosity of installation script code generated by the install() command (using the file(INSTALL) command). For paths that are newly installed or updated, installation may print lines like:

-- Installing: /some/destination/path

For paths that are already up to date, installation may print lines like:

-- Up-to-date: /some/destination/path

The Cmake_install_message variable may be set to control which messages are printed:

ALWAYS
Print both Installing and Up-to-date messages.
LAZY
Print Installing but not Up-to-date messages.
NEVER
Print neither Installing nor Up-to-date messages.

Other values have undefined behavior and may not be diagnosed.

If this variable is not set, the default behavior is ALWAYS.

Cmake_install_prefix

Install directory used by install().

If make install is invoked or INSTALL is built, this directory is prepended onto all install directories. This variable defaults to /usr/local on Unix and c:/Program Files/${Project_name} on Windows. See Cmake_install_prefix_initialized_to_default for how a project might choose its own default.

On Unix one can use the DESTDIR mechanism in order to relocate the whole installation. DESTDIR means DESTination DIRectory. It is commonly used by makefile users in order to install software at non-default location. It is usually invoked like this:

make DESTDIR=/home/john install

which will install the concerned software using the installation prefix, e.g. /usr/local prepended with the DESTDIR value which finally gives /home/john/usr/local.

WARNING: DESTDIR may not be used on Windows because installation prefix usually contains a drive letter like in C:/Program Files which cannot be prepended with some other prefix.

The installation prefix is also added to Cmake_system_prefix_path so that find_package(), find_program(), find_library(), find_path(), and find_file() will search the prefix for other software.

NOTE:

Use the GNUInstallDirs module to provide GNU-style options for the layout of directories within the installation.

Cmake_install_prefix_initialized_to_default

CMake sets this variable to a TRUE value when the Cmake_install_prefix has just been initialized to its default value, typically on the first run of CMake within a new build tree. This can be used by project code to change the default without overriding a user-provided value:

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  set(CMAKE_INSTALL_PREFIX "/my/default" CACHE PATH "..." FORCE)
endif()

Cmake_library_path

;-list of directories specifying a search path for the find_library() command. By default it is empty, it is intended to be set by the project. See also Cmake_system_library_path and Cmake_prefix_path.

Cmake_mfc_flag

Tell cmake to use MFC for an executable or dll.

This can be set in a CMakeLists.txt file and will enable MFC in the application. It should be set to 1 for the static MFC library, and 2 for the shared MFC library. This is used in Visual Studio 7 project files. The CMakeSetup dialog used MFC and the CMakeLists.txt looks like this:

add_definitions(-D_AFXDLL)
set(CMAKE_MFC_FLAG 2)
add_executable(CMakeSetup WIN32 ${SRCS})

Cmake_module_path

;-list of directories specifying a search path for CMake modules to be loaded by the the include() or find_package() commands before checking the default modules that come with CMake. By default it is empty, it is intended to be set by the project.

Cmake_not_using_config_flags

Skip _BUILD_TYPE flags if true.

This is an internal flag used by the generators in CMake to tell CMake to skip the _BUILD_TYPE flags.

Cmake_policy_default_cmp<Nnnn>

Default for CMake Policy CMP<NNNN> when it is otherwise left unset.

Commands cmake_minimum_required(VERSION) and cmake_policy(VERSION) by default leave policies introduced after the given version unset. Set CMAKE_POLICY_DEFAULT_CMP<NNNN> to OLD or NEW to specify the default for policy CMP<NNNN>, where <NNNN> is the policy number.

This variable should not be set by a project in CMake code; use cmake_policy(SET) instead. Users running CMake may set this variable in the cache (e.g. -DCMAKE_POLICY_DEFAULT_CMP<NNNN>=<OLD|NEW>) to set a policy not otherwise set by the project. Set to OLD to quiet a policy warning while using old behavior or to NEW to try building the project with new behavior.

Cmake_policy_warning_cmp<Nnnn>

Explicitly enable or disable the warning when CMake Policy CMP<NNNN> is not set. This is meaningful only for the few policies that do not warn by default:

·
CMAKE_POLICY_WARNING_CMP0025 controls the warning for policy CMP0025.
·
CMAKE_POLICY_WARNING_CMP0047 controls the warning for policy CMP0047.
·
CMAKE_POLICY_WARNING_CMP0056 controls the warning for policy CMP0056.
·
CMAKE_POLICY_WARNING_CMP0060 controls the warning for policy CMP0060.
·
CMAKE_POLICY_WARNING_CMP0065 controls the warning for policy CMP0065.
·
CMAKE_POLICY_WARNING_CMP0066 controls the warning for policy CMP0066.

This variable should not be set by a project in CMake code. Project developers running CMake may set this variable in their cache to enable the warning (e.g. -DCMAKE_POLICY_WARNING_CMP<NNNN>=ON). Alternatively, running cmake(1) with the --debug-output, --trace, or --trace-expand option will also enable the warning.

Cmake_prefix_path

;-list of directories specifying installation prefixes to be searched by the find_package(), find_program(), find_library(), find_file(), and find_path() commands. Each command will add appropriate subdirectories (like bin, lib, or include) as specified in its own documentation.

By default this is empty. It is intended to be set by the project.

See also Cmake_system_prefix_path, Cmake_include_path, Cmake_library_path, Cmake_program_path, and Cmake_ignore_path.

Cmake_program_path

;-list of directories specifying a search path for the find_program() command. By default it is empty, it is intended to be set by the project. See also Cmake_system_program_path and Cmake_prefix_path.

Cmake_project_<Project-Name>_include

A CMake language file or module to be included by the project() command. This is is intended for injecting custom code into project builds without modifying their source.

Cmake_skip_install_all_dependency

Don't make the install target depend on the all target.

By default, the install target depends on the all target. This has the effect, that when make install is invoked or INSTALL is built, first the all target is built, then the installation starts. If Cmake_skip_install_all_dependency is set to TRUE, this dependency is not created, so the installation process will start immediately, independent from whether the project has been completely built or not.

Cmake_staging_prefix

This variable may be set to a path to install to when cross-compiling. This can be useful if the path in Cmake_sysroot is read-only, or otherwise should remain pristine.

The Cmake_staging_prefix location is also used as a search prefix by the find_* commands. This can be controlled by setting the Cmake_find_no_install_prefix variable.

If any RPATH/RUNPATH entries passed to the linker contain the Cmake_staging_prefix, the matching path fragments are replaced with the Cmake_install_prefix.

Cmake_system_appbundle_path

Search path for OS X application bundles used by the find_program(), and find_package() commands. By default it contains the standard directories for the current system. It is not intended to be modified by the project, use Cmake_appbundle_path for this.

Cmake_system_framework_path

Search path for OS X frameworks used by the find_library(), find_package(), find_path(), and find_file() commands. By default it contains the standard directories for the current system. It is not intended to be modified by the project, use Cmake_framework_path for this.

Cmake_system_ignore_path

;-list of directories to be ignored by the find_program(), find_library(), find_file(), and find_path() commands. This is useful in cross-compiling environments where some system directories contain incompatible but possibly linkable libraries. For example, on cross-compiled cluster environments, this allows a user to ignore directories containing libraries meant for the front-end machine.

By default this contains a list of directories containing incompatible binaries for the host system. See the Cmake_ignore_path variable that is intended to be set by the project.

See also the Cmake_system_prefix_path, Cmake_system_library_path, Cmake_system_include_path, and Cmake_system_program_path variables.

Cmake_system_include_path

;-list of directories specifying a search path for the find_file() and find_path() commands. By default this contains the standard directories for the current system. It is not intended to be modified by the project; use Cmake_include_path for this. See also Cmake_system_prefix_path.

Cmake_system_library_path

;-list of directories specifying a search path for the find_library() command. By default this contains the standard directories for the current system. It is not intended to be modified by the project; use Cmake_library_path for this. See also Cmake_system_prefix_path.

Cmake_system_prefix_path

;-list of directories specifying installation prefixes to be searched by the find_package(), find_program(), find_library(), find_file(), and find_path() commands. Each command will add appropriate subdirectories (like bin, lib, or include) as specified in its own documentation.

By default this contains the standard directories for the current system, the Cmake_install_prefix, and the Cmake_staging_prefix. It is not intended to be modified by the project; use Cmake_prefix_path for this.

See also Cmake_system_include_path, Cmake_system_library_path, Cmake_system_program_path, and Cmake_system_ignore_path.

Cmake_system_program_path

;-list of directories specifying a search path for the find_program() command. By default this contains the standard directories for the current system. It is not intended to be modified by the project; use Cmake_program_path for this. See also Cmake_system_prefix_path.

Cmake_user_make_rules_override

Specify a CMake file that overrides platform information.

CMake loads the specified file while enabling support for each language from either the project() or enable_language() commands. It is loaded after CMake's builtin compiler and platform information modules have been loaded but before the information is used. The file may set platform information variables to override CMake's defaults.

This feature is intended for use only in overriding information variables that must be set before CMake builds its first test project to check that the compiler for a language works. It should not be used to load a file in cases that a normal include() will work. Use it only as a last resort for behavior that cannot be achieved any other way. For example, one may set the CMAKE_C_FLAGS_INIT variable to change the default value used to initialize the CMAKE_C_FLAGS variable before it is cached. The override file should NOT be used to set anything that could be set after languages are enabled, such as variables like Cmake_runtime_output_directory that affect the placement of binaries. Information set in the file will be used for try_compile() and try_run() builds too.

Cmake_warn_deprecated

Whether to issue warnings for deprecated functionality.

If not FALSE, use of deprecated functionality will issue warnings. If this variable is not set, CMake behaves as if it were set to TRUE.

When running cmake(1), this option can be enabled with the -Wdeprecated option, or disabled with the -Wno-deprecated option.

Cmake_warn_on_absolute_install_destination

Ask cmake_install.cmake script to warn each time a file with absolute INSTALL DESTINATION is encountered.

This variable is used by CMake-generated cmake_install.cmake scripts. If one sets this variable to ON while running the script, it may get warning messages from the script.

Variables That Describe the System

Android

Set to 1 when the target system (Cmake_system_name) is Android.

Apple

True if running on OS X.

Set to true on OS X.

Borland

True if the Borland compiler is being used.

This is set to true if the Borland compiler is being used.

Cmake_cl_64

Using the 64-bit compiler from Microsoft

Set to true when using the 64-bit cl compiler from Microsoft.

Cmake_compiler_2005

Using the Visual Studio 2005 compiler from Microsoft

Set to true when using the Visual Studio 2005 compiler from Microsoft.

Cmake_host_apple

True for Apple OS X operating systems.

Set to true when the host system is Apple OS X.

Cmake_host_solaris

True for Oracle Solaris operating systems.

Set to true when the host system is Oracle Solaris.

Cmake_host_system_name

Name of the OS CMake is running on.

On systems that have the uname command, this variable is set to the output of uname -s. Linux, Windows, and Darwin for OS X are the values found on the big three operating systems.

Cmake_host_system_processor

The name of the CPU CMake is running on.

On systems that support uname, this variable is set to the output of uname -p. On Windows it is set to the value of the environment variable PROCESSOR_ARCHITECTURE.

Cmake_host_system

Composit Name of OS CMake is being run on.

This variable is the composite of Cmake_host_system_name and Cmake_host_system_version, e.g. ${Cmake_host_system_name}-${Cmake_host_system_version}. If Cmake_host_system_version is not set, then this variable is the same as Cmake_host_system_name.

Cmake_host_system_version

The OS version CMake is running on.

A numeric version string for the system. On systems that support uname, this variable is set to the output of uname -r. On other systems this is set to major-minor version numbers.

Cmake_host_unix

True for Unix and Unix like operating systems.

Set to true when the host system is Unix or Unix like (i.e. Apple and Cygwin).

Cmake_host_win32

True on Windows systems, including Win64.

Set to true when the host system is Windows and on Cygwin.

Cmake_library_architecture_regex

Regex matching possible target architecture library directory names.

This is used to detect CMAKE_<LANG>_LIBRARY_ARCHITECTURE from the implicit linker search path by matching the <arch> name.

Cmake_library_architecture

Target architecture library directory name, if detected.

This is the value of CMAKE_<LANG>_LIBRARY_ARCHITECTURE as detected for one of the enabled languages.

Cmake_object_path_max

Maximum object file full-path length allowed by native build tools.

CMake computes for every source file an object file name that is unique to the source file and deterministic with respect to the full path to the source file. This allows multiple source files in a target to share the same name if they lie in different directories without rebuilding when one is added or removed. However, it can produce long full paths in a few cases, so CMake shortens the path using a hashing scheme when the full path to an object file exceeds a limit. CMake has a built-in limit for each platform that is sufficient for common tools, but some native tools may have a lower limit. This variable may be set to specify the limit explicitly. The value must be an integer no less than 128.

Cmake_system_name

The name of the operating system for which CMake is to build. See the Cmake_system_version variable for the OS version.

System Name for Host Builds

Cmake_system_name is by default set to the same value as the Cmake_host_system_name variable so that the build targets the host system.

System Name for Cross Compiling

Cmake_system_name may be set explicitly when first configuring a new build tree in order to enable cross compiling. In this case the Cmake_system_version variable must also be set explicitly.

Cmake_system_processor

The name of the CPU CMake is building for.

This variable is the same as Cmake_host_system_processor if you build for the host system instead of the target system when cross compiling.

·
The Green Hills MULTI generator sets this to ARM by default.

Cmake_system

Composite name of operating system CMake is compiling for.

This variable is the composite of Cmake_system_name and Cmake_system_version, e.g. ${Cmake_system_name}-${Cmake_system_version}. If Cmake_system_version is not set, then this variable is the same as Cmake_system_name.

Cmake_system_version

The version of the operating system for which CMake is to build. See the Cmake_system_name variable for the OS name.

System Version for Host Builds

When the Cmake_system_name variable takes its default value then Cmake_system_version is by default set to the same value as the Cmake_host_system_version variable so that the build targets the host system version.

In the case of a host build then Cmake_system_version may be set explicitly when first configuring a new build tree in order to enable targeting the build for a different version of the host operating system than is actually running on the host. This is allowed and not considered cross compiling so long as the binaries built for the specified OS version can still run on the host.

System Version for Cross Compiling

When the Cmake_system_name variable is set explicitly to enable cross compiling then the value of Cmake_system_version must also be set explicitly to specify the target system version.

Cygwin

True for Cygwin.

Set to true when using Cygwin.

Env

Access environment variables.

Use the syntax $Env{VAR} to read environment variable VAR. See also the set() command to set Env{VAR}.

Ghs-Multi

True when using Green Hills MULTI

Mingw

True when using MinGW

Set to true when the compiler is some version of MinGW.

Msvc10

True when using the Microsoft Visual Studio v100 toolset (cl version 16) or another compiler that simulates it.

Msvc11

True when using the Microsoft Visual Studio v110 toolset (cl version 17) or another compiler that simulates it.

Msvc12

True when using the Microsoft Visual Studio v120 toolset (cl version 18) or another compiler that simulates it.

Msvc14

True when using the Microsoft Visual Studio v140 toolset (cl version 19) or another compiler that simulates it.

Msvc60

True when using Microsoft Visual C++ 6.0.

Set to true when the compiler is version 6.0 of Microsoft Visual C++.

Msvc70

True when using Microsoft Visual C++ 7.0.

Set to true when the compiler is version 7.0 of Microsoft Visual C++.

Msvc71

True when using Microsoft Visual C++ 7.1.

Set to true when the compiler is version 7.1 of Microsoft Visual C++.

Msvc80

True when using the Microsoft Visual Studio v80 toolset (cl version 14) or another compiler that simulates it.

Msvc90

True when using the Microsoft Visual Studio v90 toolset (cl version 15) or another compiler that simulates it.

Msvc_ide

True when using the Microsoft Visual C++ IDE.

Set to true when the target platform is the Microsoft Visual C++ IDE, as opposed to the command line compiler.

Msvc

True when using Microsoft Visual C++.

Set to true when the compiler is some version of Microsoft Visual C++.

Msvc_version

The version of Microsoft Visual C/C++ being used if any.

Known version numbers are:

1200 = VS  6.0
1300 = VS  7.0
1310 = VS  7.1
1400 = VS  8.0
1500 = VS  9.0
1600 = VS 10.0
1700 = VS 11.0
1800 = VS 12.0
1900 = VS 14.0, 15.0

Unix

True for Unix and Unix like operating systems.

Set to true when the target system is Unix or Unix like (i.e. Apple and Cygwin).

Win32

True on Windows systems, including Win64.

Set to true when the target system is Windows.

Wince

True when the Cmake_system_name variable is set to WindowsCE.

Windows_phone

True when the Cmake_system_name variable is set to WindowsPhone.

Windows_store

True when the Cmake_system_name variable is set to WindowsStore.

Xcode

True when using Xcode generator.

Xcode_version

Version of Xcode (Xcode generator only).

Under the Xcode generator, this is the version of Xcode as specified in Xcode.app/Contents/version.plist (such as 3.1.2).

Variables That Control the Build

Cmake_android_ant_additional_options

Default value for the ANDROID_ANT_ADDITIONAL_OPTIONS target property. See that target property for additional information.

Cmake_android_api

When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition, this variable may be set to specify the default value for the ANDROID_API target property. See that target property for additional information.

Otherwise, when Cross Compiling for Android, this variable provides the Android API version number targeted. This will be the same value as the Cmake_system_version variable for Android platforms.

Cmake_android_api_min

Default value for the ANDROID_API_MIN target property. See that target property for additional information.

Cmake_android_arch

When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition, this variable may be set to specify the default value for the ANDROID_ARCH target property. See that target property for additional information.

Otherwise, when Cross Compiling for Android, this variable provides the name of the Android architecture corresponding to the value of the Cmake_android_arch_abi variable. The architecture name may be one of:

·
arm
·
arm64
·
mips
·
mips64
·
x86
·
x86_64

Cmake_android_arch_abi

When Cross Compiling for Android, this variable specifies the target architecture and ABI to be used. Valid values are:

·
arm64-v8a
·
armeabi-v7a
·
armeabi-v6
·
armeabi
·
mips
·
mips64
·
x86
·
x86_64

See also the Cmake_android_arm_mode and Cmake_android_arm_neon variables.

Cmake_android_arm_mode

When Cross Compiling for Android and Cmake_android_arch_abi is set to one of the armeabi architectures, set Cmake_android_arm_mode to ON to target 32-bit ARM processors (-marm). Otherwise, the default is to target the 16-bit Thumb processors (-mthumb).

Cmake_android_arm_neon

When Cross Compiling for Android and Cmake_android_arch_abi is set to armeabi-v7a set Cmake_android_arm_neon to ON to target ARM NEON devices.

Cmake_android_assets_directories

Default value for the ANDROID_ASSETS_DIRECTORIES target property. See that target property for additional information.

Cmake_android_gui

Default value for the ANDROID_GUI target property of executables. See that target property for additional information.

Cmake_android_jar_dependencies

Default value for the ANDROID_JAR_DEPENDENCIES target property. See that target property for additional information.

Cmake_android_jar_directories

Default value for the ANDROID_JAR_DIRECTORIES target property. See that target property for additional information.

Cmake_android_java_source_dir

Default value for the ANDROID_JAVA_SOURCE_DIR target property. See that target property for additional information.

Cmake_android_native_lib_dependencies

Default value for the ANDROID_NATIVE_LIB_DEPENDENCIES target property. See that target property for additional information.

Cmake_android_native_lib_directories

Default value for the ANDROID_NATIVE_LIB_DIRECTORIES target property. See that target property for additional information.

Cmake_android_ndk

When Cross Compiling for Android with the NDK, this variable holds the absolute path to the root directory of the NDK. The directory must contain a platforms subdirectory holding the android-<api> directories.

Cmake_android_ndk_toolchain_host_tag

When Cross Compiling for Android with the NDK, this variable provides the NDK's "host tag" used to construct the path to prebuilt toolchains that run on the host.

Cmake_android_ndk_toolchain_version

When Cross Compiling for Android with the NDK, this variable may be set to specify the version of the toolchain to be used as the compiler. The variable must be set to one of these forms:

·
<major>.<minor>: GCC of specified version
·
clang<major>.<minor>: Clang of specified version
·
clang: Clang of most recent available version

A toolchain of the requested version will be selected automatically to match the ABI named in the Cmake_android_arch_abi variable.

If not specified, the default will be a value that selects the latest available GCC toolchain.

Cmake_android_process_max

Default value for the ANDROID_PROCESS_MAX target property. See that target property for additional information.

Cmake_android_proguard

Default value for the ANDROID_PROGUARD target property. See that target property for additional information.

Cmake_android_proguard_config_path

Default value for the ANDROID_PROGUARD_CONFIG_PATH target property. See that target property for additional information.

Cmake_android_secure_props_path

Default value for the ANDROID_SECURE_PROPS_PATH target property. See that target property for additional information.

Cmake_android_skip_ant_step

Default value for the ANDROID_SKIP_ANT_STEP target property. See that target property for additional information.

Cmake_android_standalone_toolchain

When Cross Compiling for Android with a Standalone Toolchain, this variable holds the absolute path to the root directory of the toolchain. The specified directory must contain a sysroot subdirectory.

Cmake_android_stl_type

When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio Edition, this variable may be set to specify the default value for the ANDROID_STL_TYPE target property. See that target property for additional information.

When Cross Compiling for Android with the NDK, this variable may be set to specify the STL variant to be used. The value may be one of:

none
No C++ Support
system
Minimal C++ without STL
gabi++_static
GAbi++ Static
gabi++_shared
GAbi++ Shared
gnustl_static
GNU libstdc++ Static
gnustl_shared
GNU libstdc++ Shared
c++_static
LLVM libc++ Static
c++_shared
LLVM libc++ Shared
stlport_static
STLport Static
stlport_shared
STLport Shared

The default value is gnustl_static. Note that this default differs from the native NDK build system because CMake may be used to build projects for Android that are not natively implemented for it and use the C++ standard library.

Cmake_archive_output_directory

Where to put all the ARCHIVE target files when built.

This variable is used to initialize the ARCHIVE_OUTPUT_DIRECTORY property on all the targets. See that target property for additional information.

Cmake_archive_output_directory_<Config>

Where to put all the ARCHIVE target files when built for a specific configuration.

This variable is used to initialize the ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> property on all the targets. See that target property for additional information.

Cmake_automoc_moc_options

Additional options for moc when using Cmake_automoc.

This variable is used to initialize the AUTOMOC_MOC_OPTIONS property on all the targets. See that target property for additional information.

Cmake_automoc

Whether to handle moc automatically for Qt targets.

This variable is used to initialize the AUTOMOC property on all the targets. See that target property for additional information.

Cmake_autorcc

Whether to handle rcc automatically for Qt targets.

This variable is used to initialize the AUTORCC property on all the targets. See that target property for additional information.

Cmake_autorcc_options

Whether to handle rcc automatically for Qt targets.

This variable is used to initialize the AUTORCC_OPTIONS property on all the targets. See that target property for additional information.

Cmake_autouic

Whether to handle uic automatically for Qt targets.

This variable is used to initialize the AUTOUIC property on all the targets. See that target property for additional information.

Cmake_autouic_options

Whether to handle uic automatically for Qt targets.

This variable is used to initialize the AUTOUIC_OPTIONS property on all the targets. See that target property for additional information.

Cmake_build_with_install_rpath

Use the install path for the RPATH.

Normally CMake uses the build tree for the RPATH when building executables etc on systems that use RPATH. When the software is installed the executables etc are relinked by CMake to have the install RPATH. If this variable is set to true then the software is always built with the install path for the RPATH and does not need to be relinked when installed.

Cmake_compile_pdb_output_directory

Output directory for MS debug symbol .pdb files generated by the compiler while building source files.

This variable is used to initialize the COMPILE_PDB_OUTPUT_DIRECTORY property on all the targets.

Cmake_compile_pdb_output_directory_<Config>

Per-configuration output directory for MS debug symbol .pdb files generated by the compiler while building source files.

This is a per-configuration version of Cmake_compile_pdb_output_directory. This variable is used to initialize the COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG> property on all the targets.

Cmake_<Config>_postfix

Default filename postfix for libraries under configuration <CONFIG>.

When a non-executable target is created its <CONFIG>_POSTFIX target property is initialized with the value of this variable if it is set.

Cmake_debug_postfix

See variable CMAKE_<CONFIG>_POSTFIX.

This variable is a special case of the more-general CMAKE_<CONFIG>_POSTFIX variable for the DEBUG configuration.

Cmake_enable_exports

Specify whether an executable exports symbols for loadable modules.

Normally an executable does not export any symbols because it is the final program. It is possible for an executable to export symbols to be used by loadable modules. When this property is set to true CMake will allow other targets to link to the executable with the TARGET_LINK_LIBRARIES() command. On all platforms a target-level dependency on the executable is created for targets that link to it. For DLL platforms an import library will be created for the exported symbols and then used for linking. All Windows-based systems including Cygwin are DLL platforms. For non-DLL platforms that require all symbols to be resolved at link time, such as OS X, the module will link to the executable using a flag like -bundle_loader. For other non-DLL platforms the link rule is simply ignored since the dynamic loader will automatically bind symbols when the module is loaded.

This variable is used to initialize the target property ENABLE_EXPORTS for executable targets.

Cmake_exe_linker_flags_<Config>

Flags to be used when linking an executable.

Same as CMAKE_C_FLAGS_* but used by the linker when creating executables.

Cmake_exe_linker_flags_<Config>_init

Value used to initialize the CMAKE_EXE_LINKER_FLAGS_<CONFIG> cache entry the first time a build tree is configured. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also Cmake_exe_linker_flags_init.

Cmake_exe_linker_flags

Linker flags to be used to create executables.

These flags will be used by the linker when creating an executable.

Cmake_exe_linker_flags_init

Value used to initialize the Cmake_exe_linker_flags cache entry the first time a build tree is configured. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also the configuration-specific variable CMAKE_EXE_LINKER_FLAGS_<CONFIG>_INIT.

CMAKE_Fortran_FORMAT

Set to FIXED or FREE to indicate the Fortran source layout.

This variable is used to initialize the Fortran_FORMAT property on all the targets. See that target property for additional information.

CMAKE_Fortran_MODULE_DIRECTORY

Fortran module output directory.

This variable is used to initialize the Fortran_MODULE_DIRECTORY property on all the targets. See that target property for additional information.

CMAKE_GNUtoMS

Convert GNU import libraries (.dll.a) to MS format (.lib).

This variable is used to initialize the GNUtoMS property on targets when they are created. See that target property for additional information.

Cmake_include_current_dir_in_interface

Automatically add the current source- and build directories to the INTERFACE_INCLUDE_DIRECTORIES target property.

If this variable is enabled, CMake automatically adds for each shared library target, static library target, module target and executable target, Cmake_current_source_dir and Cmake_current_binary_dir to the INTERFACE_INCLUDE_DIRECTORIES target property. By default Cmake_include_current_dir_in_interface is OFF.

Cmake_include_current_dir

Automatically add the current source- and build directories to the include path.

If this variable is enabled, CMake automatically adds Cmake_current_source_dir and Cmake_current_binary_dir to the include path for each directory. These additional include directories do not propagate down to subdirectories. This is useful mainly for out-of-source builds, where files generated into the build tree are included by files located in the source tree.

By default Cmake_include_current_dir is OFF.

Cmake_install_name_dir

OS X directory name for installed targets.

Cmake_install_name_dir is used to initialize the INSTALL_NAME_DIR property on all targets. See that target property for more information.

Cmake_install_rpath

The rpath to use for installed targets.

A semicolon-separated list specifying the rpath to use in installed targets (for platforms that support it). This is used to initialize the target property INSTALL_RPATH for all targets.

Cmake_ios_install_combined

Default value for IOS_INSTALL_COMBINED of targets.

This variable is used to initialize the IOS_INSTALL_COMBINED property on all the targets. See that target property for additional information.

Cmake_<Lang>_clang_tidy

Default value for <LANG>_CLANG_TIDY target property. This variable is used to initialize the property on each target as it is created. This is done only when <LANG> is C or CXX.

Cmake_<Lang>_compiler_launcher

Default value for <LANG>_COMPILER_LAUNCHER target property. This variable is used to initialize the property on each target as it is created. This is done only when <LANG> is C or CXX.

Cmake_<Lang>_include_what_you_use

Default value for <LANG>_INCLUDE_WHAT_YOU_USE target property. This variable is used to initialize the property on each target as it is created. This is done only when <LANG> is C or CXX.

Cmake_<Lang>_visibility_preset

Default value for the <LANG>_VISIBILITY_PRESET target property when a target is created.

Cmake_library_output_directory

Where to put all the LIBRARY target files when built.

This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY property on all the targets. See that target property for additional information.

Cmake_library_output_directory_<Config>

Where to put all the LIBRARY target files when built for a specific configuration.

This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY_<CONFIG> property on all the targets. See that target property for additional information.

Cmake_library_path_flag

The flag to be used to add a library search path to a compiler.

The flag will be used to specify a library directory to the compiler. On most compilers this is -L.

Cmake_macosx_bundle

Default value for MACOSX_BUNDLE of targets.

This variable is used to initialize the MACOSX_BUNDLE property on all the targets. See that target property for additional information.

Cmake_macosx_rpath

Whether to use rpaths on OS X and iOS.

This variable is used to initialize the MACOSX_RPATH property on all targets.

Cmake_map_imported_config_<Config>

Default value for MAP_IMPORTED_CONFIG_<CONFIG> of targets.

This variable is used to initialize the MAP_IMPORTED_CONFIG_<CONFIG> property on all the targets. See that target property for additional information.

Cmake_module_linker_flags_<Config>

Flags to be used when linking a module.

Same as CMAKE_C_FLAGS_* but used by the linker when creating modules.

Cmake_module_linker_flags_<Config>_init

Value used to initialize the CMAKE_MODULE_LINKER_FLAGS_<CONFIG> cache entry the first time a build tree is configured. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also Cmake_module_linker_flags_init.

Cmake_module_linker_flags

Linker flags to be used to create modules.

These flags will be used by the linker when creating a module.

Cmake_module_linker_flags_init

Value used to initialize the Cmake_module_linker_flags cache entry the first time a build tree is configured. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also the configuration-specific variable CMAKE_MODULE_LINKER_FLAGS_<CONFIG>_INIT.

Cmake_ninja_output_path_prefix

Set output files path prefix for the Ninja generator.

Every output files listed in the generated build.ninja will be prefixed by the contents of this variable (a trailing slash is appended if missing). This is useful when the generated ninja file is meant to be embedded as a subninja file into a super ninja project. For example, a ninja build file generated with a command like:

cd top-build-dir/sub &&
cmake -G Ninja -DCMAKE_NINJA_OUTPUT_PATH_PREFIX=sub/ path/to/source

can be embedded in top-build-dir/build.ninja with a directive like this:

subninja sub/build.ninja

The auto-regeneration rule in top-build-dir/build.ninja must have an order-only dependency on sub/build.ninja.

NOTE:

When Cmake_ninja_output_path_prefix is set, the project generated by CMake cannot be used as a standalone project. No default targets are specified.

Cmake_no_builtin_chrpath

Do not use the builtin ELF editor to fix RPATHs on installation.

When an ELF binary needs to have a different RPATH after installation than it does in the build tree, CMake uses a builtin editor to change the RPATH in the installed copy. If this variable is set to true then CMake will relink the binary before installation instead of using its builtin editor.

Cmake_no_system_from_imported

Default value for NO_SYSTEM_FROM_IMPORTED of targets.

This variable is used to initialize the NO_SYSTEM_FROM_IMPORTED property on all the targets. See that target property for additional information.

Cmake_osx_architectures

Target specific architectures for OS X and iOS.

This variable is used to initialize the OSX_ARCHITECTURES property on each target as it is creaed. See that target property for additional information.

The value of this variable should be set prior to the first project() or enable_language() command invocation because it may influence configuration of the toolchain and flags. It is intended to be set locally by the user creating a build tree.

This variable is ignored on platforms other than OS X.

Cmake_osx_deployment_target

Specify the minimum version of OS X on which the target binaries are to be deployed. CMake uses this value for the -mmacosx-version-min flag and to help choose the default SDK (see Cmake_osx_sysroot).

If not set explicitly the value is initialized by the MACOSX_DEPLOYMENT_TARGET environment variable, if set, and otherwise computed based on the host platform.

The value of this variable should be set prior to the first project() or enable_language() command invocation because it may influence configuration of the toolchain and flags. It is intended to be set locally by the user creating a build tree.

This variable is ignored on platforms other than OS X.

Cmake_osx_sysroot

Specify the location or name of the OS X platform SDK to be used. CMake uses this value to compute the value of the -isysroot flag or equivalent and to help the find_* commands locate files in the SDK.

If not set explicitly the value is initialized by the SDKROOT environment variable, if set, and otherwise computed based on the Cmake_osx_deployment_target or the host platform.

The value of this variable should be set prior to the first project() or enable_language() command invocation because it may influence configuration of the toolchain and flags. It is intended to be set locally by the user creating a build tree.

This variable is ignored on platforms other than OS X.

Cmake_pdb_output_directory

Output directory for MS debug symbol .pdb files generated by the linker for executable and shared library targets.

This variable is used to initialize the PDB_OUTPUT_DIRECTORY property on all the targets. See that target property for additional information.

Cmake_pdb_output_directory_<Config>

Per-configuration output directory for MS debug symbol .pdb files generated by the linker for executable and shared library targets.

This is a per-configuration version of Cmake_pdb_output_directory. This variable is used to initialize the PDB_OUTPUT_DIRECTORY_<CONFIG> property on all the targets. See that target property for additional information.

Cmake_position_independent_code

Default value for POSITION_INDEPENDENT_CODE of targets.

This variable is used to initialize the POSITION_INDEPENDENT_CODE property on all the targets. See that target property for additional information. If set, it's value is also used by the try_compile() command.

Cmake_runtime_output_directory

Where to put all the RUNTIME target files when built.

This variable is used to initialize the RUNTIME_OUTPUT_DIRECTORY property on all the targets. See that target property for additional information.

Cmake_runtime_output_directory_<Config>

Where to put all the RUNTIME target files when built for a specific configuration.

This variable is used to initialize the RUNTIME_OUTPUT_DIRECTORY_<CONFIG> property on all the targets. See that target property for additional information.

Cmake_shared_linker_flags_<Config>

Flags to be used when linking a shared library.

Same as CMAKE_C_FLAGS_* but used by the linker when creating shared libraries.

Cmake_shared_linker_flags_<Config>_init

Value used to initialize the CMAKE_SHARED_LINKER_FLAGS_<CONFIG> cache entry the first time a build tree is configured. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also Cmake_shared_linker_flags_init.

Cmake_shared_linker_flags

Linker flags to be used to create shared libraries.

These flags will be used by the linker when creating a shared library.

Cmake_shared_linker_flags_init

Value used to initialize the Cmake_shared_linker_flags cache entry the first time a build tree is configured. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also the configuration-specific variable CMAKE_SHARED_LINKER_FLAGS_<CONFIG>_INIT.

Cmake_skip_build_rpath

Do not include RPATHs in the build tree.

Normally CMake uses the build tree for the RPATH when building executables etc on systems that use RPATH. When the software is installed the executables etc are relinked by CMake to have the install RPATH. If this variable is set to true then the software is always built with no RPATH.

Cmake_skip_install_rpath

Do not include RPATHs in the install tree.

Normally CMake uses the build tree for the RPATH when building executables etc on systems that use RPATH. When the software is installed the executables etc are relinked by CMake to have the install RPATH. If this variable is set to true then the software is always installed without RPATH, even if RPATH is enabled when building. This can be useful for example to allow running tests from the build directory with RPATH enabled before the installation step. To omit RPATH in both the build and install steps, use Cmake_skip_rpath instead.

Cmake_static_linker_flags_<Config>

Flags to be used when linking a static library.

Same as CMAKE_C_FLAGS_* but used by the linker when creating static libraries.

Cmake_static_linker_flags_<Config>_init

Value used to initialize the CMAKE_STATIC_LINKER_FLAGS_<CONFIG> cache entry the first time a build tree is configured. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also Cmake_static_linker_flags_init.

Cmake_static_linker_flags

Linker flags to be used to create static libraries.

These flags will be used by the linker when creating a static library.

Cmake_static_linker_flags_init

Value used to initialize the Cmake_static_linker_flags cache entry the first time a build tree is configured. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also the configuration-specific variable CMAKE_STATIC_LINKER_FLAGS_<CONFIG>_INIT.

Cmake_try_compile_configuration

Build configuration used for try_compile() and try_run() projects.

Projects built by try_compile() and try_run() are built synchronously during the CMake configuration step. Therefore a specific build configuration must be chosen even if the generated build system supports multiple configurations.

Cmake_try_compile_platform_variables

List of variables that the try_compile() command source file signature must propagate into the test project in order to target the same platform as the host project.

This variable should not be set by project code. It is meant to be set by CMake's platform information modules for the current toolchain, or by a toolchain file when used with Cmake_toolchain_file.

Variables meaningful to CMake, such as CMAKE_<LANG>_FLAGS, are propagated automatically. The Cmake_try_compile_platform_variables variable may be set to pass custom variables meaningful to a toolchain file. For example, a toolchain file may contain:

set(CMAKE_SYSTEM_NAME ...)
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES MY_CUSTOM_VARIABLE)
# ... use MY_CUSTOM_VARIABLE ...

If a user passes -DMY_CUSTOM_VARIABLE=SomeValue to CMake then this setting will be made visible to the toolchain file both for the main project and for test projects generated by the try_compile() command source file signature.

Cmake_try_compile_target_type

Type of target generated for try_compile() calls using the source file signature. Valid values are:

EXECUTABLE
Use add_executable() to name the source file in the generated project. This is the default if no value is given.
STATIC_LIBRARY
Use add_library() with the STATIC option to name the source file in the generated project. This avoids running the linker and is intended for use with cross-compiling toolchains that cannot link without custom flags or linker scripts.

Cmake_use_relative_paths

This variable has no effect. The partially implemented effect it had in previous releases was removed in CMake 3.4.

Cmake_visibility_inlines_hidden

Default value for the VISIBILITY_INLINES_HIDDEN target property when a target is created.

Cmake_vs_include_install_to_default_build

Include INSTALL target to default build.

In Visual Studio solution, by default the INSTALL target will not be part of the default build. Setting this variable will enable the INSTALL target to be part of the default build.

Cmake_windows_export_all_symbols

Default value for WINDOWS_EXPORT_ALL_SYMBOLS target property. This variable is used to initialize the property on each target as it is created.

Cmake_win32_executable

Default value for WIN32_EXECUTABLE of targets.

This variable is used to initialize the WIN32_EXECUTABLE property on all the targets. See that target property for additional information.

CMAKE_XCODE_ATTRIBUTE_<an-attribute>

Set Xcode target attributes directly.

Tell the Xcode generator to set '<an-attribute>' to a given value in the generated Xcode project. Ignored on other generators.

See the XCODE_ATTRIBUTE_<an-attribute> target property to set attributes on a specific target.

Contents of CMAKE_XCODE_ATTRIBUTE_<an-attribute> may use "generator expressions" with the syntax $<...>. See the cmake-generator-expressions(7) manual for available expressions. See the cmake-buildsystem(7) manual for more on defining buildsystem properties.

Executable_output_path

Old executable location variable.

The target property RUNTIME_OUTPUT_DIRECTORY supercedes this variable for a target if it is set. Executable targets are otherwise placed in this directory.

Library_output_path

Old library location variable.

The target properties ARCHIVE_OUTPUT_DIRECTORY, LIBRARY_OUTPUT_DIRECTORY, and RUNTIME_OUTPUT_DIRECTORY supercede this variable for a target if they are set. Library targets are otherwise placed in this directory.

Variables for Languages

Cmake_compiler_is_gnucc

True if the C compiler is GNU. Use CMAKE_C_COMPILER_ID instead.

Cmake_compiler_is_gnucxx

True if the C++ (CXX) compiler is GNU. Use CMAKE_CXX_COMPILER_ID instead.

Cmake_compiler_is_gnug77

True if the Fortran compiler is GNU. Use CMAKE_Fortran_COMPILER_ID instead.

Cmake_c_compile_features

List of features known to the C compiler

These features are known to be available for use with the C compiler. This list is a subset of the features listed in the CMAKE_C_KNOWN_FEATURES global property.

See the cmake-compile-features(7) manual for information on compile features and a list of supported compilers.

Cmake_c_extensions

Default value for C_EXTENSIONS property of targets.

This variable is used to initialize the C_EXTENSIONS property on all targets. See that target property for additional information.

See the cmake-compile-features(7) manual for information on compile features and a list of supported compilers.

Cmake_c_standard

Default value for C_STANDARD property of targets.

This variable is used to initialize the C_STANDARD property on all targets. See that target property for additional information.

See the cmake-compile-features(7) manual for information on compile features and a list of supported compilers.

Cmake_c_standard_required

Default value for C_STANDARD_REQUIRED property of targets.

This variable is used to initialize the C_STANDARD_REQUIRED property on all targets. See that target property for additional information.

See the cmake-compile-features(7) manual for information on compile features and a list of supported compilers.

Cmake_cxx_compile_features

List of features known to the C++ compiler

These features are known to be available for use with the C++ compiler. This list is a subset of the features listed in the CMAKE_CXX_KNOWN_FEATURES global property.

See the cmake-compile-features(7) manual for information on compile features and a list of supported compilers.

Cmake_cxx_extensions

Default value for CXX_EXTENSIONS property of targets.

This variable is used to initialize the CXX_EXTENSIONS property on all targets. See that target property for additional information.

See the cmake-compile-features(7) manual for information on compile features and a list of supported compilers.

Cmake_cxx_standard

Default value for CXX_STANDARD property of targets.

This variable is used to initialize the CXX_STANDARD property on all targets. See that target property for additional information.

See the cmake-compile-features(7) manual for information on compile features and a list of supported compilers.

Cmake_cxx_standard_required

Default value for CXX_STANDARD_REQUIRED property of targets.

This variable is used to initialize the CXX_STANDARD_REQUIRED property on all targets. See that target property for additional information.

See the cmake-compile-features(7) manual for information on compile features and a list of supported compilers.

CMAKE_Fortran_MODDIR_DEFAULT

Fortran default module output directory.

Most Fortran compilers write .mod files to the current working directory. For those that do not, this is set to . and used when the Fortran_MODULE_DIRECTORY target property is not set.

CMAKE_Fortran_MODDIR_FLAG

Fortran flag for module output directory.

This stores the flag needed to pass the value of the Fortran_MODULE_DIRECTORY target property to the compiler.

CMAKE_Fortran_MODOUT_FLAG

Fortran flag to enable module output.

Most Fortran compilers write .mod files out by default. For others, this stores the flag needed to enable module output.

Cmake_internal_platform_abi

An internal variable subject to change.

This is used in determining the compiler ABI and is subject to change.

Cmake_<Lang>_android_toolchain_machine

When Cross Compiling for Android this variable contains the toolchain binutils machine name (e.g. gcc -dumpmachine). The binutils typically have a <machine>- prefix on their name.

See also CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX and CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX.

Cmake_<Lang>_android_toolchain_prefix

When Cross Compiling for Android this variable contains the absolute path prefixing the toolchain GNU compiler and its binutils.

See also CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX and CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE.

For example, the path to the linker is:

${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ld${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}

Cmake_<Lang>_android_toolchain_suffix

When Cross Compiling for Android this variable contains the host platform suffix of the toolchain GNU compiler and its binutils.

See also CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX and CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE.

Cmake_<Lang>_archive_append

Rule variable to append to a static archive.

This is a rule variable that tells CMake how to append to a static archive. It is used in place of CMAKE_<LANG>_CREATE_STATIC_LIBRARY on some platforms in order to support large object counts. See also CMAKE_<LANG>_ARCHIVE_CREATE and CMAKE_<LANG>_ARCHIVE_FINISH.

Cmake_<Lang>_archive_create

Rule variable to create a new static archive.

This is a rule variable that tells CMake how to create a static archive. It is used in place of CMAKE_<LANG>_CREATE_STATIC_LIBRARY on some platforms in order to support large object counts. See also CMAKE_<LANG>_ARCHIVE_APPEND and CMAKE_<LANG>_ARCHIVE_FINISH.

Cmake_<Lang>_archive_finish

Rule variable to finish an existing static archive.

This is a rule variable that tells CMake how to finish a static archive. It is used in place of CMAKE_<LANG>_CREATE_STATIC_LIBRARY on some platforms in order to support large object counts. See also CMAKE_<LANG>_ARCHIVE_CREATE and CMAKE_<LANG>_ARCHIVE_APPEND.

Cmake_<Lang>_compile_object

Rule variable to compile a single object file.

This is a rule variable that tells CMake how to compile a single object file for the language <LANG>.

Cmake_<Lang>_compiler_abi

An internal variable subject to change.

This is used in determining the compiler ABI and is subject to change.

Cmake_<Lang>_compiler_id

Compiler identification string.

A short string unique to the compiler vendor. Possible values include:

Absoft = Absoft Fortran (absoft.com)
ADSP = Analog VisualDSP++ (analog.com)
AppleClang = Apple Clang (apple.com)
ARMCC = ARM Compiler (arm.com)
Bruce = Bruce C Compiler
CCur = Concurrent Fortran (ccur.com)
Clang = LLVM Clang (clang.llvm.org)
Cray = Cray Compiler (cray.com)
Embarcadero, Borland = Embarcadero (embarcadero.com)
G95 = G95 Fortran (g95.org)
GNU = GNU Compiler Collection (gcc.gnu.org)
HP = Hewlett-Packard Compiler (hp.com)
Intel = Intel Compiler (intel.com)
MIPSpro = SGI MIPSpro (sgi.com)
MSVC = Microsoft Visual Studio (microsoft.com)
OpenWatcom = Open Watcom (openwatcom.org)
PGI = The Portland Group (pgroup.com)
PathScale = PathScale (pathscale.com)
SDCC = Small Device C Compiler (sdcc.sourceforge.net)
SunPro = Oracle Solaris Studio (oracle.com)
TI = Texas Instruments (ti.com)
TinyCC = Tiny C Compiler (tinycc.org)
XL, VisualAge, zOS = IBM XL (ibm.com)

This variable is not guaranteed to be defined for all compilers or languages.

Cmake_<Lang>_compiler_loaded

Defined to true if the language is enabled.

When language <LANG> is enabled by project() or enable_language() this variable is defined to 1.

Cmake_<Lang>_compiler

The full path to the compiler for LANG.

This is the command that will be used as the <LANG> compiler. Once set, you can not change this variable.

Cmake_<Lang>_compiler_external_toolchain

The external toolchain for cross-compiling, if supported.

Some compiler toolchains do not ship their own auxiliary utilities such as archivers and linkers. The compiler driver may support a command-line argument to specify the location of such tools. CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN may be set to a path to a path to the external toolchain and will be passed to the compiler driver if supported.

This variable may only be set in a toolchain file specified by the Cmake_toolchain_file variable.

Cmake_<Lang>_compiler_target

The target for cross-compiling, if supported.

Some compiler drivers are inherently cross-compilers, such as clang and QNX qcc. These compiler drivers support a command-line argument to specify the target to cross-compile for.

This variable may only be set in a toolchain file specified by the Cmake_toolchain_file variable.

Cmake_<Lang>_compiler_version

Compiler version string.

Compiler version in major[.minor[.patch[.tweak]]] format. This variable is not guaranteed to be defined for all compilers or languages.

Cmake_<Lang>_create_shared_library

Rule variable to create a shared library.

This is a rule variable that tells CMake how to create a shared library for the language <LANG>.

Cmake_<Lang>_create_shared_module

Rule variable to create a shared module.

This is a rule variable that tells CMake how to create a shared library for the language <LANG>.

Cmake_<Lang>_create_static_library

Rule variable to create a static library.

This is a rule variable that tells CMake how to create a static library for the language <LANG>.

Cmake_<Lang>_flags_debug

Flags for Debug build type or configuration.

<LANG> flags used when Cmake_build_type is Debug.

Cmake_<Lang>_flags_debug_init

Value used to initialize the CMAKE_<LANG>_FLAGS_DEBUG cache entry the first time a build tree is configured for language <LANG>. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also CMAKE_<LANG>_FLAGS_INIT.

Cmake_<Lang>_flags_minsizerel

Flags for MinSizeRel build type or configuration.

<LANG> flags used when Cmake_build_type is MinSizeRel (short for minimum size release).

Cmake_<Lang>_flags_minsizerel_init

Value used to initialize the CMAKE_<LANG>_FLAGS_MINSIZEREL cache entry the first time a build tree is configured for language <LANG>. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also CMAKE_<LANG>_FLAGS_INIT.

Cmake_<Lang>_flags_release

Flags for Release build type or configuration.

<LANG> flags used when Cmake_build_type is Release.

Cmake_<Lang>_flags_release_init

Value used to initialize the CMAKE_<LANG>_FLAGS_RELEASE cache entry the first time a build tree is configured for language <LANG>. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also CMAKE_<LANG>_FLAGS_INIT.

Cmake_<Lang>_flags_relwithdebinfo

Flags for RelWithDebInfo type or configuration.

<LANG> flags used when Cmake_build_type is RelWithDebInfo (short for Release With Debug Information).

Cmake_<Lang>_flags_relwithdebinfo_init

Value used to initialize the CMAKE_<LANG>_FLAGS_RELWITHDEBINFO cache entry the first time a build tree is configured for language <LANG>. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also CMAKE_<LANG>_FLAGS_INIT.

Cmake_<Lang>_flags

Flags for all build types.

<LANG> flags used regardless of the value of Cmake_build_type.

Cmake_<Lang>_flags_init

Value used to initialize the CMAKE_<LANG>_FLAGS cache entry the first time a build tree is configured for language <LANG>. This variable is meant to be set by a toolchain file. CMake may prepend or append content to the value based on the environment and target platform.

See also the configuration-specific variables:

·
CMAKE_<LANG>_FLAGS_DEBUG_INIT
·
CMAKE_<LANG>_FLAGS_RELEASE_INIT
·
CMAKE_<LANG>_FLAGS_MINSIZEREL_INIT
·
CMAKE_<LANG>_FLAGS_RELWITHDEBINFO_INIT

Cmake_<Lang>_ghs_kernel_flags_debug

GHS kernel flags for Debug build type or configuration.

<LANG> flags used when Cmake_build_type is Debug.

Cmake_<Lang>_ghs_kernel_flags_minsizerel

GHS kernel flags for MinSizeRel build type or configuration.

<LANG> flags used when Cmake_build_type is MinSizeRel (short for minimum size release).

Cmake_<Lang>_ghs_kernel_flags_release

GHS kernel flags for Release build type or configuration.

<LANG> flags used when Cmake_build_type is Release.

Cmake_<Lang>_ghs_kernel_flags_relwithdebinfo

GHS kernel flags for RelWithDebInfo type or configuration.

<LANG> flags used when Cmake_build_type is RelWithDebInfo (short for Release With Debug Information).

Cmake_<Lang>_ignore_extensions

File extensions that should be ignored by the build.

This is a list of file extensions that may be part of a project for a given language but are not compiled.

Cmake_<Lang>_implicit_include_directories

Directories implicitly searched by the compiler for header files.

CMake does not explicitly specify these directories on compiler command lines for language <LANG>. This prevents system include directories from being treated as user include directories on some compilers.

Cmake_<Lang>_library_architecture

Target architecture library directory name detected for <LANG>.

If the <LANG> compiler passes to the linker an architecture-specific system library search directory such as <prefix>/lib/<arch> this variable contains the <arch> name if/as detected by CMake.

Cmake_<Lang>_linker_preference_propagates

True if CMAKE_<LANG>_LINKER_PREFERENCE propagates across targets.

This is used when CMake selects a linker language for a target. Languages compiled directly into the target are always considered. A language compiled into static libraries linked by the target is considered if this variable is true.

Cmake_<Lang>_linker_preference

Preference value for linker language selection.

The "linker language" for executable, shared library, and module targets is the language whose compiler will invoke the linker. The LINKER_LANGUAGE target property sets the language explicitly. Otherwise, the linker language is that whose linker preference value is highest among languages compiled and linked into the target. See also the CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES variable.

Cmake_<Lang>_output_extension

Extension for the output of a compile for a single file.

This is the extension for an object file for the given <LANG>. For example .obj for C on Windows.

Cmake_<Lang>_platform_id

An internal variable subject to change.

This is used in determining the platform and is subject to change.

Cmake_<Lang>_simulate_id

Identification string of "simulated" compiler.

Some compilers simulate other compilers to serve as drop-in replacements. When CMake detects such a compiler it sets this variable to what would have been the CMAKE_<LANG>_COMPILER_ID for the simulated compiler.

Cmake_<Lang>_simulate_version

Version string of "simulated" compiler.

Some compilers simulate other compilers to serve as drop-in replacements. When CMake detects such a compiler it sets this variable to what would have been the CMAKE_<LANG>_COMPILER_VERSION for the simulated compiler.

Cmake_<Lang>_sizeof_data_ptr

Size of pointer-to-data types for language <LANG>.

This holds the size (in bytes) of pointer-to-data types in the target platform ABI. It is defined for languages C and CXX (C++).

Cmake_<Lang>_source_file_extensions

Extensions of source files for the given language.

This is the list of extensions for a given language's source files.

Cmake_<Lang>_standard_include_directories

Include directories to be used for every source file compiled with the <LANG> compiler. This is meant for specification of system include directories needed by the language for the current platform. The directories always appear at the end of the include path passed to the compiler.

This variable should not be set by project code. It is meant to be set by CMake's platform information modules for the current toolchain, or by a toolchain file when used with Cmake_toolchain_file.

See also CMAKE_<LANG>_STANDARD_LIBRARIES.

Cmake_<Lang>_standard_libraries

Libraries linked into every executable and shared library linked for language <LANG>. This is meant for specification of system libraries needed by the language for the current platform.

This variable should not be set by project code. It is meant to be set by CMake's platform information modules for the current toolchain, or by a toolchain file when used with Cmake_toolchain_file.

See also CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES.

CMAKE_Swift_LANGUAGE_VERSION

Set to the Swift language version number. If not set, the legacy "2.3" version is assumed.

Cmake_user_make_rules_override_<Lang>

Specify a CMake file that overrides platform information for <LANG>.

This is a language-specific version of Cmake_user_make_rules_override loaded only when enabling language <LANG>.

Variables for Ctest

Ctest_binary_directory

Specify the CTest BuildDirectory setting in a ctest(1) dashboard client script.

Ctest_build_command

Specify the CTest MakeCommand setting in a ctest(1) dashboard client script.

Ctest_build_name

Specify the CTest BuildName setting in a ctest(1) dashboard client script.

Ctest_bzr_command

Specify the CTest BZRCommand setting in a ctest(1) dashboard client script.

Ctest_bzr_update_options

Specify the CTest BZRUpdateOptions setting in a ctest(1) dashboard client script.

Ctest_change_id

Specify the CTest ChangeId setting in a ctest(1) dashboard client script.

This setting allows CTest to pass arbitrary information about this build up to CDash. One use of this feature is to allow CDash to post comments on your pull request if anything goes wrong with your build.

Ctest_checkout_command

Tell the ctest_start() command how to checkout or initialize the source directory in a ctest(1) dashboard client script.

Ctest_configuration_type

Specify the CTest DefaultCTestConfigurationType setting in a ctest(1) dashboard client script.

Ctest_configure_command

Specify the CTest ConfigureCommand setting in a ctest(1) dashboard client script.

Ctest_coverage_command

Specify the CTest CoverageCommand setting in a ctest(1) dashboard client script.

Cobertura

Using Cobertura as the coverage generation within your multi-module Java project can generate a series of XML files.

The Cobertura Coverage parser expects to read the coverage data from a single XML file which contains the coverage data for all modules. Cobertura has a program with the ability to merge given cobertura.ser files and then another program to generate a combined XML file from the previous merged file. For command line testing, this can be done by hand prior to CTest looking for the coverage files. For script builds, set the Ctest_coverage_command variable to point to a file which will perform these same steps, such as a .sh or .bat file.

set(CTEST_COVERAGE_COMMAND .../run-coverage-and-consolidate.sh)

where the run-coverage-and-consolidate.sh script is perhaps created by the configure_file() command and might contain the following code:

#!/usr/bin/env bash
CoberturaFiles="$(find "/path/to/source" -name "cobertura.ser")"
SourceDirs="$(find "/path/to/source" -name "java" -type d)"
cobertura-merge --datafile coberturamerge.ser $CoberturaFiles
cobertura-report --datafile coberturamerge.ser --destination . \
                 --format xml $SourceDirs

The script uses find to capture the paths to all of the cobertura.ser files found below the project's source directory. It keeps the list of files and supplies it as an argument to the cobertura-merge program. The --datafile argument signifies where the result of the merge will be kept.

The combined coberturamerge.ser file is then used to generate the XML report using the cobertura-report program. The call to the cobertura-report program requires some named arguments.

--datafila
path to the merged .ser file
--destination
path to put the output files(s)
--format
file format to write output in: xml or html

The rest of the supplied arguments consist of the full paths to the /src/main/java directories of each module within the source tree. These directories are needed and should not be forgotten.

Ctest_coverage_extra_flags

Specify the CTest CoverageExtraFlags setting in a ctest(1) dashboard client script.

Ctest_curl_options

Specify the CTest CurlOptions setting in a ctest(1) dashboard client script.

Ctest_custom_coverage_exclude

A list of regular expressions which will be used to exclude files by their path from coverage output by the ctest_coverage() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_error_exception

A list of regular expressions which will be used to exclude when detecting error messages in build outputs by the ctest_test() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_error_match

A list of regular expressions which will be used to detect error messages in build outputs by the ctest_test() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_error_post_context

The number of lines to include as context which follow an error message by the ctest_test() command. The default is 10.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_error_pre_context

The number of lines to include as context which precede an error message by the ctest_test() command. The default is 10.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_maximum_failed_test_output_size

When saving a failing test's output, this is the maximum size, in bytes, that will be collected by the ctest_test() command. Defaults to 307200 (300 KiB).

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_maximum_number_of_errors

The maximum number of errors in a single build step which will be detected. After this, the ctest_test() command will truncate the output. Defaults to 50.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_maximum_number_of_warnings

The maximum number of warnings in a single build step which will be detected. After this, the ctest_test() command will truncate the output. Defaults to 50.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_maximum_passed_test_output_size

When saving a passing test's output, this is the maximum size, in bytes, that will be collected by the ctest_test() command. Defaults to 1024 (1 KiB).

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_memcheck_ignore

A list of regular expressions to use to exclude tests during the ctest_memcheck() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_post_memcheck

A list of commands to run at the end of the ctest_memcheck() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_post_test

A list of commands to run at the end of the ctest_test() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_pre_memcheck

A list of commands to run at the start of the ctest_memcheck() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_pre_test

A list of commands to run at the start of the ctest_test() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_test_ignore

A list of regular expressions to use to exclude tests during the ctest_test() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_warning_exception

A list of regular expressions which will be used to exclude when detecting warning messages in build outputs by the ctest_test() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_custom_warning_match

A list of regular expressions which will be used to detect warning messages in build outputs by the ctest_test() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_cvs_checkout

Deprecated. Use Ctest_checkout_command instead.

Ctest_cvs_command

Specify the CTest CVSCommand setting in a ctest(1) dashboard client script.

Ctest_cvs_update_options

Specify the CTest CVSUpdateOptions setting in a ctest(1) dashboard client script.

Ctest_drop_location

Specify the CTest DropLocation setting in a ctest(1) dashboard client script.

Ctest_drop_method

Specify the CTest DropMethod setting in a ctest(1) dashboard client script.

Ctest_drop_site

Specify the CTest DropSite setting in a ctest(1) dashboard client script.

Ctest_drop_site_cdash

Specify the CTest IsCDash setting in a ctest(1) dashboard client script.

Ctest_drop_site_password

Specify the CTest DropSitePassword setting in a ctest(1) dashboard client script.

Ctest_drop_site_user

Specify the CTest DropSiteUser setting in a ctest(1) dashboard client script.

Ctest_extra_coverage_glob

A list of regular expressions which will be used to find files which should be covered by the ctest_coverage() command.

It is initialized by ctest(1), but may be edited in a CTestCustom file. See ctest_read_custom_files() documentation.

Ctest_git_command

Specify the CTest GITCommand setting in a ctest(1) dashboard client script.

Ctest_git_init_submodules

Specify the CTest GITInitSubmodules setting in a ctest(1) dashboard client script.

Ctest_git_update_custom

Specify the CTest GITUpdateCustom setting in a ctest(1) dashboard client script.

Ctest_git_update_options

Specify the CTest GITUpdateOptions setting in a ctest(1) dashboard client script.

Ctest_hg_command

Specify the CTest HGCommand setting in a ctest(1) dashboard client script.

Ctest_hg_update_options

Specify the CTest HGUpdateOptions setting in a ctest(1) dashboard client script.

Ctest_memorycheck_command

Specify the CTest MemoryCheckCommand setting in a ctest(1) dashboard client script.

Ctest_memorycheck_command_options

Specify the CTest MemoryCheckCommandOptions setting in a ctest(1) dashboard client script.

Ctest_memorycheck_sanitizer_options

Specify the CTest MemoryCheckSanitizerOptions setting in a ctest(1) dashboard client script.

Ctest_memorycheck_suppressions_file

Specify the CTest MemoryCheckSuppressionFile setting in a ctest(1) dashboard client script.

Ctest_memorycheck_type

Specify the CTest MemoryCheckType setting in a ctest(1) dashboard client script. Valid values are Valgrind, Purify, BoundsChecker, and ThreadSanitizer, AddressSanitizer, MemorySanitizer, and UndefinedBehaviorSanitizer.

Ctest_nightly_start_time

Specify the CTest NightlyStartTime setting in a ctest(1) dashboard client script.

Ctest_p4_client

Specify the CTest P4Client setting in a ctest(1) dashboard client script.

Ctest_p4_command

Specify the CTest P4Command setting in a ctest(1) dashboard client script.

Ctest_p4_options

Specify the CTest P4Options setting in a ctest(1) dashboard client script.

Ctest_p4_update_options

Specify the CTest P4UpdateOptions setting in a ctest(1) dashboard client script.

Ctest_scp_command

Specify the CTest SCPCommand setting in a ctest(1) dashboard client script.

Ctest_site

Specify the CTest Site setting in a ctest(1) dashboard client script.

Ctest_source_directory

Specify the CTest SourceDirectory setting in a ctest(1) dashboard client script.

Ctest_svn_command

Specify the CTest SVNCommand setting in a ctest(1) dashboard client script.

Ctest_svn_options

Specify the CTest SVNOptions setting in a ctest(1) dashboard client script.

Ctest_svn_update_options

Specify the CTest SVNUpdateOptions setting in a ctest(1) dashboard client script.

Ctest_test_load

Specify the TestLoad setting in the CTest Test Step of a ctest(1) dashboard client script. This sets the default value for the TEST_LOAD option of the ctest_test() command.

Ctest_test_timeout

Specify the CTest TimeOut setting in a ctest(1) dashboard client script.

Ctest_trigger_site

Specify the CTest TriggerSite setting in a ctest(1) dashboard client script.

Ctest_update_command

Specify the CTest UpdateCommand setting in a ctest(1) dashboard client script.

Ctest_update_options

Specify the CTest UpdateOptions setting in a ctest(1) dashboard client script.

Ctest_update_version_only

Specify the CTest UpdateVersionOnly setting in a ctest(1) dashboard client script.

Ctest_use_launchers

Specify the CTest UseLaunchers setting in a ctest(1) dashboard client script.

Variables for Cpack

Cpack_absolute_destination_files

List of files which have been installed using an ABSOLUTE DESTINATION path.

This variable is a Read-Only variable which is set internally by CPack during installation and before packaging using Cmake_absolute_destination_files defined in cmake_install.cmake scripts. The value can be used within CPack project configuration file and/or CPack<GEN>.cmake file of <GEN> generator.

Cpack_component_include_toplevel_directory

Boolean toggle to include/exclude top level directory (component case).

Similar usage as Cpack_include_toplevel_directory but for the component case. See Cpack_include_toplevel_directory documentation for the detail.

Cpack_error_on_absolute_install_destination

Ask CPack to error out as soon as a file with absolute INSTALL DESTINATION is encountered.

The fatal error is emitted before the installation of the offending file takes place. Some CPack generators, like NSIS, enforce this internally. This variable triggers the definition of Cmake_error_on_absolute_install_destination when CPack runs.

Cpack_include_toplevel_directory

Boolean toggle to include/exclude top level directory.

When preparing a package CPack installs the item under the so-called top level directory. The purpose of is to include (set to 1 or ON or TRUE) the top level directory in the package or not (set to 0 or OFF or FALSE).

Each CPack generator has a built-in default value for this variable. E.g. Archive generators (ZIP, TGZ, ...) includes the top level whereas RPM or DEB don't. The user may override the default value by setting this variable.

There is a similar variable Cpack_component_include_toplevel_directory which may be used to override the behavior for the component packaging case which may have different default value for historical (now backward compatibility) reason.

Cpack_install_script

Extra CMake script provided by the user.

If set this CMake script will be executed by CPack during its local [CPack-private] installation which is done right before packaging the files. The script is not called by e.g.: make install.

Cpack_packaging_install_prefix

The prefix used in the built package.

Each CPack generator has a default value (like /usr). This default value may be overwritten from the CMakeLists.txt or the cpack(1) command line by setting an alternative value. Example:

set(CPACK_PACKAGING_INSTALL_PREFIX "/opt")

This is not the same purpose as Cmake_install_prefix which is used when installing from the build tree without building a package.

Cpack_set_destdir

Boolean toggle to make CPack use DESTDIR mechanism when packaging.

DESTDIR means DESTination DIRectory. It is commonly used by makefile users in order to install software at non-default location. It is a basic relocation mechanism that should not be used on Windows (see Cmake_install_prefix documentation). It is usually invoked like this:

make DESTDIR=/home/john install

which will install the concerned software using the installation prefix, e.g. /usr/local prepended with the DESTDIR value which finally gives /home/john/usr/local. When preparing a package, CPack first installs the items to be packaged in a local (to the build tree) directory by using the same DESTDIR mechanism. Nevertheless, if Cpack_set_destdir is set then CPack will set DESTDIR before doing the local install. The most noticeable difference is that without Cpack_set_destdir, CPack uses Cpack_packaging_install_prefix as a prefix whereas with Cpack_set_destdir set, CPack will use Cmake_install_prefix as a prefix.

Manually setting Cpack_set_destdir may help (or simply be necessary) if some install rules uses absolute DESTINATION (see CMake install() command). However, starting with CPack/CMake 2.8.3 RPM and DEB installers tries to handle DESTDIR automatically so that it is seldom necessary for the user to set it.

Cpack_warn_on_absolute_install_destination

Ask CPack to warn each time a file with absolute INSTALL DESTINATION is encountered.

This variable triggers the definition of Cmake_warn_on_absolute_install_destination when CPack runs cmake_install.cmake scripts.

Referenced By

ccmake(1), cmake(1), cmake-developer(7), cmake-gui(1), cmake-language(7), cpack(1), ctest(1).

Dec 01, 2016 3.7.1 CMake