| .\" Man page generated from reStructuredText. |
| . |
| .TH "CMAKE-VARIABLES" "7" "Apr 12, 2022" "3.23.1" "CMake" |
| .SH NAME |
| cmake-variables \- CMake Variables Reference |
| . |
| .nr rst2man-indent-level 0 |
| . |
| .de1 rstReportMargin |
| \\$1 \\n[an-margin] |
| level \\n[rst2man-indent-level] |
| level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| - |
| \\n[rst2man-indent0] |
| \\n[rst2man-indent1] |
| \\n[rst2man-indent2] |
| .. |
| .de1 INDENT |
| .\" .rstReportMargin pre: |
| . RS \\$1 |
| . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] |
| . nr rst2man-indent-level +1 |
| .\" .rstReportMargin post: |
| .. |
| .de UNINDENT |
| . RE |
| .\" indent \\n[an-margin] |
| .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| .nr rst2man-indent-level -1 |
| .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| .in \\n[rst2man-indent\\n[rst2man-indent-level]]u |
| .. |
| .sp |
| This page documents variables that are provided by CMake |
| or have meaning to CMake when set by project code. |
| .sp |
| For general information on variables, see the |
| Variables |
| section in the cmake\-language manual. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| CMake reserves identifiers that: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| begin with \fBCMAKE_\fP (upper\-, lower\-, or mixed\-case), or |
| .IP \(bu 2 |
| begin with \fB_CMAKE_\fP (upper\-, lower\-, or mixed\-case), or |
| .IP \(bu 2 |
| begin with \fB_\fP followed by the name of any \fBCMake Command\fP\&. |
| .UNINDENT |
| .UNINDENT |
| .UNINDENT |
| .SH VARIABLES THAT PROVIDE INFORMATION |
| .SS CMAKE_AR |
| .sp |
| Name of archiving tool for static libraries. |
| .sp |
| This specifies the name of the program that creates archive or static |
| libraries. |
| .SS CMAKE_ARGC |
| .sp |
| Number of command line arguments passed to CMake in script mode. |
| .sp |
| When run in \-P script mode, CMake sets this |
| variable to the number of command line arguments. See also |
| \fBCMAKE_ARGV0\fP, \fB1\fP, \fB2\fP ... |
| .SS CMAKE_ARGV0 |
| .sp |
| Command line argument passed to CMake in script mode. |
| .sp |
| When run in \-P script mode, CMake sets this |
| variable to the first command line argument. It then also sets \fBCMAKE_ARGV1\fP, |
| \fBCMAKE_ARGV2\fP, ... and so on, up to the number of command line arguments |
| given. See also \fBCMAKE_ARGC\fP\&. |
| .SS CMAKE_BINARY_DIR |
| .sp |
| The path to the top level of the build tree. |
| .sp |
| 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 |
| \fBCMAKE_SOURCE_DIR\fP\&. |
| .sp |
| When run in \-P script mode, CMake sets the variables |
| \fI\%CMAKE_BINARY_DIR\fP, \fBCMAKE_SOURCE_DIR\fP, |
| \fBCMAKE_CURRENT_BINARY_DIR\fP and |
| \fBCMAKE_CURRENT_SOURCE_DIR\fP to the current working directory. |
| .SS CMAKE_BUILD_TOOL |
| .sp |
| This variable exists only for backwards compatibility. |
| It contains the same value as \fBCMAKE_MAKE_PROGRAM\fP\&. |
| Use that variable instead. |
| .SS CMAKE_CACHE_MAJOR_VERSION |
| .sp |
| Major version of CMake used to create the \fBCMakeCache.txt\fP file |
| .sp |
| 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. |
| .SS CMAKE_CACHE_MINOR_VERSION |
| .sp |
| Minor version of CMake used to create the \fBCMakeCache.txt\fP file |
| .sp |
| 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. |
| .SS CMAKE_CACHE_PATCH_VERSION |
| .sp |
| Patch version of CMake used to create the \fBCMakeCache.txt\fP file |
| .sp |
| 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. |
| .SS CMAKE_CACHEFILE_DIR |
| .sp |
| This variable is used internally by CMake, and may not be set during |
| the first configuration of a build tree. When it is set, it has the |
| same value as \fBCMAKE_BINARY_DIR\fP\&. Use that variable instead. |
| .SS CMAKE_CFG_INTDIR |
| .sp |
| Deprecated since version 3.21: This variable has poor support on \fBNinja Multi\-Config\fP, and |
| predates the existence of the \fB$<CONFIG>\fP generator expression. Use |
| \fB$<CONFIG>\fP instead. |
| |
| .sp |
| Build\-time reference to per\-configuration output subdirectory. |
| .sp |
| For native build systems supporting multiple configurations in the |
| build tree (such as Visual Studio Generators and \fBXcode\fP), |
| 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 \fI\&.\fP because there is only one configuration in a build tree. |
| Example values: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| $(ConfigurationName) = Visual Studio 9 |
| $(Configuration) = Visual Studio 10 |
| $(CONFIGURATION) = Xcode |
| \&. = Make\-based tools |
| \&. = Ninja |
| ${CONFIGURATION} = Ninja Multi\-Config |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| 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: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| 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) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Note that \fBCMAKE_CFG_INTDIR\fP is no longer necessary for this purpose but |
| has been left for compatibility with existing projects. Instead |
| \fBadd_custom_command()\fP recognizes executable target names in its |
| \fBCOMMAND\fP option, so |
| \fB${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mytool\fP can be replaced |
| by just \fBmytool\fP\&. |
| .sp |
| 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 \fBCMAKE_INTDIR\fP to the compilation |
| of all source files. |
| .SS CMAKE_COMMAND |
| .sp |
| The full path to the \fBcmake(1)\fP executable. |
| .sp |
| This is the full path to the CMake executable \fBcmake(1)\fP which is |
| useful from custom commands that want to use the \fBcmake \-E\fP option for |
| portable system commands. (e.g. \fB/usr/local/bin/cmake\fP) |
| .SS CMAKE_CPACK_COMMAND |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Full path to \fBcpack(1)\fP command installed with CMake. |
| .sp |
| This is the full path to the CPack executable \fBcpack(1)\fP which is |
| useful from custom commands that want to use the \fBcmake(1)\fP \fB\-E\fP |
| option for portable system commands. |
| .SS CMAKE_CROSSCOMPILING |
| .sp |
| Intended to indicate whether CMake is cross compiling, but note limitations |
| discussed below. |
| .sp |
| This variable will be set to true by CMake if the \fBCMAKE_SYSTEM_NAME\fP |
| variable has been set manually (i.e. in a toolchain file or as a cache entry |
| from the \fBcmake\fP command line). In most cases, manually |
| setting \fBCMAKE_SYSTEM_NAME\fP will only be done when cross compiling, |
| since it will otherwise be given the same value as |
| \fBCMAKE_HOST_SYSTEM_NAME\fP if not manually set, which is correct for |
| the non\-cross\-compiling case. In the event that \fBCMAKE_SYSTEM_NAME\fP |
| is manually set to the same value as \fBCMAKE_HOST_SYSTEM_NAME\fP, then |
| \fBCMAKE_CROSSCOMPILING\fP will still be set to true. |
| .sp |
| Another case to be aware of is that builds targeting Apple platforms other than |
| macOS are handled differently to other cross compiling scenarios. Rather than |
| relying on \fBCMAKE_SYSTEM_NAME\fP to select the target platform, Apple |
| device builds use \fBCMAKE_OSX_SYSROOT\fP to select the appropriate SDK, |
| which indirectly determines the target platform. Furthermore, when using the |
| \fBXcode\fP generator, developers can switch between device and |
| simulator builds at build time rather than having a single |
| choice at configure time, so the concept |
| of whether the build is cross compiling or not is more complex. Therefore, the |
| use of \fBCMAKE_CROSSCOMPILING\fP is not recommended for projects targeting Apple |
| devices. |
| .SS CMAKE_CROSSCOMPILING_EMULATOR |
| .sp |
| New in version 3.3. |
| |
| .sp |
| This variable is only used when \fBCMAKE_CROSSCOMPILING\fP is on. It |
| should point to a command on the host system that can run executable built |
| for the target system. |
| .sp |
| New in version 3.15: If this variable contains a semicolon\-separated list, then the first value is the command and remaining values are its |
| arguments. |
| |
| .sp |
| The command will be used to run \fBtry_run()\fP generated executables, |
| which avoids manual population of the \fBTryRunResults.cmake\fP file. |
| .sp |
| It is also used as the default value for the |
| \fBCROSSCOMPILING_EMULATOR\fP target property of executables. |
| .SS CMAKE_CTEST_COMMAND |
| .sp |
| Full path to \fBctest(1)\fP command installed with CMake. |
| .sp |
| This is the full path to the CTest executable \fBctest(1)\fP which is |
| useful from custom commands that want to use the \fBcmake(1)\fP \fB\-E\fP |
| option for portable system commands. |
| .SS CMAKE_CURRENT_BINARY_DIR |
| .sp |
| The path to the binary directory currently being processed. |
| .sp |
| This is the full path to the build directory that is currently being |
| processed by cmake. Each directory added by \fBadd_subdirectory()\fP 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. |
| .sp |
| When run in \-P script mode, CMake sets the variables |
| \fBCMAKE_BINARY_DIR\fP, \fBCMAKE_SOURCE_DIR\fP, |
| \fI\%CMAKE_CURRENT_BINARY_DIR\fP and |
| \fBCMAKE_CURRENT_SOURCE_DIR\fP to the current working directory. |
| .SS CMAKE_CURRENT_FUNCTION |
| .sp |
| New in version 3.17. |
| |
| .sp |
| When executing code inside a \fBfunction()\fP, this variable |
| contains the name of the current function. It can be useful for |
| diagnostic or debug messages. |
| .sp |
| See also \fBCMAKE_CURRENT_FUNCTION_LIST_DIR\fP, |
| \fBCMAKE_CURRENT_FUNCTION_LIST_FILE\fP and |
| \fBCMAKE_CURRENT_FUNCTION_LIST_LINE\fP\&. |
| .SS CMAKE_CURRENT_FUNCTION_LIST_DIR |
| .sp |
| New in version 3.17. |
| |
| .sp |
| When executing code inside a \fBfunction()\fP, this variable |
| contains the full directory of the listfile that defined the current function. |
| .sp |
| It is quite common practice in CMake for modules to use some additional files, |
| such as templates to be copied in after substituting CMake variables. |
| In such cases, a function needs to know where to locate those files in a way |
| that doesn\(aqt depend on where the function is called. Without |
| \fBCMAKE_CURRENT_FUNCTION_LIST_DIR\fP, the code to do that would typically use |
| the following pattern: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(_THIS_MODULE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}") |
| |
| function(foo) |
| configure_file( |
| "${_THIS_MODULE_BASE_DIR}/some.template.in" |
| some.output |
| ) |
| endfunction() |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Using \fBCMAKE_CURRENT_FUNCTION_LIST_DIR\fP inside the function instead |
| eliminates the need for the extra variable which would otherwise be visible |
| outside the function\(aqs scope. |
| The above example can be written in the more concise and more robust form: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| function(foo) |
| configure_file( |
| "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/some.template.in" |
| some.output |
| ) |
| endfunction() |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| See also \fBCMAKE_CURRENT_FUNCTION\fP, |
| \fBCMAKE_CURRENT_FUNCTION_LIST_FILE\fP and |
| \fBCMAKE_CURRENT_FUNCTION_LIST_LINE\fP\&. |
| .SS CMAKE_CURRENT_FUNCTION_LIST_FILE |
| .sp |
| New in version 3.17. |
| |
| .sp |
| When executing code inside a \fBfunction()\fP, this variable |
| contains the full path to the listfile that defined the current function. |
| .sp |
| See also \fBCMAKE_CURRENT_FUNCTION\fP, |
| \fBCMAKE_CURRENT_FUNCTION_LIST_DIR\fP and |
| \fBCMAKE_CURRENT_FUNCTION_LIST_LINE\fP\&. |
| .SS CMAKE_CURRENT_FUNCTION_LIST_LINE |
| .sp |
| New in version 3.17. |
| |
| .sp |
| When executing code inside a \fBfunction()\fP, this variable |
| contains the line number in the listfile where the current function |
| was defined. |
| .sp |
| See also \fBCMAKE_CURRENT_FUNCTION\fP, |
| \fBCMAKE_CURRENT_FUNCTION_LIST_DIR\fP and |
| \fBCMAKE_CURRENT_FUNCTION_LIST_FILE\fP\&. |
| .SS CMAKE_CURRENT_LIST_DIR |
| .sp |
| Full directory of the listfile currently being processed. |
| .sp |
| 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 (\fBCMAKE_CURRENT_LIST_FILE\fP) 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. |
| .sp |
| See also \fBCMAKE_CURRENT_LIST_FILE\fP\&. |
| .SS CMAKE_CURRENT_LIST_FILE |
| .sp |
| Full path to the listfile currently being processed. |
| .sp |
| 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. |
| .sp |
| See also \fBCMAKE_PARENT_LIST_FILE\fP\&. |
| .SS CMAKE_CURRENT_LIST_LINE |
| .sp |
| The line number of the current file being processed. |
| .sp |
| This is the line number of the file currently being processed by |
| cmake. |
| .sp |
| If CMake is currently processing deferred calls scheduled by |
| the \fBcmake_language(DEFER)\fP command, this variable |
| evaluates to \fBDEFERRED\fP instead of a specific line number. |
| .SS CMAKE_CURRENT_SOURCE_DIR |
| .sp |
| The path to the source directory currently being processed. |
| .sp |
| This is the full path to the source directory that is currently being |
| processed by cmake. |
| .sp |
| When run in \-P script mode, CMake sets the variables |
| \fBCMAKE_BINARY_DIR\fP, \fBCMAKE_SOURCE_DIR\fP, |
| \fBCMAKE_CURRENT_BINARY_DIR\fP and |
| \fI\%CMAKE_CURRENT_SOURCE_DIR\fP to the current working directory. |
| .SS CMAKE_DEBUG_TARGET_PROPERTIES |
| .sp |
| Enables tracing output for target properties. |
| .sp |
| 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: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBAUTOUIC_OPTIONS\fP |
| .IP \(bu 2 |
| \fBCOMPILE_DEFINITIONS\fP |
| .IP \(bu 2 |
| \fBCOMPILE_FEATURES\fP |
| .IP \(bu 2 |
| \fBCOMPILE_OPTIONS\fP |
| .IP \(bu 2 |
| \fBINCLUDE_DIRECTORIES\fP |
| .IP \(bu 2 |
| \fBLINK_DIRECTORIES\fP |
| .IP \(bu 2 |
| \fBLINK_OPTIONS\fP |
| .IP \(bu 2 |
| \fBPOSITION_INDEPENDENT_CODE\fP |
| .IP \(bu 2 |
| \fBSOURCES\fP |
| .UNINDENT |
| .sp |
| target properties and any other property listed in |
| \fBCOMPATIBLE_INTERFACE_STRING\fP and other |
| \fBCOMPATIBLE_INTERFACE_\fP properties. It outputs an origin for each entry |
| in the target property. Default is unset. |
| .SS CMAKE_DIRECTORY_LABELS |
| .sp |
| New in version 3.10. |
| |
| .sp |
| Specify labels for the current directory. |
| .sp |
| This is used to initialize the \fBLABELS\fP directory property. |
| .SS CMAKE_DL_LIBS |
| .sp |
| Name of library containing \fBdlopen\fP and \fBdlclose\fP\&. |
| .sp |
| The name of the library that has \fBdlopen\fP and \fBdlclose\fP in it, usually |
| \fB\-ldl\fP on most UNIX machines. |
| .SS CMAKE_DOTNET_SDK |
| .sp |
| New in version 3.23. |
| |
| .sp |
| Default value for \fBDOTNET_SDK\fP property of targets. |
| .sp |
| This variable is used to initialize the \fBDOTNET_SDK\fP |
| property on all targets. See that target property for additional information. |
| .SS CMAKE_DOTNET_TARGET_FRAMEWORK |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Default value for \fBDOTNET_TARGET_FRAMEWORK\fP property of |
| targets. |
| .sp |
| This variable is used to initialize the |
| \fBDOTNET_TARGET_FRAMEWORK\fP property on all targets. See that |
| target property for additional information. |
| .sp |
| Setting \fBCMAKE_DOTNET_TARGET_FRAMEWORK\fP may be necessary |
| when working with \fBC#\fP and newer .NET framework versions to |
| avoid referencing errors with the \fBALL_BUILD\fP CMake target. |
| .sp |
| This variable is only evaluated for Visual Studio Generators |
| VS 2010 and above. |
| .SS CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION |
| .sp |
| New in version 3.12. |
| |
| .sp |
| Default value for \fBDOTNET_TARGET_FRAMEWORK_VERSION\fP |
| property of targets. |
| .sp |
| This variable is used to initialize the |
| \fBDOTNET_TARGET_FRAMEWORK_VERSION\fP property on all |
| targets. See that target property for additional information. When set, |
| \fBCMAKE_DOTNET_TARGET_FRAMEWORK\fP takes precednece over this |
| variable. See that variable or the associated target property |
| \fBDOTNET_TARGET_FRAMEWORK\fP for additional information. |
| .sp |
| Setting \fBCMAKE_DOTNET_TARGET_FRAMEWORK_VERSION\fP may be necessary |
| when working with \fBC#\fP and newer .NET framework versions to |
| avoid referencing errors with the \fBALL_BUILD\fP CMake target. |
| .sp |
| This variable is only evaluated for Visual Studio Generators |
| VS 2010 and above. |
| .SS CMAKE_EDIT_COMMAND |
| .sp |
| Full path to \fBcmake\-gui(1)\fP or \fBccmake(1)\fP\&. Defined only for |
| Makefile Generators when not using an "extra" generator for an IDE. |
| .sp |
| This is the full path to the CMake executable that can graphically |
| edit the cache. For example, \fBcmake\-gui(1)\fP or \fBccmake(1)\fP\&. |
| .SS CMAKE_EXECUTABLE_SUFFIX |
| .sp |
| The suffix for executables on this platform. |
| .sp |
| The suffix to use for the end of an executable filename if any, \fB\&.exe\fP |
| on Windows. |
| .sp |
| \fBCMAKE_EXECUTABLE_SUFFIX_<LANG>\fP overrides this for |
| language \fB<LANG>\fP\&. |
| .SS CMAKE_EXECUTABLE_SUFFIX_<LANG> |
| .sp |
| The suffix to use for the end of an executable filename of \fB<LANG>\fP |
| compiler target architecture, if any. |
| .sp |
| It overrides \fBCMAKE_EXECUTABLE_SUFFIX\fP for language \fB<LANG>\fP\&. |
| .SS CMAKE_EXTRA_GENERATOR |
| .sp |
| The extra generator used to build the project. See |
| \fBcmake\-generators(7)\fP\&. |
| .sp |
| When using the Eclipse, CodeBlocks, CodeLite, Kate or Sublime generators, CMake |
| generates Makefiles (\fBCMAKE_GENERATOR\fP) and additionally project |
| files for the respective IDE. This IDE project file generator is stored in |
| \fBCMAKE_EXTRA_GENERATOR\fP (e.g. \fBEclipse CDT4\fP). |
| .SS CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES |
| .sp |
| Additional suffixes for shared libraries. |
| .sp |
| Extensions for shared libraries other than that specified by |
| \fBCMAKE_SHARED_LIBRARY_SUFFIX\fP, if any. CMake uses this to recognize |
| external shared library files during analysis of libraries linked by a |
| target. |
| .SS CMAKE_FIND_DEBUG_MODE |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Print extra find call information for the following commands to standard |
| error: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBfind_program()\fP |
| .IP \(bu 2 |
| \fBfind_library()\fP |
| .IP \(bu 2 |
| \fBfind_file()\fP |
| .IP \(bu 2 |
| \fBfind_path()\fP |
| .IP \(bu 2 |
| \fBfind_package()\fP |
| .UNINDENT |
| .sp |
| Output is designed for human consumption and not for parsing. |
| Enabling this variable is equivalent to using \fBcmake\fP \fB\-\-debug\-find\fP |
| with the added ability to enable debugging for a subset of find calls. |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_FIND_DEBUG_MODE TRUE) |
| find_program(...) |
| set(CMAKE_FIND_DEBUG_MODE FALSE) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Default is unset. |
| .SS CMAKE_FIND_PACKAGE_NAME |
| .sp |
| New in version 3.1.1. |
| |
| .sp |
| Defined by the \fBfind_package()\fP command while loading |
| a find module to record the caller\-specified package name. |
| See command documentation for details. |
| .SS CMAKE_FIND_PACKAGE_SORT_DIRECTION |
| .sp |
| New in version 3.7. |
| |
| .sp |
| The sorting direction used by \fBCMAKE_FIND_PACKAGE_SORT_ORDER\fP\&. |
| It can assume one of the following values: |
| .INDENT 0.0 |
| .TP |
| .B \fBDEC\fP |
| Default. Ordering is done in descending mode. |
| The highest folder found will be tested first. |
| .TP |
| .B \fBASC\fP |
| Ordering is done in ascending mode. |
| The lowest folder found will be tested first. |
| .UNINDENT |
| .sp |
| If \fBCMAKE_FIND_PACKAGE_SORT_ORDER\fP is not set or is set to \fBNONE\fP |
| this variable has no effect. |
| .SS CMAKE_FIND_PACKAGE_SORT_ORDER |
| .sp |
| New in version 3.7. |
| |
| .sp |
| The default order for sorting packages found using \fBfind_package()\fP\&. |
| It can assume one of the following values: |
| .INDENT 0.0 |
| .TP |
| .B \fBNONE\fP |
| Default. No attempt is done to sort packages. |
| The first valid package found will be selected. |
| .TP |
| .B \fBNAME\fP |
| Sort packages lexicographically before selecting one. |
| .TP |
| .B \fBNATURAL\fP |
| Sort packages using natural order (see \fBstrverscmp(3)\fP manual), |
| i.e. such that contiguous digits are compared as whole numbers. |
| .UNINDENT |
| .sp |
| Natural sorting can be employed to return the highest version when multiple |
| versions of the same library are found by \fBfind_package()\fP\&. For |
| example suppose that the following libraries have been found: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| libX\-1.1.0 |
| .IP \(bu 2 |
| libX\-1.2.9 |
| .IP \(bu 2 |
| libX\-1.2.10 |
| .UNINDENT |
| .sp |
| By setting \fBNATURAL\fP order we can select the one with the highest |
| version number \fBlibX\-1.2.10\fP\&. |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL) |
| find_package(libX CONFIG) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The sort direction can be controlled using the |
| \fBCMAKE_FIND_PACKAGE_SORT_DIRECTION\fP variable |
| (by default decrescent, e.g. lib\-B will be tested before lib\-A). |
| .SS CMAKE_GENERATOR |
| .sp |
| The generator used to build the project. See \fBcmake\-generators(7)\fP\&. |
| .sp |
| The name of the generator that is being used to generate the build |
| files. (e.g. \fBUnix Makefiles\fP, \fBNinja\fP, etc.) |
| .sp |
| The value of this variable should never be modified by project code. |
| A generator may be selected via the \fBcmake(1)\fP \fB\-G\fP option, |
| interactively in \fBcmake\-gui(1)\fP, or via the \fBCMAKE_GENERATOR\fP |
| environment variable. |
| .SS CMAKE_GENERATOR_INSTANCE |
| .sp |
| New in version 3.11. |
| |
| .sp |
| Generator\-specific instance specification provided by user. |
| .sp |
| Some CMake generators support selection of an instance of the native build |
| system when multiple instances are available. If the user specifies an |
| instance (e.g. by setting this cache entry or via the |
| \fBCMAKE_GENERATOR_INSTANCE\fP environment variable), or after a default |
| instance is chosen when a build tree is first configured, the value will be |
| available in this variable. |
| .sp |
| The value of this variable should never be modified by project code. |
| A toolchain file specified by the \fBCMAKE_TOOLCHAIN_FILE\fP |
| variable may initialize \fBCMAKE_GENERATOR_INSTANCE\fP as a cache entry. |
| Once a given build tree has been initialized with a particular value |
| for this variable, changing the value has undefined behavior. |
| .sp |
| Instance specification is supported only on specific generators. |
| .SS Visual Studio Instance Selection |
| .sp |
| Visual Studio Generators support instance specification for |
| Visual Studio 2017 and above. The \fBCMAKE_GENERATOR_INSTANCE\fP variable |
| may be set as a cache entry selecting an instance of Visual Studio |
| via one of the following forms: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBlocation\fP |
| .IP \(bu 2 |
| \fBlocation[,key=value]*\fP |
| .IP \(bu 2 |
| \fBkey=value[,key=value]*\fP |
| .UNINDENT |
| .sp |
| The \fBlocation\fP specifies the absolute path to the top\-level directory |
| of the VS installation. |
| .sp |
| The \fBkey=value\fP pairs form a comma\-separated list of options to |
| specify details of the instance selection. |
| Supported pairs are: |
| .INDENT 0.0 |
| .TP |
| .B \fBversion=<major>.<minor>.<date>.<build>\fP |
| New in version 3.23. |
| |
| .sp |
| Specify the 4\-component VS Build Version, a.k.a. Build Number. |
| The components are: |
| .sp |
| \fB<major>.<minor>\fP |
| .INDENT 7.0 |
| .INDENT 3.5 |
| The VS major and minor version numbers. |
| These are the same as the release version numbers. |
| .UNINDENT |
| .UNINDENT |
| .sp |
| \fB<date>\fP |
| .INDENT 7.0 |
| .INDENT 3.5 |
| A build date in the format \fBMMMDD\fP, where \fBMMM\fP is a month index |
| since an epoch used by Microsoft, and \fBDD\fP is a day in that month. |
| .UNINDENT |
| .UNINDENT |
| .sp |
| \fB<build>\fP |
| .INDENT 7.0 |
| .INDENT 3.5 |
| A build index on the day represented by \fB<date>\fP\&. |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The build number is reported by \fBvswhere\fP as \fBinstallationVersion\fP\&. |
| For example, VS 16.11.10 has build number \fB16.11.32126.315\fP\&. |
| .UNINDENT |
| .sp |
| New in version 3.23: A portable VS instance, which is not known to the Visual Studio Installer, |
| may be specified by providing both \fBlocation\fP and \fBversion=\fP\&. |
| |
| .sp |
| If the value of \fBCMAKE_GENERATOR_INSTANCE\fP is not specified explicitly |
| by the user or a toolchain file, CMake queries the Visual Studio Installer |
| to locate VS instances, chooses one, and sets the variable as a cache entry |
| to hold the value persistently. If an environment variable of the form |
| \fBVS##0COMNTOOLS\fP, where \fB##\fP the Visual Studio major version number, |
| is set and points to the \fBCommon7/Tools\fP directory within one of the |
| VS instances, that instance will be used. Otherwise, if more than one |
| VS instance is installed we do not define which one is chosen by default. |
| .SS CMAKE_GENERATOR_PLATFORM |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Generator\-specific target platform specification provided by user. |
| .sp |
| 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 \fBcmake(1)\fP \fB\-A\fP |
| option or via the \fBCMAKE_GENERATOR_PLATFORM\fP environment variable) |
| the value will be available in this variable. |
| .sp |
| The value of this variable should never be modified by project code. |
| A toolchain file specified by the \fBCMAKE_TOOLCHAIN_FILE\fP |
| variable may initialize \fBCMAKE_GENERATOR_PLATFORM\fP\&. Once a given |
| build tree has been initialized with a particular value for this |
| variable, changing the value has undefined behavior. |
| .sp |
| Platform specification is supported only on specific generators: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| For Visual Studio Generators with VS 2005 and above this |
| specifies the target architecture. |
| .IP \(bu 2 |
| For \fBGreen Hills MULTI\fP this specifies the target architecture. |
| .UNINDENT |
| .sp |
| See native build system documentation for allowed platform names. |
| .SS Visual Studio Platform Selection |
| .sp |
| On Visual Studio Generators the selected platform name |
| is provided in the \fBCMAKE_VS_PLATFORM_NAME\fP variable. |
| .SS CMAKE_GENERATOR_TOOLSET |
| .sp |
| Native build system toolset specification provided by user. |
| .sp |
| Some CMake generators support a toolset specification to tell the |
| native build system how to choose a compiler. If the user specifies |
| a toolset (e.g. via the \fBcmake(1)\fP \fB\-T\fP option or via |
| the \fBCMAKE_GENERATOR_TOOLSET\fP environment variable) the value |
| will be available in this variable. |
| .sp |
| The value of this variable should never be modified by project code. |
| A toolchain file specified by the \fBCMAKE_TOOLCHAIN_FILE\fP |
| variable may initialize \fBCMAKE_GENERATOR_TOOLSET\fP\&. Once a given |
| build tree has been initialized with a particular value for this |
| variable, changing the value has undefined behavior. |
| .sp |
| Toolset specification is supported only on specific generators: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| Visual Studio Generators for VS 2010 and above |
| .IP \(bu 2 |
| The \fBXcode\fP generator for Xcode 3.0 and above |
| .IP \(bu 2 |
| The \fBGreen Hills MULTI\fP generator |
| .UNINDENT |
| .sp |
| See native build system documentation for allowed toolset names. |
| .SS Visual Studio Toolset Selection |
| .sp |
| The Visual Studio Generators support toolset specification |
| using one of these forms: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBtoolset\fP |
| .IP \(bu 2 |
| \fBtoolset[,key=value]*\fP |
| .IP \(bu 2 |
| \fBkey=value[,key=value]*\fP |
| .UNINDENT |
| .sp |
| The \fBtoolset\fP specifies the toolset name. The selected toolset name |
| is provided in the \fBCMAKE_VS_PLATFORM_TOOLSET\fP variable. |
| .sp |
| The \fBkey=value\fP pairs form a comma\-separated list of options to |
| specify generator\-specific details of the toolset selection. |
| Supported pairs are: |
| .INDENT 0.0 |
| .TP |
| .B \fBcuda=<version>|<path>\fP |
| Specify the CUDA toolkit version to use or the path to a |
| standalone CUDA toolkit directory. Supported by VS 2010 |
| and above. The version can only be used with the CUDA |
| toolkit VS integration globally installed. |
| See the \fBCMAKE_VS_PLATFORM_TOOLSET_CUDA\fP and |
| \fBCMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR\fP variables. |
| .TP |
| .B \fBhost=<arch>\fP |
| Specify the host tools architecture as \fBx64\fP or \fBx86\fP\&. |
| Supported by VS 2013 and above. |
| See the \fBCMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE\fP |
| variable. |
| .TP |
| .B \fBversion=<version>\fP |
| Specify the toolset version to use. Supported by VS 2017 |
| and above with the specified toolset installed. |
| See the \fBCMAKE_VS_PLATFORM_TOOLSET_VERSION\fP variable. |
| .TP |
| .B \fBVCTargetsPath=<path>\fP |
| Specify an alternative \fBVCTargetsPath\fP value for Visual Studio |
| project files. This allows use of VS platform extension configuration |
| files (\fB\&.props\fP and \fB\&.targets\fP) that are not installed with VS. |
| .UNINDENT |
| .SS Visual Studio Toolset Customization |
| .sp |
| \fBThese are unstable interfaces with no compatibility guarantees\fP |
| because they hook into undocumented internal CMake implementation details. |
| Institutions may use these to internally maintain support for non\-public |
| Visual Studio platforms and toolsets, but must accept responsibility to |
| make updates as changes are made to CMake. |
| .sp |
| Additional \fBkey=value\fP pairs are available: |
| .INDENT 0.0 |
| .TP |
| .B \fBcustomFlagTableDir=<path>\fP |
| New in version 3.21. |
| |
| .sp |
| Specify the absolute path to a directory from which to load custom |
| flag tables stored as JSON documents with file names of the form |
| \fB<platform>_<toolset>_<tool>.json\fP or \fB<platform>_<tool>.json\fP, |
| where \fB<platform>\fP is the \fBCMAKE_VS_PLATFORM_NAME\fP, |
| \fB<toolset>\fP is the \fBCMAKE_VS_PLATFORM_TOOLSET\fP, |
| and \fB<tool>\fP is the tool for which the flag table is meant. |
| \fBThis naming pattern is an internal CMake implementation detail.\fP |
| The \fB<tool>\fP names are undocumented. The format of the \fB\&.json\fP |
| flag table files is undocumented. |
| .UNINDENT |
| .SS CMAKE_IMPORT_LIBRARY_PREFIX |
| .sp |
| The prefix for import libraries that you link to. |
| .sp |
| The prefix to use for the name of an import library if used on this |
| platform. |
| .sp |
| \fBCMAKE_IMPORT_LIBRARY_PREFIX_<LANG>\fP overrides this for language \fB<LANG>\fP\&. |
| .SS CMAKE_IMPORT_LIBRARY_SUFFIX |
| .sp |
| The suffix for import libraries that you link to. |
| .sp |
| The suffix to use for the end of an import library filename if used on |
| this platform. |
| .sp |
| \fBCMAKE_IMPORT_LIBRARY_SUFFIX_<LANG>\fP overrides this for language \fB<LANG>\fP\&. |
| .SS CMAKE_JOB_POOL_COMPILE |
| .sp |
| This variable is used to initialize the \fBJOB_POOL_COMPILE\fP |
| property on all the targets. See \fBJOB_POOL_COMPILE\fP |
| for additional information. |
| .SS CMAKE_JOB_POOL_LINK |
| .sp |
| This variable is used to initialize the \fBJOB_POOL_LINK\fP |
| property on all the targets. See \fBJOB_POOL_LINK\fP |
| for additional information. |
| .SS CMAKE_JOB_POOL_PRECOMPILE_HEADER |
| .sp |
| New in version 3.17. |
| |
| .sp |
| This variable is used to initialize the \fBJOB_POOL_PRECOMPILE_HEADER\fP |
| property on all the targets. See \fBJOB_POOL_PRECOMPILE_HEADER\fP |
| for additional information. |
| .SS CMAKE_JOB_POOLS |
| .sp |
| New in version 3.11. |
| |
| .sp |
| If the \fBJOB_POOLS\fP global property is not set, the value |
| of this variable is used in its place. See \fBJOB_POOLS\fP |
| for additional information. |
| .SS CMAKE_<LANG>_COMPILER_AR |
| .sp |
| New in version 3.9. |
| |
| .sp |
| A wrapper around \fBar\fP adding the appropriate \fB\-\-plugin\fP option for the |
| compiler. |
| .sp |
| See also \fBCMAKE_AR\fP\&. |
| .SS CMAKE_<LANG>_COMPILER_FRONTEND_VARIANT |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Identification string of the compiler frontend variant. |
| .sp |
| Some compilers have multiple, different frontends for accepting command |
| line options. (For example \fBClang\fP originally only had a frontend |
| compatible with the \fBGNU\fP compiler but since its port to Windows |
| (\fBClang\-Cl\fP) it now also supports a frontend compatible with \fBMSVC\fP\&.) |
| When CMake detects such a compiler it sets this |
| variable to what would have been the \fBCMAKE_<LANG>_COMPILER_ID\fP for |
| the compiler whose frontend it resembles. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| In other words, this variable describes what command line options |
| and language extensions the compiler frontend expects. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_<LANG>_COMPILER_RANLIB |
| .sp |
| New in version 3.9. |
| |
| .sp |
| A wrapper around \fBranlib\fP adding the appropriate \fB\-\-plugin\fP option for the |
| compiler. |
| .sp |
| See also \fBCMAKE_RANLIB\fP\&. |
| .SS CMAKE_<LANG>_LINK_LIBRARY_SUFFIX |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Language\-specific suffix for libraries that you link to. |
| .sp |
| The suffix to use for the end of a library filename, \fB\&.lib\fP on Windows. |
| .SS CMAKE_LINK_LIBRARY_SUFFIX |
| .sp |
| The suffix for libraries that you link to. |
| .sp |
| The suffix to use for the end of a library filename, \fB\&.lib\fP on Windows. |
| .SS CMAKE_LINK_SEARCH_END_STATIC |
| .sp |
| New in version 3.4. |
| |
| .sp |
| End a link line such that static system libraries are used. |
| .sp |
| Some linkers support switches such as \fB\-Bstatic\fP and \fB\-Bdynamic\fP to |
| determine whether to use static or shared libraries for \fB\-lXXX\fP options. |
| CMake uses these options to set the link type for libraries whose full |
| paths are not known or (in some cases) are in implicit link |
| directories for the platform. By default CMake adds an option at the |
| end of the library list (if necessary) to set the linker search type |
| back to its starting type. This property switches the final linker |
| search type to \fB\-Bstatic\fP regardless of how it started. |
| .sp |
| This variable is used to initialize the target property |
| \fBLINK_SEARCH_END_STATIC\fP for all targets. If set, its |
| value is also used by the \fBtry_compile()\fP command. |
| .sp |
| See also \fBCMAKE_LINK_SEARCH_START_STATIC\fP\&. |
| .SS CMAKE_LINK_SEARCH_START_STATIC |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Assume the linker looks for static libraries by default. |
| .sp |
| Some linkers support switches such as \fB\-Bstatic\fP and \fB\-Bdynamic\fP to |
| determine whether to use static or shared libraries for \fB\-lXXX\fP options. |
| CMake uses these options to set the link type for libraries whose full |
| paths are not known or (in some cases) are in implicit link |
| directories for the platform. By default the linker search type is |
| assumed to be \fB\-Bdynamic\fP at the beginning of the library list. This |
| property switches the assumption to \fB\-Bstatic\fP\&. It is intended for use |
| when linking an executable statically (e.g. with the GNU \fB\-static\fP |
| option). |
| .sp |
| This variable is used to initialize the target property |
| \fBLINK_SEARCH_START_STATIC\fP for all targets. If set, its |
| value is also used by the \fBtry_compile()\fP command. |
| .sp |
| See also \fBCMAKE_LINK_SEARCH_END_STATIC\fP\&. |
| .SS CMAKE_MAJOR_VERSION |
| .sp |
| First version number component of the \fBCMAKE_VERSION\fP |
| variable. |
| .SS CMAKE_MAKE_PROGRAM |
| .sp |
| 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 \fBPATH\fP\&. |
| .sp |
| The tool selected depends on the \fBCMAKE_GENERATOR\fP used |
| to configure the project: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| The Makefile Generators set this to \fBmake\fP, \fBgmake\fP, or |
| a generator\-specific tool (e.g. \fBnmake\fP for \fBNMake Makefiles\fP). |
| .sp |
| These generators store \fBCMAKE_MAKE_PROGRAM\fP in the CMake cache |
| so that it may be edited by the user. |
| .IP \(bu 2 |
| The \fBNinja\fP generator sets this to \fBninja\fP\&. |
| .sp |
| This generator stores \fBCMAKE_MAKE_PROGRAM\fP in the CMake cache |
| so that it may be edited by the user. |
| .IP \(bu 2 |
| The \fBXcode\fP generator sets this to \fBxcodebuild\fP\&. |
| .sp |
| This generator prefers to lookup the build tool at build time |
| rather than to store \fBCMAKE_MAKE_PROGRAM\fP in the CMake cache |
| ahead of time. This is because \fBxcodebuild\fP is easy to find. |
| .sp |
| For compatibility with versions of CMake prior to 3.2, if |
| a user or project explicitly adds \fBCMAKE_MAKE_PROGRAM\fP to |
| the CMake cache then CMake will use the specified value. |
| .IP \(bu 2 |
| The Visual Studio Generators set this to the full path to |
| \fBMSBuild.exe\fP (VS >= 10), \fBdevenv.com\fP (VS 7,8,9), or |
| \fBVCExpress.exe\fP (VS Express 8,9). |
| (See also variables |
| \fBCMAKE_VS_MSBUILD_COMMAND\fP and |
| \fBCMAKE_VS_DEVENV_COMMAND\fP\&. |
| .sp |
| These generators prefer to lookup the build tool at build time |
| rather than to store \fBCMAKE_MAKE_PROGRAM\fP 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 \fBdevenv.com\fP to build its \fB\&.vfproj\fP project files |
| even though \fBMSBuild.exe\fP is normally preferred to support |
| the \fBCMAKE_GENERATOR_TOOLSET\fP). |
| .sp |
| For compatibility with versions of CMake prior to 3.0, if |
| a user or project explicitly adds \fBCMAKE_MAKE_PROGRAM\fP to |
| the CMake cache then CMake will use the specified value if |
| possible. |
| .IP \(bu 2 |
| The \fBGreen Hills MULTI\fP generator sets this to the full |
| path to \fBgbuild.exe(Windows)\fP or \fBgbuild(Linux)\fP based upon |
| the toolset being used. |
| .sp |
| Once the generator has initialized a particular value for this |
| variable, changing the value has undefined behavior. |
| .UNINDENT |
| .sp |
| The \fBCMAKE_MAKE_PROGRAM\fP variable is set for use by project code. |
| The value is also used by the \fBcmake(1)\fP \fB\-\-build\fP and |
| \fBctest(1)\fP \fB\-\-build\-and\-test\fP tools to launch the native |
| build process. |
| .SS CMAKE_MATCH_COUNT |
| .sp |
| New in version 3.2. |
| |
| .sp |
| The number of matches with the last regular expression. |
| .sp |
| When a regular expression match is used, CMake fills in |
| \fBCMAKE_MATCH_<n>\fP variables with the match contents. |
| The \fBCMAKE_MATCH_COUNT\fP variable holds the number of match |
| expressions when these are filled. |
| .SS CMAKE_MATCH_<n> |
| .sp |
| New in version 3.9. |
| |
| .sp |
| Capture group \fB<n>\fP matched by the last regular expression, for groups |
| 0 through 9. Group 0 is the entire match. Groups 1 through 9 are the |
| subexpressions captured by \fB()\fP syntax. |
| .sp |
| When a regular expression match is used, CMake fills in \fBCMAKE_MATCH_<n>\fP |
| variables with the match contents. The \fBCMAKE_MATCH_COUNT\fP |
| variable holds the number of match expressions when these are filled. |
| .SS CMAKE_MINIMUM_REQUIRED_VERSION |
| .sp |
| The \fB<min>\fP version of CMake given to the most recent call to the |
| \fBcmake_minimum_required(VERSION)\fP command in the current |
| variable scope or any parent variable scope. |
| .SS CMAKE_MINOR_VERSION |
| .sp |
| Second version number component of the \fBCMAKE_VERSION\fP |
| variable. |
| .SS CMAKE_NETRC |
| .sp |
| New in version 3.11. |
| |
| .sp |
| This variable is used to initialize the \fBNETRC\fP option for the |
| \fBfile(DOWNLOAD)\fP and \fBfile(UPLOAD)\fP commands. |
| See those commands for additional information. |
| .sp |
| This variable is also used by the \fBExternalProject\fP and |
| \fBFetchContent\fP modules for internal calls to \fBfile(DOWNLOAD)\fP\&. |
| .sp |
| The local option takes precedence over this variable. |
| .SS CMAKE_NETRC_FILE |
| .sp |
| New in version 3.11. |
| |
| .sp |
| This variable is used to initialize the \fBNETRC_FILE\fP option for the |
| \fBfile(DOWNLOAD)\fP and \fBfile(UPLOAD)\fP commands. |
| See those commands for additional information. |
| .sp |
| This variable is also used by the \fBExternalProject\fP and |
| \fBFetchContent\fP modules for internal calls to \fBfile(DOWNLOAD)\fP\&. |
| .sp |
| The local option takes precedence over this variable. |
| .SS CMAKE_PARENT_LIST_FILE |
| .sp |
| Full path to the CMake file that included the current one. |
| .sp |
| While processing a CMake file loaded by \fBinclude()\fP or |
| \fBfind_package()\fP this variable contains the full path to the file |
| including it. The top of the include stack is always the \fBCMakeLists.txt\fP |
| for the current directory. See also \fBCMAKE_CURRENT_LIST_FILE\fP\&. |
| .SS CMAKE_PATCH_VERSION |
| .sp |
| Third version number component of the \fBCMAKE_VERSION\fP |
| variable. |
| .SS CMAKE_PROJECT_DESCRIPTION |
| .sp |
| New in version 3.9. |
| |
| .sp |
| The description of the top level project. |
| .sp |
| This variable holds the description of the project as specified in the top |
| level CMakeLists.txt file by a \fBproject()\fP command. In the event that |
| the top level CMakeLists.txt contains multiple \fBproject()\fP calls, |
| the most recently called one from that top level CMakeLists.txt will determine |
| the value that \fBCMAKE_PROJECT_DESCRIPTION\fP contains. For example, consider |
| the following top level CMakeLists.txt: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| cmake_minimum_required(VERSION 3.0) |
| project(First DESCRIPTION "I am First") |
| project(Second DESCRIPTION "I am Second") |
| add_subdirectory(sub) |
| project(Third DESCRIPTION "I am Third") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| And \fBsub/CMakeLists.txt\fP with the following contents: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| project(SubProj DESCRIPTION "I am SubProj") |
| message("CMAKE_PROJECT_DESCRIPTION = ${CMAKE_PROJECT_DESCRIPTION}") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The most recently seen \fBproject()\fP command from the top level |
| CMakeLists.txt would be \fBproject(Second ...)\fP, so this will print: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| CMAKE_PROJECT_DESCRIPTION = I am Second |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| To obtain the description from the most recent call to \fBproject()\fP in |
| the current directory scope or above, see the \fBPROJECT_DESCRIPTION\fP |
| variable. |
| .SS CMAKE_PROJECT_HOMEPAGE_URL |
| .sp |
| New in version 3.12. |
| |
| .sp |
| The homepage URL of the top level project. |
| .sp |
| This variable holds the homepage URL of the project as specified in the top |
| level CMakeLists.txt file by a \fBproject()\fP command. In the event that |
| the top level CMakeLists.txt contains multiple \fBproject()\fP calls, |
| the most recently called one from that top level CMakeLists.txt will determine |
| the value that \fBCMAKE_PROJECT_HOMEPAGE_URL\fP contains. For example, consider |
| the following top level CMakeLists.txt: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| cmake_minimum_required(VERSION 3.0) |
| project(First HOMEPAGE_URL "http://first.example.com") |
| project(Second HOMEPAGE_URL "http://second.example.com") |
| add_subdirectory(sub) |
| project(Third HOMEPAGE_URL "http://third.example.com") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| And \fBsub/CMakeLists.txt\fP with the following contents: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| project(SubProj HOMEPAGE_URL "http://subproj.example.com") |
| message("CMAKE_PROJECT_HOMEPAGE_URL = ${CMAKE_PROJECT_HOMEPAGE_URL}") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The most recently seen \fBproject()\fP command from the top level |
| CMakeLists.txt would be \fBproject(Second ...)\fP, so this will print: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| CMAKE_PROJECT_HOMEPAGE_URL = http://second.example.com |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| To obtain the homepage URL from the most recent call to \fBproject()\fP in |
| the current directory scope or above, see the \fBPROJECT_HOMEPAGE_URL\fP |
| variable. |
| .SS CMAKE_PROJECT_NAME |
| .sp |
| The name of the top level project. |
| .sp |
| This variable holds the name of the project as specified in the top |
| level CMakeLists.txt file by a \fBproject()\fP command. In the event that |
| the top level CMakeLists.txt contains multiple \fBproject()\fP calls, |
| the most recently called one from that top level CMakeLists.txt will determine |
| the name that \fBCMAKE_PROJECT_NAME\fP contains. For example, consider |
| the following top level CMakeLists.txt: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| cmake_minimum_required(VERSION 3.0) |
| project(First) |
| project(Second) |
| add_subdirectory(sub) |
| project(Third) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| And \fBsub/CMakeLists.txt\fP with the following contents: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| project(SubProj) |
| message("CMAKE_PROJECT_NAME = ${CMAKE_PROJECT_NAME}") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The most recently seen \fBproject()\fP command from the top level |
| CMakeLists.txt would be \fBproject(Second)\fP, so this will print: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| CMAKE_PROJECT_NAME = Second |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| To obtain the name from the most recent call to \fBproject()\fP in |
| the current directory scope or above, see the \fBPROJECT_NAME\fP |
| variable. |
| .SS CMAKE_PROJECT_VERSION |
| .sp |
| New in version 3.12. |
| |
| .sp |
| The version of the top level project. |
| .sp |
| This variable holds the version of the project as specified in the top |
| level CMakeLists.txt file by a \fBproject()\fP command. In the event that |
| the top level CMakeLists.txt contains multiple \fBproject()\fP calls, |
| the most recently called one from that top level CMakeLists.txt will determine |
| the value that \fBCMAKE_PROJECT_VERSION\fP contains. For example, consider |
| the following top level CMakeLists.txt: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| cmake_minimum_required(VERSION 3.0) |
| project(First VERSION 1.2.3) |
| project(Second VERSION 3.4.5) |
| add_subdirectory(sub) |
| project(Third VERSION 6.7.8) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| And \fBsub/CMakeLists.txt\fP with the following contents: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| project(SubProj VERSION 1) |
| message("CMAKE_PROJECT_VERSION = ${CMAKE_PROJECT_VERSION}") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The most recently seen \fBproject()\fP command from the top level |
| CMakeLists.txt would be \fBproject(Second ...)\fP, so this will print: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| CMAKE_PROJECT_VERSION = 3.4.5 |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| To obtain the version from the most recent call to \fBproject()\fP in |
| the current directory scope or above, see the \fBPROJECT_VERSION\fP |
| variable. |
| .SS CMAKE_PROJECT_VERSION_MAJOR |
| .sp |
| New in version 3.12. |
| |
| .sp |
| The major version of the top level project. |
| .sp |
| This variable holds the major version of the project as specified in the top |
| level CMakeLists.txt file by a \fBproject()\fP command. Please see |
| \fBCMAKE_PROJECT_VERSION\fP documentation for the behavior when |
| multiple \fBproject()\fP commands are used in the sources. |
| .SS CMAKE_PROJECT_VERSION_MINOR |
| .sp |
| New in version 3.12. |
| |
| .sp |
| The minor version of the top level project. |
| .sp |
| This variable holds the minor version of the project as specified in the top |
| level CMakeLists.txt file by a \fBproject()\fP command. Please see |
| \fBCMAKE_PROJECT_VERSION\fP documentation for the behavior when |
| multiple \fBproject()\fP commands are used in the sources. |
| .SS CMAKE_PROJECT_VERSION_PATCH |
| .sp |
| New in version 3.12. |
| |
| .sp |
| The patch version of the top level project. |
| .sp |
| This variable holds the patch version of the project as specified in the top |
| level CMakeLists.txt file by a \fBproject()\fP command. Please see |
| \fBCMAKE_PROJECT_VERSION\fP documentation for the behavior when |
| multiple \fBproject()\fP commands are used in the sources. |
| .SS CMAKE_PROJECT_VERSION_TWEAK |
| .sp |
| New in version 3.12. |
| |
| .sp |
| The tweak version of the top level project. |
| .sp |
| This variable holds the tweak version of the project as specified in the top |
| level CMakeLists.txt file by a \fBproject()\fP command. Please see |
| \fBCMAKE_PROJECT_VERSION\fP documentation for the behavior when |
| multiple \fBproject()\fP commands are used in the sources. |
| .SS CMAKE_RANLIB |
| .sp |
| Name of randomizing tool for static libraries. |
| .sp |
| This specifies name of the program that randomizes libraries on UNIX, |
| not used on Windows, but may be present. |
| .SS CMAKE_ROOT |
| .sp |
| Install directory for running cmake. |
| .sp |
| This is the install root for the running CMake and the \fBModules\fP |
| directory can be found here. This is commonly used in this format: |
| \fB${CMAKE_ROOT}/Modules\fP |
| .SS CMAKE_RULE_MESSAGES |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Specify whether to report a message for each make rule. |
| .sp |
| If set in the cache it is used to initialize the value of the \fBRULE_MESSAGES\fP property. |
| Users may disable the option in their local build tree to disable granular messages |
| and report only as each target completes in Makefile builds. |
| .SS CMAKE_SCRIPT_MODE_FILE |
| .sp |
| Full path to the \fBcmake(1)\fP \fB\-P\fP script file currently being |
| processed. |
| .sp |
| When run in \fBcmake(1)\fP \fB\-P\fP script mode, CMake sets this variable to |
| the full path of the script file. When run to configure a \fBCMakeLists.txt\fP |
| file, this variable is not set. |
| .SS CMAKE_SHARED_LIBRARY_PREFIX |
| .sp |
| The prefix for shared libraries that you link to. |
| .sp |
| The prefix to use for the name of a shared library, \fBlib\fP on UNIX. |
| .sp |
| \fBCMAKE_SHARED_LIBRARY_PREFIX_<LANG>\fP overrides this for language \fB<LANG>\fP\&. |
| .SS CMAKE_SHARED_LIBRARY_SUFFIX |
| .sp |
| The suffix for shared libraries that you link to. |
| .sp |
| The suffix to use for the end of a shared library filename, \fB\&.dll\fP on |
| Windows. |
| .sp |
| \fBCMAKE_SHARED_LIBRARY_SUFFIX_<LANG>\fP overrides this for language \fB<LANG>\fP\&. |
| .SS CMAKE_SHARED_MODULE_PREFIX |
| .sp |
| The prefix for loadable modules that you link to. |
| .sp |
| The prefix to use for the name of a loadable module on this platform. |
| .sp |
| \fBCMAKE_SHARED_MODULE_PREFIX_<LANG>\fP overrides this for language \fB<LANG>\fP\&. |
| .SS CMAKE_SHARED_MODULE_SUFFIX |
| .sp |
| The suffix for shared libraries that you link to. |
| .sp |
| The suffix to use for the end of a loadable module filename on this |
| platform |
| .sp |
| \fBCMAKE_SHARED_MODULE_SUFFIX_<LANG>\fP overrides this for language \fB<LANG>\fP\&. |
| .SS CMAKE_SIZEOF_VOID_P |
| .sp |
| Size of a \fBvoid\fP pointer. |
| .sp |
| 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. |
| .SS CMAKE_SKIP_INSTALL_RULES |
| .sp |
| Whether to disable generation of installation rules. |
| .sp |
| If \fBTRUE\fP, CMake will neither generate installation rules nor |
| will it generate \fBcmake_install.cmake\fP files. This variable is \fBFALSE\fP by |
| default. |
| .SS CMAKE_SKIP_RPATH |
| .sp |
| If true, do not add run time path information. |
| .sp |
| If this is set to \fBTRUE\fP, 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 |
| \fBCMAKE_SKIP_INSTALL_RPATH\fP instead. |
| .SS CMAKE_SOURCE_DIR |
| .sp |
| The path to the top level of the source tree. |
| .sp |
| 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 |
| \fBCMAKE_BINARY_DIR\fP\&. |
| .sp |
| When run in \fB\-P\fP script mode, CMake sets the variables |
| \fBCMAKE_BINARY_DIR\fP, \fI\%CMAKE_SOURCE_DIR\fP, |
| \fBCMAKE_CURRENT_BINARY_DIR\fP and |
| \fBCMAKE_CURRENT_SOURCE_DIR\fP to the current working directory. |
| .SS CMAKE_STATIC_LIBRARY_PREFIX |
| .sp |
| The prefix for static libraries that you link to. |
| .sp |
| The prefix to use for the name of a static library, \fBlib\fP on UNIX. |
| .sp |
| \fBCMAKE_STATIC_LIBRARY_PREFIX_<LANG>\fP overrides this for language \fB<LANG>\fP\&. |
| .SS CMAKE_STATIC_LIBRARY_SUFFIX |
| .sp |
| The suffix for static libraries that you link to. |
| .sp |
| The suffix to use for the end of a static library filename, \fB\&.lib\fP on |
| Windows. |
| .sp |
| \fBCMAKE_STATIC_LIBRARY_SUFFIX_<LANG>\fP overrides this for language \fB<LANG>\fP\&. |
| .SS CMAKE_Swift_MODULE_DIRECTORY |
| .sp |
| New in version 3.15. |
| |
| .sp |
| Swift module output directory. |
| .sp |
| This variable is used to initialize the \fBSwift_MODULE_DIRECTORY\fP |
| property on all the targets. See the target property for additional |
| information. |
| .SS CMAKE_Swift_NUM_THREADS |
| .sp |
| New in version 3.15.1. |
| |
| .sp |
| Number of threads for parallel compilation for Swift targets. |
| .sp |
| This variable controls the number of parallel jobs that the swift driver creates |
| for building targets. If not specified, it will default to the number of |
| logical CPUs on the host. |
| .SS CMAKE_TOOLCHAIN_FILE |
| .sp |
| Path to toolchain file supplied to \fBcmake(1)\fP\&. |
| .sp |
| 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. |
| .sp |
| Relative paths are allowed and are interpreted first as relative to the |
| build directory, and if not found, relative to the source directory. |
| .sp |
| This is initialized by the \fBCMAKE_TOOLCHAIN_FILE\fP environment |
| variable if it is set when a new build tree is first created. |
| .SS CMAKE_TWEAK_VERSION |
| .sp |
| Defined to \fB0\fP for compatibility with code written for older |
| CMake versions that may have defined higher values. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| In CMake versions 2.8.2 through 2.8.12, this variable holds |
| the fourth version number component of the |
| \fBCMAKE_VERSION\fP variable. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_VERBOSE_MAKEFILE |
| .sp |
| Enable verbose output from Makefile builds. |
| .sp |
| This variable is a cache entry initialized (to \fBFALSE\fP) by |
| the \fBproject()\fP 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. |
| .SS CMAKE_VERSION |
| .sp |
| The CMake version string as three non\-negative integer components |
| separated by \fB\&.\fP and possibly followed by \fB\-\fP and other information. |
| The first two components represent the feature level and the third |
| component represents either a bug\-fix level or development date. |
| .sp |
| Release versions and release candidate versions of CMake use the format: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| <major>.<minor>.<patch>[\-rc<n>] |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| where the \fB<patch>\fP component is less than \fB20000000\fP\&. Development |
| versions of CMake use the format: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| <major>.<minor>.<date>[\-<id>] |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| where the \fB<date>\fP component is of format \fBCCYYMMDD\fP and \fB<id>\fP |
| may contain arbitrary text. This represents development as of a |
| particular date following the \fB<major>.<minor>\fP feature release. |
| .sp |
| Individual component values are also available in variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBCMAKE_MAJOR_VERSION\fP |
| .IP \(bu 2 |
| \fBCMAKE_MINOR_VERSION\fP |
| .IP \(bu 2 |
| \fBCMAKE_PATCH_VERSION\fP |
| .IP \(bu 2 |
| \fBCMAKE_TWEAK_VERSION\fP |
| .UNINDENT |
| .sp |
| Use the \fBif()\fP command \fBVERSION_LESS\fP, \fBVERSION_GREATER\fP, |
| \fBVERSION_EQUAL\fP, \fBVERSION_LESS_EQUAL\fP, or \fBVERSION_GREATER_EQUAL\fP |
| operators to compare version string values against \fBCMAKE_VERSION\fP 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. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| 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. \fB<major>.<minor>.<patch>[.<tweak>][\-rc<n>]\fP\&. |
| Development versions represented the development date in the fourth |
| component, i.e. \fB<major>.<minor>.<patch>.<date>[\-<id>]\fP\&. |
| .sp |
| 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. |
| \fB<major>.<even\-minor>.<patch>[\-rc<n>]\fP\&. Development versions |
| used an odd\-valued second component with the development date as |
| the third component, i.e. \fB<major>.<odd\-minor>.<date>\fP\&. |
| .sp |
| The \fBCMAKE_VERSION\fP variable is defined by CMake 2.6.3 and higher. |
| Earlier versions defined only the individual component variables. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_VS_DEVENV_COMMAND |
| .sp |
| The generators for \fBVisual Studio 9 2008\fP and above set this |
| variable to the \fBdevenv.com\fP 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. |
| .sp |
| This variable is not defined by other generators even if \fBdevenv.com\fP |
| is installed on the computer. |
| .sp |
| The \fBCMAKE_VS_MSBUILD_COMMAND\fP is also provided for |
| \fBVisual Studio 10 2010\fP and above. |
| See also the \fBCMAKE_MAKE_PROGRAM\fP variable. |
| .SS CMAKE_VS_MSBUILD_COMMAND |
| .sp |
| The generators for \fBVisual Studio 10 2010\fP and above set this |
| variable to the \fBMSBuild.exe\fP command installed with the corresponding |
| Visual Studio version. |
| .sp |
| This variable is not defined by other generators even if \fBMSBuild.exe\fP |
| is installed on the computer. |
| .sp |
| The \fBCMAKE_VS_DEVENV_COMMAND\fP is also provided for the |
| non\-Express editions of Visual Studio. |
| See also the \fBCMAKE_MAKE_PROGRAM\fP variable. |
| .SS CMAKE_VS_NsightTegra_VERSION |
| .sp |
| New in version 3.1. |
| |
| .sp |
| When using a Visual Studio generator with the |
| \fBCMAKE_SYSTEM_NAME\fP variable set to \fBAndroid\fP, |
| this variable contains the version number of the |
| installed NVIDIA Nsight Tegra Visual Studio Edition. |
| .SS CMAKE_VS_NUGET_PACKAGE_RESTORE |
| .sp |
| New in version 3.23. |
| |
| .sp |
| When using a Visual Studio generator, this cache variable controls |
| if msbuild should automatically attempt to restore NuGet packages |
| prior to a build. NuGet packages can be defined using the |
| \fBVS_PACKAGE_REFERENCES\fP property on a target. If no |
| package references are defined, this setting will do nothing. |
| .sp |
| The command line option \fB\-\-resolve\-package\-references\fP can be used |
| alternatively to control the resolve behavior globally. This option |
| will take precedence over the cache variable. |
| .sp |
| Targets that use the \fBDOTNET_SDK\fP are required to run a |
| restore before building. Disabling this option may cause the build |
| to fail in such projects. |
| .sp |
| This setting is stored as a cache entry. Default value is \fBON\fP\&. |
| .sp |
| See also the \fBVS_PACKAGE_REFERENCES\fP property. |
| .SS CMAKE_VS_PLATFORM_NAME |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Visual Studio target platform name used by the current generator. |
| .sp |
| VS 8 and above allow project files to specify a target platform. |
| CMake provides the name of the chosen platform in this variable. |
| See the \fBCMAKE_GENERATOR_PLATFORM\fP variable for details. |
| .sp |
| See also the \fBCMAKE_VS_PLATFORM_NAME_DEFAULT\fP variable. |
| .SS CMAKE_VS_PLATFORM_NAME_DEFAULT |
| .sp |
| New in version 3.14.3. |
| |
| .sp |
| Default for the Visual Studio target platform name for the current generator |
| without considering the value of the \fBCMAKE_GENERATOR_PLATFORM\fP |
| variable. For Visual Studio Generators for VS 2017 and below this is |
| always \fBWin32\fP\&. For VS 2019 and above this is based on the host platform. |
| .sp |
| See also the \fBCMAKE_VS_PLATFORM_NAME\fP variable. |
| .SS CMAKE_VS_PLATFORM_TOOLSET |
| .sp |
| Visual Studio Platform Toolset name. |
| .sp |
| VS 10 and above use MSBuild under the hood and support multiple |
| compiler toolchains. CMake may specify a toolset explicitly, such as |
| \fBv110\fP for VS 11 or \fBWindows7.1SDK\fP for 64\-bit support in VS 10 |
| Express. CMake provides the name of the chosen toolset in this |
| variable. |
| .sp |
| See the \fBCMAKE_GENERATOR_TOOLSET\fP variable for details. |
| .SS CMAKE_VS_PLATFORM_TOOLSET_CUDA |
| .sp |
| New in version 3.9. |
| |
| .sp |
| NVIDIA CUDA Toolkit version whose Visual Studio toolset to use. |
| .sp |
| The Visual Studio Generators for VS 2010 and above support using |
| a CUDA toolset provided by a CUDA Toolkit. The toolset version number |
| may be specified by a field in \fBCMAKE_GENERATOR_TOOLSET\fP of |
| the form \fBcuda=8.0\fP\&. Or it is automatically detected if a path to |
| a standalone CUDA directory is specified in the form \fBcuda=C:\epath\eto\ecuda\fP\&. |
| If none is specified CMake will choose a default version. |
| CMake provides the selected CUDA toolset version in this variable. |
| The value may be empty if no CUDA Toolkit with Visual Studio integration |
| is installed. |
| .SS CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Path to standalone NVIDIA CUDA Toolkit (eg. extracted from installer). |
| .sp |
| The Visual Studio Generators for VS 2010 and above support using |
| a standalone (non\-installed) NVIDIA CUDA toolkit. The path |
| may be specified by a field in \fBCMAKE_GENERATOR_TOOLSET\fP of |
| the form \fBcuda=C:\epath\eto\ecuda\fP\&. The given directory must at least |
| contain the nvcc compiler in path \fB\&.\ebin\fP and must provide Visual Studio |
| integration files in path \fB\&.\eextras\evisual_studio_integration\e |
| MSBuildExtensions\e\fP\&. One can create a standalone CUDA toolkit directory by |
| either opening a installer with 7zip or copying the files that are extracted |
| by the running installer. The value may be empty if no path to a standalone |
| CUDA Toolkit was specified. |
| .SS CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE |
| .sp |
| New in version 3.8. |
| |
| .sp |
| Visual Studio preferred tool architecture. |
| .sp |
| The Visual Studio Generators for VS 2013 and above support using |
| either the 32\-bit or 64\-bit host toolchains by specifying a \fBhost=x86\fP |
| or \fBhost=x64\fP value in the \fBCMAKE_GENERATOR_TOOLSET\fP option. |
| CMake provides the selected toolchain architecture preference in this |
| variable (\fBx86\fP, \fBx64\fP, or empty). |
| .SS CMAKE_VS_PLATFORM_TOOLSET_VERSION |
| .sp |
| New in version 3.12. |
| |
| .sp |
| Visual Studio Platform Toolset version. |
| .sp |
| The Visual Studio Generators for VS 2017 and above allow to |
| select minor versions of the same toolset. The toolset version number |
| may be specified by a field in \fBCMAKE_GENERATOR_TOOLSET\fP of |
| the form \fBversion=14.11\fP\&. If none is specified CMake will choose a default |
| toolset. The value may be empty if no minor version was selected and the |
| default is used. |
| .sp |
| If the value is not empty, it is the version number that MSBuild uses in |
| its \fBMicrosoft.VCToolsVersion.*.props\fP file names. |
| .sp |
| New in version 3.19.7: VS 16.9\(aqs toolset may also be specified as \fB14.28.16.9\fP because |
| VS 16.10 uses the file name \fBMicrosoft.VCToolsVersion.14.28.16.9.props\fP\&. |
| |
| .SS Three\-Component MSVC Toolset Versions |
| .sp |
| New in version 3.19.7. |
| |
| .sp |
| The \fBversion=\fP field may be given a three\-component toolset version |
| such as \fB14.28.29910\fP, and CMake will convert it to the name used by |
| MSBuild \fBMicrosoft.VCToolsVersion.*.props\fP files. This is useful |
| to distinguish between VS 16.8\(aqs \fB14.28.29333\fP toolset and VS 16.9\(aqs |
| \fB14.28.29910\fP toolset. It also matches \fBvcvarsall\fP\(aqs \fB\-vcvars_ver=\fP |
| behavior. |
| .SS CMAKE_VS_TARGET_FRAMEWORK_VERSION |
| .sp |
| New in version 3.22. |
| |
| .sp |
| Visual Studio target framework version. |
| .sp |
| In some cases, the Visual Studio Generators may use an explicit value |
| for the MSBuild \fBTargetFrameworkVersion\fP setting in \fB\&.csproj\fP files. |
| CMake provides the chosen value in this variable. |
| .sp |
| See the \fBCMAKE_DOTNET_TARGET_FRAMEWORK_VERSION\fP variable |
| and \fBDOTNET_TARGET_FRAMEWORK_VERSION\fP target property to |
| specify custom \fBTargetFrameworkVersion\fP values for project targets. |
| .sp |
| See also \fBCMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER\fP and |
| \fBCMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION\fP\&. |
| .SS CMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER |
| .sp |
| New in version 3.22. |
| |
| .sp |
| Visual Studio target framework identifier. |
| .sp |
| In some cases, the Visual Studio Generators may use an explicit value |
| for the MSBuild \fBTargetFrameworkIdentifier\fP setting in \fB\&.csproj\fP files. |
| CMake provides the chosen value in this variable. |
| .sp |
| See also \fBCMAKE_VS_TARGET_FRAMEWORK_VERSION\fP and |
| \fBCMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION\fP\&. |
| .SS CMAKE_VS_TARGET_FRAMEWORK_TARGETS_VERSION |
| .sp |
| New in version 3.22. |
| |
| .sp |
| Visual Studio target framework targets version. |
| .sp |
| In some cases, the Visual Studio Generators may use an explicit value |
| for the MSBuild \fBTargetFrameworkTargetsVersion\fP setting in \fB\&.csproj\fP files. |
| CMake provides the chosen value in this variable. |
| .sp |
| See also \fBCMAKE_VS_TARGET_FRAMEWORK_VERSION\fP and |
| \fBCMAKE_VS_TARGET_FRAMEWORK_IDENTIFIER\fP\&. |
| .SS CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Visual Studio Windows Target Platform Version. |
| .sp |
| When targeting Windows 10 and above Visual Studio 2015 and above support |
| specification of a target Windows version to select a corresponding SDK. |
| The \fBCMAKE_SYSTEM_VERSION\fP 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 \fBCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION\fP\&. If no Windows 10 SDK |
| is available this value will be empty. |
| .sp |
| One may set a \fBCMAKE_WINDOWS_KITS_10_DIR\fP \fIenvironment variable\fP |
| to an absolute path to tell CMake to look for Windows 10 SDKs in |
| a custom location. The specified directory is expected to contain |
| \fBInclude/10.0.*\fP directories. |
| .sp |
| See also \fBCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM\fP\&. |
| .SS CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM |
| .sp |
| New in version 3.19. |
| |
| .sp |
| Override the Windows 10 SDK Maximum Version for VS 2015 and beyond. |
| .sp |
| The \fI\%CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM\fP variable may |
| be set to a false value (e.g. \fBOFF\fP, \fBFALSE\fP, or \fB0\fP) or the SDK version |
| to use as the maximum (e.g. \fB10.0.14393.0\fP). If unset, the default depends |
| on which version of Visual Studio is targeted by the current generator. |
| .sp |
| This can be used in conjunction with \fBCMAKE_SYSTEM_VERSION\fP, which |
| CMake uses to select \fBCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION\fP\&. |
| .SS CMAKE_XCODE_BUILD_SYSTEM |
| .sp |
| New in version 3.19. |
| |
| .sp |
| Xcode build system selection. |
| .sp |
| The \fBXcode\fP generator defines this variable to indicate which |
| variant of the Xcode build system will be used. The value is the |
| version of Xcode in which the corresponding build system first became |
| mature enough for use by CMake. The possible values are: |
| .INDENT 0.0 |
| .TP |
| .B \fB1\fP |
| The original Xcode build system. |
| This is the default when using Xcode 11.x or below. |
| .TP |
| .B \fB12\fP |
| The Xcode "new build system" introduced by Xcode 10. |
| It became mature enough for use by CMake in Xcode 12. |
| This is the default when using Xcode 12.x or above. |
| .UNINDENT |
| .sp |
| The \fBCMAKE_XCODE_BUILD_SYSTEM\fP variable is informational and should not |
| be modified by project code. See the Xcode Build System Selection |
| documentation section to select the Xcode build system. |
| .SS CMAKE_XCODE_PLATFORM_TOOLSET |
| .sp |
| Xcode compiler selection. |
| .sp |
| \fBXcode\fP 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 \fBcmake(1)\fP |
| \fB\-T\fP option). |
| .SS <PROJECT\-NAME>_BINARY_DIR |
| .sp |
| Top level binary directory for the named project. |
| .sp |
| A variable is created with the name used in the \fBproject()\fP command, |
| and is the binary directory for the project. This can be useful when |
| \fBadd_subdirectory()\fP is used to connect several projects. |
| .SS <PROJECT\-NAME>_DESCRIPTION |
| .sp |
| New in version 3.12. |
| |
| .sp |
| Value given to the \fBDESCRIPTION\fP option of the most recent call to the |
| \fBproject()\fP command with project name \fB<PROJECT\-NAME>\fP, if any. |
| .SS <PROJECT\-NAME>_HOMEPAGE_URL |
| .sp |
| New in version 3.12. |
| |
| .sp |
| Value given to the \fBHOMEPAGE_URL\fP option of the most recent call to the |
| \fBproject()\fP command with project name \fB<PROJECT\-NAME>\fP, if any. |
| .SS <PROJECT\-NAME>_IS_TOP_LEVEL |
| .sp |
| New in version 3.21. |
| |
| .sp |
| A boolean variable indicating whether the named project was called in a top |
| level \fBCMakeLists.txt\fP file. |
| .sp |
| To obtain the value from the most recent call to \fBproject()\fP in |
| the current directory scope or above, see the |
| \fBPROJECT_IS_TOP_LEVEL\fP variable. |
| .sp |
| The variable value will be true in: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| the top\-level directory of the project |
| .IP \(bu 2 |
| the top\-level directory of an external project added by \fBExternalProject\fP |
| .UNINDENT |
| .sp |
| The variable value will be false in: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| a directory added by \fBadd_subdirectory()\fP |
| .IP \(bu 2 |
| a directory added by \fBFetchContent\fP |
| .UNINDENT |
| .SS <PROJECT\-NAME>_SOURCE_DIR |
| .sp |
| Top level source directory for the named project. |
| .sp |
| A variable is created with the name used in the \fBproject()\fP command, |
| and is the source directory for the project. This can be useful when |
| \fBadd_subdirectory()\fP is used to connect several projects. |
| .SS <PROJECT\-NAME>_VERSION |
| .sp |
| Value given to the \fBVERSION\fP option of the most recent call to the |
| \fBproject()\fP command with project name \fB<PROJECT\-NAME>\fP, if any. |
| .sp |
| See also the component\-wise version variables |
| \fB<PROJECT\-NAME>_VERSION_MAJOR\fP, |
| \fB<PROJECT\-NAME>_VERSION_MINOR\fP, |
| \fB<PROJECT\-NAME>_VERSION_PATCH\fP, and |
| \fB<PROJECT\-NAME>_VERSION_TWEAK\fP\&. |
| .SS <PROJECT\-NAME>_VERSION_MAJOR |
| .sp |
| First version number component of the \fB<PROJECT\-NAME>_VERSION\fP |
| variable as set by the \fBproject()\fP command. |
| .SS <PROJECT\-NAME>_VERSION_MINOR |
| .sp |
| Second version number component of the \fB<PROJECT\-NAME>_VERSION\fP |
| variable as set by the \fBproject()\fP command. |
| .SS <PROJECT\-NAME>_VERSION_PATCH |
| .sp |
| Third version number component of the \fB<PROJECT\-NAME>_VERSION\fP |
| variable as set by the \fBproject()\fP command. |
| .SS <PROJECT\-NAME>_VERSION_TWEAK |
| .sp |
| Fourth version number component of the \fB<PROJECT\-NAME>_VERSION\fP |
| variable as set by the \fBproject()\fP command. |
| .SS PROJECT_BINARY_DIR |
| .sp |
| Full path to build directory for project. |
| .sp |
| This is the binary directory of the most recent \fBproject()\fP command. |
| .SS PROJECT_DESCRIPTION |
| .sp |
| New in version 3.9. |
| |
| .sp |
| Short project description given to the project command. |
| .sp |
| This is the description given to the most recently called \fBproject()\fP |
| command in the current directory scope or above. To obtain the description |
| of the top level project, see the \fBCMAKE_PROJECT_DESCRIPTION\fP |
| variable. |
| .SS PROJECT_HOMEPAGE_URL |
| .sp |
| New in version 3.12. |
| |
| .sp |
| The homepage URL of the project. |
| .sp |
| This is the homepage URL given to the most recently called \fBproject()\fP |
| command in the current directory scope or above. To obtain the homepage URL |
| of the top level project, see the \fBCMAKE_PROJECT_HOMEPAGE_URL\fP |
| variable. |
| .SS PROJECT_IS_TOP_LEVEL |
| .sp |
| New in version 3.21. |
| |
| .sp |
| A boolean variable indicating whether the most recently called |
| \fBproject()\fP command in the current scope or above was in the top |
| level \fBCMakeLists.txt\fP file. |
| .sp |
| Some modules should only be included as part of the top level |
| \fBCMakeLists.txt\fP file to not cause unintended side effects in the build |
| tree, and this variable can be used to conditionally execute such code. For |
| example, consider the \fBCTest\fP module, which creates targets and |
| options: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| project(MyProject) |
| \&... |
| if(PROJECT_IS_TOP_LEVEL) |
| include(CTest) |
| endif() |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The variable value will be true in: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| the top\-level directory of the project |
| .IP \(bu 2 |
| the top\-level directory of an external project added by \fBExternalProject\fP |
| .UNINDENT |
| .sp |
| The variable value will be false in: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| a directory added by \fBadd_subdirectory()\fP |
| .IP \(bu 2 |
| a directory added by \fBFetchContent\fP |
| .UNINDENT |
| .SS PROJECT_NAME |
| .sp |
| Name of the project given to the project command. |
| .sp |
| This is the name given to the most recently called \fBproject()\fP |
| command in the current directory scope or above. To obtain the name of |
| the top level project, see the \fBCMAKE_PROJECT_NAME\fP variable. |
| .SS PROJECT_SOURCE_DIR |
| .sp |
| This is the source directory of the last call to the |
| \fBproject()\fP command made in the current directory scope or one |
| of its parents. Note, it is not affected by calls to |
| \fBproject()\fP made within a child directory scope (i.e. from |
| within a call to \fBadd_subdirectory()\fP from the current scope). |
| .SS PROJECT_VERSION |
| .sp |
| Value given to the \fBVERSION\fP option of the most recent call to the |
| \fBproject()\fP command, if any. |
| .sp |
| See also the component\-wise version variables |
| \fBPROJECT_VERSION_MAJOR\fP, |
| \fBPROJECT_VERSION_MINOR\fP, |
| \fBPROJECT_VERSION_PATCH\fP, and |
| \fBPROJECT_VERSION_TWEAK\fP\&. |
| .SS PROJECT_VERSION_MAJOR |
| .sp |
| First version number component of the \fBPROJECT_VERSION\fP |
| variable as set by the \fBproject()\fP command. |
| .SS PROJECT_VERSION_MINOR |
| .sp |
| Second version number component of the \fBPROJECT_VERSION\fP |
| variable as set by the \fBproject()\fP command. |
| .SS PROJECT_VERSION_PATCH |
| .sp |
| Third version number component of the \fBPROJECT_VERSION\fP |
| variable as set by the \fBproject()\fP command. |
| .SS PROJECT_VERSION_TWEAK |
| .sp |
| Fourth version number component of the \fBPROJECT_VERSION\fP |
| variable as set by the \fBproject()\fP command. |
| .SH VARIABLES THAT CHANGE BEHAVIOR |
| .SS BUILD_SHARED_LIBS |
| .sp |
| Global flag to cause \fBadd_library()\fP to create shared libraries if on. |
| .sp |
| 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 \fBoption()\fP so that each user |
| of a project can decide if they want to build the project using shared or |
| static libraries. |
| .SS CMAKE_ABSOLUTE_DESTINATION_FILES |
| .sp |
| List of files which have been installed using an \fBABSOLUTE DESTINATION\fP path. |
| .sp |
| This variable is defined by CMake\-generated \fBcmake_install.cmake\fP |
| 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). |
| .SS CMAKE_APPBUNDLE_PATH |
| .sp |
| Semicolon\-separated list of directories specifying a search path |
| for macOS application bundles used by the \fBfind_program()\fP, and |
| \fBfind_package()\fP commands. |
| .SS CMAKE_AUTOMOC_RELAXED_MODE |
| .sp |
| Deprecated since version 3.15. |
| |
| .sp |
| Switch between strict and relaxed automoc mode. |
| .sp |
| By default, \fBAUTOMOC\fP behaves exactly as described in the |
| documentation of the \fBAUTOMOC\fP target property. When set to |
| \fBTRUE\fP, it accepts more input and tries to find the correct input file for |
| \fBmoc\fP even if it differs from the documented behavior. In this mode it |
| e.g. also checks whether a header file is intended to be processed by moc |
| when a \fB"foo.moc"\fP file has been included. |
| .sp |
| Relaxed mode has to be enabled for KDE4 compatibility. |
| .SS CMAKE_BACKWARDS_COMPATIBILITY |
| .sp |
| Deprecated. See CMake Policy \fBCMP0001\fP documentation. |
| .SS CMAKE_BUILD_TYPE |
| .sp |
| Specifies the build type on single\-configuration generators (e.g. |
| Makefile Generators or \fBNinja\fP). Typical values include |
| \fBDebug\fP, \fBRelease\fP, \fBRelWithDebInfo\fP and \fBMinSizeRel\fP, but custom |
| build types can also be defined. |
| .sp |
| This variable is initialized by the first \fBproject()\fP or |
| \fBenable_language()\fP command called in a project when a new build |
| tree is first created. If the \fBCMAKE_BUILD_TYPE\fP environment |
| variable is set, its value is used. Otherwise, a toolchain\-specific |
| default is chosen when a language is enabled. The default value is often |
| an empty string, but this is usually not desirable and one of the other |
| standard build types is usually more appropriate. |
| .sp |
| Depending on the situation, the value of this variable may be treated |
| case\-sensitively or case\-insensitively. See Build Configurations |
| for discussion of this and other related topics. |
| .sp |
| For multi\-config generators, see \fBCMAKE_CONFIGURATION_TYPES\fP\&. |
| .SS CMAKE_CLANG_VFS_OVERLAY |
| .sp |
| New in version 3.19. |
| |
| .sp |
| When cross compiling for windows with clang\-cl, this variable can be an |
| absolute path pointing to a clang virtual file system yaml file, which |
| will enable clang\-cl to resolve windows header names on a case sensitive |
| file system. |
| .SS CMAKE_CODEBLOCKS_COMPILER_ID |
| .sp |
| New in version 3.11. |
| |
| .sp |
| Change the compiler id in the generated CodeBlocks project files. |
| .sp |
| CodeBlocks uses its own compiler id string which differs from |
| \fBCMAKE_<LANG>_COMPILER_ID\fP\&. If this variable is left empty, |
| CMake tries to recognize the CodeBlocks compiler id automatically. |
| Otherwise the specified string is used in the CodeBlocks project file. |
| See the CodeBlocks documentation for valid compiler id strings. |
| .sp |
| Other IDEs like QtCreator that also use the CodeBlocks generator may ignore |
| this setting. |
| .SS CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES |
| .sp |
| New in version 3.10. |
| |
| .sp |
| Change the way the CodeBlocks generator creates project files. |
| .sp |
| If this variable evaluates to \fBON\fP the generator excludes from |
| the project file any files that are located outside the project root. |
| .SS CMAKE_CODELITE_USE_TARGETS |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Change the way the CodeLite generator creates projectfiles. |
| .sp |
| If this variable evaluates to \fBON\fP at the end of the top\-level |
| \fBCMakeLists.txt\fP file, the generator creates projectfiles based on targets |
| rather than projects. |
| .SS CMAKE_COLOR_MAKEFILE |
| .sp |
| Enables color output when using the Makefile Generators\&. |
| .sp |
| When enabled, the generated Makefiles will produce colored output. |
| Default is \fBON\fP\&. |
| .SS CMAKE_CONFIGURATION_TYPES |
| .sp |
| Specifies the available build types (configurations) on multi\-config |
| generators (e.g. Visual Studio, |
| \fBXcode\fP, or \fBNinja Multi\-Config\fP). Typical values |
| include \fBDebug\fP, \fBRelease\fP, \fBRelWithDebInfo\fP and \fBMinSizeRel\fP, |
| but custom build types can also be defined. |
| .sp |
| This variable is initialized by the first \fBproject()\fP or |
| \fBenable_language()\fP command called in a project when a new build |
| tree is first created. If the \fBCMAKE_CONFIGURATION_TYPES\fP |
| environment variable is set, its value is used. Otherwise, the default |
| value is generator\-specific. |
| .sp |
| Depending on the situation, the values in this variable may be treated |
| case\-sensitively or case\-insensitively. See Build Configurations |
| for discussion of this and other related topics. |
| .sp |
| For single\-config generators, see \fBCMAKE_BUILD_TYPE\fP\&. |
| .SS CMAKE_DEPENDS_IN_PROJECT_ONLY |
| .sp |
| New in version 3.6. |
| |
| .sp |
| When set to \fBTRUE\fP 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. |
| .sp |
| This should be used carefully in cases where some source files are picked up |
| through external headers during the build. |
| .SS CMAKE_DISABLE_FIND_PACKAGE_<PackageName> |
| .sp |
| Variable for disabling \fBfind_package()\fP calls. |
| .sp |
| Every non\-\fBREQUIRED\fP \fBfind_package()\fP call in a project can be |
| disabled by setting the variable |
| \fBCMAKE_DISABLE_FIND_PACKAGE_<PackageName>\fP to \fBTRUE\fP\&. |
| This can be used to build a project without an optional package, |
| although that package is installed. |
| .sp |
| 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 \fBcmake(1)\fP \fB\-U\fP |
| .sp |
| See also the \fBCMAKE_REQUIRE_FIND_PACKAGE_<PackageName>\fP variable. |
| .SS CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES |
| .sp |
| New in version 3.6. |
| |
| .sp |
| This cache variable is used by the Eclipse project generator. See |
| \fBcmake\-generators(7)\fP\&. |
| .sp |
| 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. |
| .SS CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT |
| .sp |
| New in version 3.6. |
| |
| .sp |
| This cache variable is used by the Eclipse project generator. See |
| \fBcmake\-generators(7)\fP\&. |
| .sp |
| If this variable is set to TRUE, the Eclipse project generator will generate |
| an Eclipse project in \fBCMAKE_SOURCE_DIR\fP . This project can then |
| be used in Eclipse e.g. for the version control functionality. |
| \fI\%CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT\fP defaults to FALSE; so |
| nothing is written into the source directory. |
| .SS CMAKE_ECLIPSE_MAKE_ARGUMENTS |
| .sp |
| New in version 3.6. |
| |
| .sp |
| This cache variable is used by the Eclipse project generator. See |
| \fBcmake\-generators(7)\fP\&. |
| .sp |
| 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). |
| .SS CMAKE_ECLIPSE_RESOURCE_ENCODING |
| .sp |
| New in version 3.16. |
| |
| .sp |
| This cache variable tells the \fBEclipse CDT4\fP project generator |
| to set the resource encoding to the given value in generated project files. |
| If no value is given, no encoding will be set. |
| .SS CMAKE_ECLIPSE_VERSION |
| .sp |
| New in version 3.6. |
| |
| .sp |
| This cache variable is used by the Eclipse project generator. See |
| \fBcmake\-generators(7)\fP\&. |
| .sp |
| 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\(aqt find |
| Eclipse, it assumes the oldest supported version, Eclipse Callisto (3.2). |
| .SS CMAKE_ERROR_DEPRECATED |
| .sp |
| Whether to issue errors for deprecated functionality. |
| .sp |
| If \fBTRUE\fP, use of deprecated functionality will issue fatal errors. |
| If this variable is not set, CMake behaves as if it were set to \fBFALSE\fP\&. |
| .SS CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION |
| .sp |
| Ask \fBcmake_install.cmake\fP script to error out as soon as a file with |
| absolute \fBINSTALL DESTINATION\fP is encountered. |
| .sp |
| The fatal error is emitted before the installation of the offending |
| file takes place. This variable is used by CMake\-generated |
| \fBcmake_install.cmake\fP scripts. If one sets this variable to \fBON\fP while |
| running the script, it may get fatal error messages from the script. |
| .SS CMAKE_EXECUTE_PROCESS_COMMAND_ECHO |
| .sp |
| New in version 3.15. |
| |
| .sp |
| If this variable is set to \fBSTDERR\fP, \fBSTDOUT\fP or \fBNONE\fP then commands |
| in \fBexecute_process()\fP calls will be printed to either stderr or |
| stdout or not at all. |
| .SS CMAKE_EXPORT_COMPILE_COMMANDS |
| .sp |
| New in version 3.5. |
| |
| .sp |
| Enable/Disable output of compile commands during generation. |
| .sp |
| If enabled, generates a \fBcompile_commands.json\fP 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: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| [ |
| { |
| "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" |
| } |
| ] |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| This is initialized by the \fBCMAKE_EXPORT_COMPILE_COMMANDS\fP environment |
| variable, and initializes the \fBEXPORT_COMPILE_COMMANDS\fP target |
| property for all targets. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| This option is implemented only by Makefile Generators |
| and the \fBNinja\fP\&. It is ignored on other generators. |
| .sp |
| This option currently does not work well in combination with |
| the \fBUNITY_BUILD\fP target property or the |
| \fBCMAKE_UNITY_BUILD\fP variable. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_EXPORT_PACKAGE_REGISTRY |
| .sp |
| New in version 3.15. |
| |
| .sp |
| Enables the \fBexport(PACKAGE)\fP command when \fBCMP0090\fP |
| is set to \fBNEW\fP\&. |
| .sp |
| The \fBexport(PACKAGE)\fP command does nothing by default. In some cases |
| it is desirable to write to the user package registry, so the |
| \fBCMAKE_EXPORT_PACKAGE_REGISTRY\fP variable may be set to enable it. |
| .sp |
| If \fBCMP0090\fP is \fInot\fP set to \fBNEW\fP this variable does nothing, and |
| the \fBCMAKE_EXPORT_NO_PACKAGE_REGISTRY\fP variable controls the behavior |
| instead. |
| .sp |
| See also Disabling the Package Registry\&. |
| .SS CMAKE_EXPORT_NO_PACKAGE_REGISTRY |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Disable the \fBexport(PACKAGE)\fP command when \fBCMP0090\fP |
| is not set to \fBNEW\fP\&. |
| .sp |
| In some cases, for example for packaging and for system wide |
| installations, it is not desirable to write the user package registry. |
| If the \fBCMAKE_EXPORT_NO_PACKAGE_REGISTRY\fP variable is enabled, |
| the \fBexport(PACKAGE)\fP command will do nothing. |
| .sp |
| If \fBCMP0090\fP is set to \fBNEW\fP this variable does nothing, and the |
| \fBCMAKE_EXPORT_PACKAGE_REGISTRY\fP variable controls the behavior |
| instead. |
| .sp |
| See also Disabling the Package Registry\&. |
| .SS CMAKE_FIND_APPBUNDLE |
| .sp |
| New in version 3.4. |
| |
| .sp |
| This variable affects how \fBfind_*\fP commands choose between |
| macOS Application Bundles and unix\-style package components. |
| .sp |
| On Darwin or systems supporting macOS Application Bundles, the |
| \fBCMAKE_FIND_APPBUNDLE\fP variable can be set to empty or |
| one of the following: |
| .INDENT 0.0 |
| .TP |
| .B \fBFIRST\fP |
| Try to find application bundles before standard programs. |
| This is the default on Darwin. |
| .TP |
| .B \fBLAST\fP |
| Try to find application bundles after standard programs. |
| .TP |
| .B \fBONLY\fP |
| Only try to find application bundles. |
| .TP |
| .B \fBNEVER\fP |
| Never try to find application bundles. |
| .UNINDENT |
| .SS CMAKE_FIND_FRAMEWORK |
| .sp |
| New in version 3.4. |
| |
| .sp |
| This variable affects how \fBfind_*\fP commands choose between |
| macOS Frameworks and unix\-style package components. |
| .sp |
| On Darwin or systems supporting macOS Frameworks, the |
| \fBCMAKE_FIND_FRAMEWORK\fP variable can be set to empty or |
| one of the following: |
| .INDENT 0.0 |
| .TP |
| .B \fBFIRST\fP |
| Try to find frameworks before standard libraries or headers. |
| This is the default on Darwin. |
| .TP |
| .B \fBLAST\fP |
| Try to find frameworks after standard libraries or headers. |
| .TP |
| .B \fBONLY\fP |
| Only try to find frameworks. |
| .TP |
| .B \fBNEVER\fP |
| Never try to find frameworks. |
| .UNINDENT |
| .SS CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX |
| .sp |
| New in version 3.9. |
| |
| .sp |
| Specify a \fB<suffix>\fP to tell the \fBfind_library()\fP command to |
| search in a \fBlib<suffix>\fP directory before each \fBlib\fP directory that |
| would normally be searched. |
| .sp |
| This overrides the behavior of related global properties: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBFIND_LIBRARY_USE_LIB32_PATHS\fP |
| .IP \(bu 2 |
| \fBFIND_LIBRARY_USE_LIB64_PATHS\fP |
| .IP \(bu 2 |
| \fBFIND_LIBRARY_USE_LIBX32_PATHS\fP |
| .UNINDENT |
| .SS CMAKE_FIND_LIBRARY_PREFIXES |
| .sp |
| Prefixes to prepend when looking for libraries. |
| .sp |
| This specifies what prefixes to add to library names when the |
| \fBfind_library()\fP command looks for libraries. On UNIX systems this is |
| typically \fBlib\fP, meaning that when trying to find the \fBfoo\fP library it |
| will look for \fBlibfoo\fP\&. |
| .SS CMAKE_FIND_LIBRARY_SUFFIXES |
| .sp |
| Suffixes to append when looking for libraries. |
| .sp |
| This specifies what suffixes to add to library names when the |
| \fBfind_library()\fP command looks for libraries. On Windows systems this |
| is typically \fB\&.lib\fP and, depending on the compiler, \fB\&.dll.a\fP, \fB\&.a\fP |
| (e.g. GCC and Clang), so when it tries to find the \fBfoo\fP library, it will |
| look for \fB[<prefix>]foo.lib\fP and/or \fB[<prefix>]foo[.dll].a\fP, depending on |
| the compiler used and the \fB<prefix>\fP specified in the |
| \fBCMAKE_FIND_LIBRARY_PREFIXES\fP\&. |
| .SS CMAKE_FIND_NO_INSTALL_PREFIX |
| .sp |
| Exclude the values of the \fBCMAKE_INSTALL_PREFIX\fP and |
| \fBCMAKE_STAGING_PREFIX\fP variables from |
| \fBCMAKE_SYSTEM_PREFIX_PATH\fP\&. CMake adds these project\-destination |
| prefixes to \fBCMAKE_SYSTEM_PREFIX_PATH\fP by default in order to |
| support building a series of dependent packages and installing them into |
| a common prefix. Set \fBCMAKE_FIND_NO_INSTALL_PREFIX\fP to \fBTRUE\fP |
| to suppress this behavior. |
| .sp |
| The \fBCMAKE_SYSTEM_PREFIX_PATH\fP is initialized on the first call to a |
| \fBproject()\fP or \fBenable_language()\fP command. Therefore one must |
| set \fBCMAKE_FIND_NO_INSTALL_PREFIX\fP before this in order to take effect. A |
| user may set the variable as a cache entry on the command line to achieve this. |
| .sp |
| Note that the prefix(es) 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. |
| .SS CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Deprecated since version 3.16: Use the \fBCMAKE_FIND_USE_PACKAGE_REGISTRY\fP variable instead. |
| |
| .sp |
| By default this variable is not set. If neither |
| \fBCMAKE_FIND_USE_PACKAGE_REGISTRY\fP nor |
| \fBCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY\fP is set, then |
| \fBfind_package()\fP will use the User Package Registry |
| unless the \fBNO_CMAKE_PACKAGE_REGISTRY\fP option is provided. |
| .sp |
| \fBCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY\fP is ignored if |
| \fBCMAKE_FIND_USE_PACKAGE_REGISTRY\fP is set. |
| .sp |
| 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 \fI\%CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY\fP |
| variable is \fBTRUE\fP, all the \fBfind_package()\fP commands will skip |
| the User Package Registry as if they were called with the |
| \fBNO_CMAKE_PACKAGE_REGISTRY\fP argument. |
| .sp |
| See also Disabling the Package Registry\&. |
| .SS CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Deprecated since version 3.16: Use the \fBCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY\fP variable instead. |
| |
| .sp |
| By default this variable is not set. If neither |
| \fBCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY\fP nor |
| \fBCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY\fP is set, then |
| \fBfind_package()\fP will use the System Package Registry |
| unless the \fBNO_CMAKE_SYSTEM_PACKAGE_REGISTRY\fP option is provided. |
| .sp |
| \fBCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY\fP is ignored if |
| \fBCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY\fP is set. |
| .sp |
| In some cases, it is not desirable to use the |
| System Package Registry when searching for packages. If the |
| \fI\%CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY\fP variable is |
| \fBTRUE\fP, all the \fBfind_package()\fP commands will skip |
| the System Package Registry as if they were called with the |
| \fBNO_CMAKE_SYSTEM_PACKAGE_REGISTRY\fP argument. |
| .sp |
| See also Disabling the Package Registry\&. |
| .SS CMAKE_FIND_PACKAGE_PREFER_CONFIG |
| .sp |
| New in version 3.15. |
| |
| .sp |
| Tell \fBfind_package()\fP to try "Config" mode before "Module" mode if no |
| mode was specified. |
| .sp |
| The command \fBfind_package()\fP operates without an explicit mode when |
| the reduced signature is used without the \fBMODULE\fP option. In this case, |
| by default, CMake first tries Module mode by searching for a |
| \fBFind<pkg>.cmake\fP module. If it fails, CMake then searches for the package |
| using Config mode. |
| .sp |
| Set \fBCMAKE_FIND_PACKAGE_PREFER_CONFIG\fP to \fBTRUE\fP to tell |
| \fBfind_package()\fP to first search using Config mode before falling back |
| to Module mode. |
| .sp |
| This variable may be useful when a developer has compiled a custom version of |
| a common library and wishes to link it to a dependent project. If this |
| variable is set to \fBTRUE\fP, it would prevent a dependent project\(aqs call |
| to \fBfind_package()\fP from selecting the default library located by the |
| system\(aqs \fBFind<pkg>.cmake\fP module before finding the developer\(aqs custom |
| built library. |
| .sp |
| Once this variable is set, it is the responsibility of the exported |
| \fB<pkg>Config.cmake\fP files to provide the same result variables as the |
| \fBFind<pkg>.cmake\fP modules so that dependent projects can use them |
| interchangeably. |
| .SS CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Set to \fBTRUE\fP to tell \fBfind_package()\fP calls to resolve symbolic |
| links in the value of \fB<PackageName>_DIR\fP\&. |
| .sp |
| This is helpful in use cases where the package search path points at a |
| proxy directory in which symlinks to the real package locations appear. |
| This is not enabled by default because there are also common use cases |
| in which the symlinks should be preserved. |
| .SS CMAKE_FIND_PACKAGE_WARN_NO_MODULE |
| .sp |
| Tell \fBfind_package()\fP to warn if called without an explicit mode. |
| .sp |
| If \fBfind_package()\fP is called without an explicit mode option |
| (\fBMODULE\fP, \fBCONFIG\fP, or \fBNO_MODULE\fP) and no \fBFind<pkg>.cmake\fP module |
| is in \fBCMAKE_MODULE_PATH\fP 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. |
| .sp |
| Set \fBCMAKE_FIND_PACKAGE_WARN_NO_MODULE\fP to \fBTRUE\fP to tell |
| \fBfind_package()\fP to warn when it implicitly assumes Config mode. This |
| helps developers enforce use of an explicit mode in all calls to |
| \fBfind_package()\fP within a project. |
| .sp |
| This variable has no effect if \fBCMAKE_FIND_PACKAGE_PREFER_CONFIG\fP is |
| set to \fBTRUE\fP\&. |
| .SS CMAKE_FIND_ROOT_PATH |
| .sp |
| Semicolon\-separated list of root paths to search on the filesystem. |
| .sp |
| This variable is most useful when cross\-compiling. CMake uses the paths in |
| this list as alternative roots to find filesystem items with |
| \fBfind_package()\fP, \fBfind_library()\fP etc. |
| .SS CMAKE_FIND_ROOT_PATH_MODE_INCLUDE |
| .sp |
| This variable controls whether the \fBCMAKE_FIND_ROOT_PATH\fP and |
| \fBCMAKE_SYSROOT\fP are used by \fBfind_file()\fP and \fBfind_path()\fP\&. |
| .sp |
| If set to \fBONLY\fP, then only the roots in \fBCMAKE_FIND_ROOT_PATH\fP |
| will be searched. If set to \fBNEVER\fP, then the roots in |
| \fBCMAKE_FIND_ROOT_PATH\fP will be ignored and only the host system |
| root will be used. If set to \fBBOTH\fP, then the host system paths and the |
| paths in \fBCMAKE_FIND_ROOT_PATH\fP will be searched. |
| .SS CMAKE_FIND_ROOT_PATH_MODE_LIBRARY |
| .sp |
| This variable controls whether the \fBCMAKE_FIND_ROOT_PATH\fP and |
| \fBCMAKE_SYSROOT\fP are used by \fBfind_library()\fP\&. |
| .sp |
| If set to \fBONLY\fP, then only the roots in \fBCMAKE_FIND_ROOT_PATH\fP |
| will be searched. If set to \fBNEVER\fP, then the roots in |
| \fBCMAKE_FIND_ROOT_PATH\fP will be ignored and only the host system |
| root will be used. If set to \fBBOTH\fP, then the host system paths and the |
| paths in \fBCMAKE_FIND_ROOT_PATH\fP will be searched. |
| .SS CMAKE_FIND_ROOT_PATH_MODE_PACKAGE |
| .sp |
| This variable controls whether the \fBCMAKE_FIND_ROOT_PATH\fP and |
| \fBCMAKE_SYSROOT\fP are used by \fBfind_package()\fP\&. |
| .sp |
| If set to \fBONLY\fP, then only the roots in \fBCMAKE_FIND_ROOT_PATH\fP |
| will be searched. If set to \fBNEVER\fP, then the roots in |
| \fBCMAKE_FIND_ROOT_PATH\fP will be ignored and only the host system |
| root will be used. If set to \fBBOTH\fP, then the host system paths and the |
| paths in \fBCMAKE_FIND_ROOT_PATH\fP will be searched. |
| .SS CMAKE_FIND_ROOT_PATH_MODE_PROGRAM |
| .sp |
| This variable controls whether the \fBCMAKE_FIND_ROOT_PATH\fP and |
| \fBCMAKE_SYSROOT\fP are used by \fBfind_program()\fP\&. |
| .sp |
| If set to \fBONLY\fP, then only the roots in \fBCMAKE_FIND_ROOT_PATH\fP |
| will be searched. If set to \fBNEVER\fP, then the roots in |
| \fBCMAKE_FIND_ROOT_PATH\fP will be ignored and only the host system |
| root will be used. If set to \fBBOTH\fP, then the host system paths and the |
| paths in \fBCMAKE_FIND_ROOT_PATH\fP will be searched. |
| .SS CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Controls the default behavior of the following commands for whether or not to |
| search paths provided by cmake\-specific environment variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBfind_program()\fP |
| .IP \(bu 2 |
| \fBfind_library()\fP |
| .IP \(bu 2 |
| \fBfind_file()\fP |
| .IP \(bu 2 |
| \fBfind_path()\fP |
| .IP \(bu 2 |
| \fBfind_package()\fP |
| .UNINDENT |
| .sp |
| This is useful in cross\-compiling environments. |
| .sp |
| By default this variable is not set, which is equivalent to it having |
| a value of \fBTRUE\fP\&. Explicit options given to the above commands |
| take precedence over this variable. |
| .sp |
| See also the \fBCMAKE_FIND_USE_CMAKE_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_SYSTEM_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY\fP, |
| \fBCMAKE_FIND_USE_PACKAGE_REGISTRY\fP, |
| and \fBCMAKE_FIND_USE_PACKAGE_ROOT_PATH\fP variables. |
| .SS CMAKE_FIND_USE_CMAKE_PATH |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Controls the default behavior of the following commands for whether or not to |
| search paths provided by cmake\-specific cache variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBfind_program()\fP |
| .IP \(bu 2 |
| \fBfind_library()\fP |
| .IP \(bu 2 |
| \fBfind_file()\fP |
| .IP \(bu 2 |
| \fBfind_path()\fP |
| .IP \(bu 2 |
| \fBfind_package()\fP |
| .UNINDENT |
| .sp |
| This is useful in cross\-compiling environments. |
| .sp |
| By default this variable is not set, which is equivalent to it having |
| a value of \fBTRUE\fP\&. Explicit options given to the above commands |
| take precedence over this variable. |
| .sp |
| See also the \fBCMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_SYSTEM_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY\fP, |
| \fBCMAKE_FIND_USE_PACKAGE_REGISTRY\fP, |
| and \fBCMAKE_FIND_USE_PACKAGE_ROOT_PATH\fP variables. |
| .SS CMAKE_FIND_USE_CMAKE_SYSTEM_PATH |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Controls the default behavior of the following commands for whether or not to |
| search paths provided by platform\-specific cmake variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBfind_program()\fP |
| .IP \(bu 2 |
| \fBfind_library()\fP |
| .IP \(bu 2 |
| \fBfind_file()\fP |
| .IP \(bu 2 |
| \fBfind_path()\fP |
| .IP \(bu 2 |
| \fBfind_package()\fP |
| .UNINDENT |
| .sp |
| This is useful in cross\-compiling environments. |
| .sp |
| By default this variable is not set, which is equivalent to it having |
| a value of \fBTRUE\fP\&. Explicit options given to the above commands |
| take precedence over this variable. |
| .sp |
| See also the \fBCMAKE_FIND_USE_CMAKE_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY\fP, |
| \fBCMAKE_FIND_USE_PACKAGE_REGISTRY\fP, |
| and \fBCMAKE_FIND_USE_PACKAGE_ROOT_PATH\fP variables. |
| .SS CMAKE_FIND_USE_PACKAGE_REGISTRY |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Controls the default behavior of the \fBfind_package()\fP command for |
| whether or not to search paths provided by the User Package Registry\&. |
| .sp |
| By default this variable is not set and the behavior will fall back |
| to that determined by the deprecated |
| \fBCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY\fP variable. If that is |
| also not set, then \fBfind_package()\fP will use the |
| User Package Registry unless the \fBNO_CMAKE_PACKAGE_REGISTRY\fP option |
| is provided. |
| .sp |
| This variable takes precedence over |
| \fBCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY\fP when both are set. |
| .sp |
| 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 \fI\%CMAKE_FIND_USE_PACKAGE_REGISTRY\fP |
| variable is \fBFALSE\fP, all the \fBfind_package()\fP commands will skip |
| the User Package Registry as if they were called with the |
| \fBNO_CMAKE_PACKAGE_REGISTRY\fP argument. |
| .sp |
| See also Disabling the Package Registry and the |
| \fBCMAKE_FIND_USE_CMAKE_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_SYSTEM_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY\fP, |
| and \fBCMAKE_FIND_USE_PACKAGE_ROOT_PATH\fP variables. |
| .SS CMAKE_FIND_USE_PACKAGE_ROOT_PATH |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Controls the default behavior of the following commands for whether or not to |
| search paths provided by \fB<PackageName>_ROOT\fP variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBfind_program()\fP |
| .IP \(bu 2 |
| \fBfind_library()\fP |
| .IP \(bu 2 |
| \fBfind_file()\fP |
| .IP \(bu 2 |
| \fBfind_path()\fP |
| .IP \(bu 2 |
| \fBfind_package()\fP |
| .UNINDENT |
| .sp |
| By default this variable is not set, which is equivalent to it having |
| a value of \fBTRUE\fP\&. Explicit options given to the above commands |
| take precedence over this variable. |
| .sp |
| See also the \fBCMAKE_FIND_USE_CMAKE_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_SYSTEM_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY\fP, |
| and \fBCMAKE_FIND_USE_PACKAGE_REGISTRY\fP variables. |
| .SS CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Controls the default behavior of the following commands for whether or not to |
| search paths provided by standard system environment variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBfind_program()\fP |
| .IP \(bu 2 |
| \fBfind_library()\fP |
| .IP \(bu 2 |
| \fBfind_file()\fP |
| .IP \(bu 2 |
| \fBfind_path()\fP |
| .IP \(bu 2 |
| \fBfind_package()\fP |
| .UNINDENT |
| .sp |
| This is useful in cross\-compiling environments. |
| .sp |
| By default this variable is not set, which is equivalent to it having |
| a value of \fBTRUE\fP\&. Explicit options given to the above commands |
| take precedence over this variable. |
| .sp |
| See also the \fBCMAKE_FIND_USE_CMAKE_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_SYSTEM_PATH\fP, |
| \fBCMAKE_FIND_USE_PACKAGE_REGISTRY\fP, |
| \fBCMAKE_FIND_USE_PACKAGE_ROOT_PATH\fP, |
| and \fBCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY\fP variables. |
| .SS CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Controls searching the System Package Registry by the |
| \fBfind_package()\fP command. |
| .sp |
| By default this variable is not set and the behavior will fall back |
| to that determined by the deprecated |
| \fBCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY\fP variable. |
| If that is also not set, then \fBfind_package()\fP will use the |
| System Package Registry unless the \fBNO_CMAKE_SYSTEM_PACKAGE_REGISTRY\fP |
| option is provided. |
| .sp |
| This variable takes precedence over |
| \fBCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY\fP when both are set. |
| .sp |
| In some cases, for example to locate only user specific installations, it |
| is not desirable to use the System Package Registry when searching |
| for packages. If the \fBCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY\fP |
| variable is \fBFALSE\fP, all the \fBfind_package()\fP commands will skip |
| the System Package Registry as if they were called with the |
| \fBNO_CMAKE_SYSTEM_PACKAGE_REGISTRY\fP argument. |
| .sp |
| See also Disabling the Package Registry\&. |
| .sp |
| See also the \fBCMAKE_FIND_USE_CMAKE_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_CMAKE_SYSTEM_PATH\fP, |
| \fBCMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH\fP, |
| \fBCMAKE_FIND_USE_PACKAGE_REGISTRY\fP, |
| and \fBCMAKE_FIND_USE_PACKAGE_ROOT_PATH\fP variables. |
| .SS CMAKE_FRAMEWORK_PATH |
| .sp |
| Semicolon\-separated list of directories specifying a search path |
| for macOS frameworks used by the \fBfind_library()\fP, |
| \fBfind_package()\fP, \fBfind_path()\fP, and \fBfind_file()\fP |
| commands. |
| .SS CMAKE_IGNORE_PATH |
| .sp |
| Semicolon\-separated list of directories |
| to be ignored by the various \fBfind...()\fP commands. |
| .sp |
| For \fBfind_program()\fP, \fBfind_library()\fP, \fBfind_file()\fP, |
| and \fBfind_path()\fP, any file found in one of the listed directories |
| will be ignored. The listed directories do not apply recursively, so any |
| subdirectories to be ignored must also be explicitly listed. |
| \fBCMAKE_IGNORE_PATH\fP does not affect the search \fIprefixes\fP used by these |
| four commands. To ignore individual paths under a search prefix |
| (e.g. \fBbin\fP, \fBinclude\fP, \fBlib\fP, etc.), each path must be listed in |
| \fBCMAKE_IGNORE_PATH\fP as a full absolute path. \fBCMAKE_IGNORE_PREFIX_PATH\fP |
| provides a more appropriate way to ignore a whole search prefix. |
| .sp |
| \fBfind_package()\fP is also affected by \fBCMAKE_IGNORE_PATH\fP, but only |
| for \fIConfig mode\fP searches. Any \fB<Name>Config.cmake\fP or |
| \fB<name>\-config.cmake\fP file found in one of the specified directories |
| will be ignored. In addition, any search \fIprefix\fP found in \fBCMAKE_IGNORE_PATH\fP |
| will be skipped for backward compatibility reasons, but new code should |
| prefer to use \fBCMAKE_IGNORE_PREFIX_PATH\fP to ignore prefixes instead. |
| .sp |
| Ignoring search locations can be 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. |
| .sp |
| By default, \fBCMAKE_IGNORE_PATH\fP is empty. It is intended to be set by the |
| project or the end user. |
| .sp |
| See also the following variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBCMAKE_IGNORE_PREFIX_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_IGNORE_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_PREFIX_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_LIBRARY_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_INCLUDE_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_PROGRAM_PATH\fP |
| .UNINDENT |
| .SS CMAKE_IGNORE_PREFIX_PATH |
| .sp |
| New in version 3.23. |
| |
| .sp |
| Semicolon\-separated list of search \fIprefixes\fP |
| to be ignored by the \fBfind_program()\fP, \fBfind_library()\fP, |
| \fBfind_file()\fP, and \fBfind_path()\fP commands. |
| The prefixes are also ignored by the \fIConfig mode\fP of the |
| \fBfind_package()\fP command (\fIModule mode\fP is unaffected). |
| To ignore specific directories instead, see \fBCMAKE_IGNORE_PATH\fP\&. |
| .sp |
| Ignoring search locations can be 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. |
| .sp |
| By default, \fBCMAKE_IGNORE_PREFIX_PATH\fP is empty. It is intended to be set by the |
| project or the end user. |
| .sp |
| See also the following variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBCMAKE_IGNORE_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_IGNORE_PREFIX_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_PREFIX_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_LIBRARY_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_INCLUDE_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_PROGRAM_PATH\fP |
| .UNINDENT |
| .SS CMAKE_INCLUDE_DIRECTORIES_BEFORE |
| .sp |
| Whether to append or prepend directories by default in |
| \fBinclude_directories()\fP\&. |
| .sp |
| This variable affects the default behavior of the \fBinclude_directories()\fP |
| command. Setting this variable to \fBON\fP is equivalent to using the \fBBEFORE\fP |
| option in all uses of that command. |
| .SS CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE |
| .sp |
| Whether to force prepending of project include directories. |
| .sp |
| This variable affects the order of include directories generated in compiler |
| command lines. If set to \fBON\fP, it causes the \fBCMAKE_SOURCE_DIR\fP |
| and the \fBCMAKE_BINARY_DIR\fP to appear first. |
| .SS CMAKE_INCLUDE_PATH |
| .sp |
| Semicolon\-separated list of directories specifying a search path |
| for the \fBfind_file()\fP and \fBfind_path()\fP commands. By default it |
| is empty, it is intended to be set by the project. See also |
| \fBCMAKE_SYSTEM_INCLUDE_PATH\fP and \fBCMAKE_PREFIX_PATH\fP\&. |
| .SS CMAKE_INSTALL_DEFAULT_COMPONENT_NAME |
| .sp |
| Default component used in \fBinstall()\fP commands. |
| .sp |
| If an \fBinstall()\fP command is used without the \fBCOMPONENT\fP 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 \fBUnspecified\fP\&. |
| .SS CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS |
| .sp |
| New in version 3.11. |
| |
| .sp |
| Default permissions for directories created implicitly during installation |
| of files by \fBinstall()\fP and \fBfile(INSTALL)\fP\&. |
| .sp |
| If \fBmake install\fP is invoked and directories are implicitly created they |
| get permissions set by \fI\%CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS\fP |
| variable or platform specific default permissions if the variable is not set. |
| .sp |
| Implicitly created directories are created if they are not explicitly installed |
| by \fBinstall()\fP command but are needed to install a file on a certain |
| path. Example of such locations are directories created due to the setting of |
| \fBCMAKE_INSTALL_PREFIX\fP\&. |
| .sp |
| Expected content of the \fI\%CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS\fP |
| variable is a list of permissions that can be used by \fBinstall()\fP command |
| \fIPERMISSIONS\fP section. |
| .sp |
| Example usage: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS |
| OWNER_READ |
| OWNER_WRITE |
| OWNER_EXECUTE |
| GROUP_READ |
| ) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_INSTALL_MESSAGE |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify verbosity of installation script code generated by the |
| \fBinstall()\fP command (using the \fBfile(INSTALL)\fP command). |
| For paths that are newly installed or updated, installation |
| may print lines like: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| \-\- Installing: /some/destination/path |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| For paths that are already up to date, installation may print |
| lines like: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| \-\- Up\-to\-date: /some/destination/path |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The \fBCMAKE_INSTALL_MESSAGE\fP variable may be set to control |
| which messages are printed: |
| .INDENT 0.0 |
| .TP |
| .B \fBALWAYS\fP |
| Print both \fBInstalling\fP and \fBUp\-to\-date\fP messages. |
| .TP |
| .B \fBLAZY\fP |
| Print \fBInstalling\fP but not \fBUp\-to\-date\fP messages. |
| .TP |
| .B \fBNEVER\fP |
| Print neither \fBInstalling\fP nor \fBUp\-to\-date\fP messages. |
| .UNINDENT |
| .sp |
| Other values have undefined behavior and may not be diagnosed. |
| .sp |
| If this variable is not set, the default behavior is \fBALWAYS\fP\&. |
| .SS CMAKE_INSTALL_PREFIX |
| .sp |
| Install directory used by \fBinstall()\fP\&. |
| .sp |
| If \fBmake install\fP is invoked or \fBINSTALL\fP is built, this directory is |
| prepended onto all install directories. This variable defaults to |
| \fB/usr/local\fP on UNIX and \fBc:/Program Files/${PROJECT_NAME}\fP on Windows. |
| See \fBCMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT\fP for how a |
| project might choose its own default. |
| .sp |
| On UNIX one can use the \fBDESTDIR\fP mechanism in order to relocate the |
| whole installation to a staging area. See the \fBDESTDIR\fP environment |
| variable for more information. |
| .sp |
| The installation prefix is also added to \fBCMAKE_SYSTEM_PREFIX_PATH\fP |
| so that \fBfind_package()\fP, \fBfind_program()\fP, |
| \fBfind_library()\fP, \fBfind_path()\fP, and \fBfind_file()\fP |
| will search the prefix for other software. This behavior can be disabled by |
| setting the \fBCMAKE_FIND_NO_INSTALL_PREFIX\fP to \fBTRUE\fP before the |
| first \fBproject()\fP invocation. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| Use the \fBGNUInstallDirs\fP module to provide GNU\-style |
| options for the layout of directories within the installation. |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The \fBCMAKE_INSTALL_PREFIX\fP may be defined when configuring a build tree |
| to set its installation prefix. Or, when using the \fBcmake(1)\fP |
| command\-line tool\(aqs \fB\-\-install\fP mode, one may specify a different prefix |
| using the \fB\-\-prefix\fP option: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| cmake \-\-install . \-\-prefix /my/install/prefix |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT |
| .sp |
| New in version 3.7.1. |
| |
| .sp |
| CMake sets this variable to a \fBTRUE\fP value when the |
| \fBCMAKE_INSTALL_PREFIX\fP 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: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| set(CMAKE_INSTALL_PREFIX "/my/default" CACHE PATH "..." FORCE) |
| endif() |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_LIBRARY_PATH |
| .sp |
| Semicolon\-separated list of directories specifying a search path |
| for the \fBfind_library()\fP command. By default it is empty, it is |
| intended to be set by the project. See also |
| \fBCMAKE_SYSTEM_LIBRARY_PATH\fP and \fBCMAKE_PREFIX_PATH\fP\&. |
| .SS CMAKE_LINK_DIRECTORIES_BEFORE |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to append or prepend directories by default in |
| \fBlink_directories()\fP\&. |
| .sp |
| This variable affects the default behavior of the \fBlink_directories()\fP |
| command. Setting this variable to \fBON\fP is equivalent to using the \fBBEFORE\fP |
| option in all uses of that command. |
| .SS CMAKE_LINK_LIBRARIES_ONLY_TARGETS |
| .sp |
| New in version 3.23. |
| |
| .sp |
| Set this variable to initialize the \fBLINK_LIBRARIES_ONLY_TARGETS\fP |
| property of non\-imported targets when they are created. Setting it to true |
| enables an additional check that all items named by |
| \fBtarget_link_libraries()\fP that can be target names are actually names |
| of existing targets. See the target property documentation for details. |
| .SS CMAKE_MFC_FLAG |
| .sp |
| Use the MFC library for an executable or dll. |
| .sp |
| Enables the use of the Microsoft Foundation Classes (MFC). |
| It should be set to \fB1\fP for the static MFC library, and |
| \fB2\fP for the shared MFC library. This is used in Visual Studio |
| project files. |
| .sp |
| Usage example: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| add_definitions(\-D_AFXDLL) |
| set(CMAKE_MFC_FLAG 2) |
| add_executable(CMakeSetup WIN32 ${SRCS}) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Contents of \fBCMAKE_MFC_FLAG\fP may use |
| \fBgenerator expressions\fP\&. |
| .SS CMAKE_MAXIMUM_RECURSION_DEPTH |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Maximum recursion depth for CMake scripts. It is intended to be set on the |
| command line with \fB\-DCMAKE_MAXIMUM_RECURSION_DEPTH=<x>\fP, or within |
| \fBCMakeLists.txt\fP by projects that require a large recursion depth. Projects |
| that set this variable should provide the user with a way to override it. For |
| example: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| # About to perform deeply recursive actions |
| if(NOT CMAKE_MAXIMUM_RECURSION_DEPTH) |
| set(CMAKE_MAXIMUM_RECURSION_DEPTH 2000) |
| endif() |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| If it is not set, or is set to a non\-integer value, a sensible default limit is |
| used. If the recursion limit is reached, the script terminates immediately with |
| a fatal error. |
| .sp |
| Calling any of the following commands increases the recursion depth: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBinclude()\fP |
| .IP \(bu 2 |
| \fBfind_package()\fP |
| .IP \(bu 2 |
| \fBadd_subdirectory()\fP |
| .IP \(bu 2 |
| \fBtry_compile()\fP |
| .IP \(bu 2 |
| \fBctest_read_custom_files()\fP |
| .IP \(bu 2 |
| \fBctest_run_script()\fP (unless \fBNEW_PROCESS\fP is specified) |
| .IP \(bu 2 |
| User\-defined \fBfunction()\fP\(aqs and \fBmacro()\fP\(aqs (note that |
| \fBfunction()\fP and \fBmacro()\fP themselves don\(aqt increase recursion |
| depth) |
| .IP \(bu 2 |
| Reading or writing variables that are being watched by a |
| \fBvariable_watch()\fP |
| .UNINDENT |
| .SS CMAKE_MESSAGE_CONTEXT |
| .sp |
| New in version 3.17. |
| |
| .sp |
| When enabled by the \fBcmake\fP \fB\-\-log\-context\fP command line |
| option or the \fBCMAKE_MESSAGE_CONTEXT_SHOW\fP variable, the |
| \fBmessage()\fP command converts the \fBCMAKE_MESSAGE_CONTEXT\fP list into a |
| dot\-separated string surrounded by square brackets and prepends it to each line |
| for messages of log levels \fBNOTICE\fP and below. |
| .sp |
| For logging contexts to work effectively, projects should generally |
| \fBAPPEND\fP and \fBPOP_BACK\fP an item to the current value of |
| \fBCMAKE_MESSAGE_CONTEXT\fP rather than replace it. |
| Projects should not assume the message context at the top of the source tree |
| is empty, as there are scenarios where the context might have already been set |
| (e.g. hierarchical projects). |
| .sp |
| \fBWARNING:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| Valid context names are restricted to anything that could be used |
| as a CMake variable name. All names that begin with an underscore |
| or the string \fBcmake_\fP are also reserved for use by CMake and |
| should not be used by projects. |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Example: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| function(bar) |
| list(APPEND CMAKE_MESSAGE_CONTEXT "bar") |
| message(VERBOSE "bar VERBOSE message") |
| endfunction() |
| |
| function(baz) |
| list(APPEND CMAKE_MESSAGE_CONTEXT "baz") |
| message(DEBUG "baz DEBUG message") |
| endfunction() |
| |
| function(foo) |
| list(APPEND CMAKE_MESSAGE_CONTEXT "foo") |
| bar() |
| message(TRACE "foo TRACE message") |
| baz() |
| endfunction() |
| |
| list(APPEND CMAKE_MESSAGE_CONTEXT "top") |
| |
| message(VERBOSE "Before \(gafoo\(ga") |
| foo() |
| message(VERBOSE "After \(gafoo\(ga") |
| |
| list(POP_BACK CMAKE_MESSAGE_CONTEXT) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Which results in the following output: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| \-\- [top] Before \(gafoo\(ga |
| \-\- [top.foo.bar] bar VERBOSE message |
| \-\- [top.foo] foo TRACE message |
| \-\- [top.foo.baz] baz DEBUG message |
| \-\- [top] After \(gafoo\(ga |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_MESSAGE_CONTEXT_SHOW |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Setting this variable to true enables showing a context with each line |
| logged by the \fBmessage()\fP command (see \fBCMAKE_MESSAGE_CONTEXT\fP |
| for how the context itself is specified). |
| .sp |
| This variable is an alternative to providing the \fB\-\-log\-context\fP option |
| on the \fBcmake\fP command line. Whereas the command line |
| option will apply only to that one CMake run, setting |
| \fBCMAKE_MESSAGE_CONTEXT_SHOW\fP to true as a cache variable will ensure that |
| subsequent CMake runs will continue to show the message context. |
| .sp |
| Projects should not set \fBCMAKE_MESSAGE_CONTEXT_SHOW\fP\&. It is intended for |
| users so that they may control whether or not to include context with messages. |
| .SS CMAKE_MESSAGE_INDENT |
| .sp |
| New in version 3.16. |
| |
| .sp |
| The \fBmessage()\fP command joins the strings from this list and for |
| log levels of \fBNOTICE\fP and below, it prepends the resultant string to |
| each line of the message. |
| .sp |
| Example: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| list(APPEND listVar one two three) |
| |
| message(VERBOSE [[Collected items in the "listVar":]]) |
| list(APPEND CMAKE_MESSAGE_INDENT " ") |
| |
| foreach(item IN LISTS listVar) |
| message(VERBOSE ${item}) |
| endforeach() |
| |
| list(POP_BACK CMAKE_MESSAGE_INDENT) |
| message(VERBOSE "No more indent") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Which results in the following output: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| \-\- Collected items in the "listVar": |
| \-\- one |
| \-\- two |
| \-\- three |
| \-\- No more indent |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_MESSAGE_LOG_LEVEL |
| .sp |
| New in version 3.17. |
| |
| .sp |
| When set, this variable specifies the logging level used by the |
| \fBmessage()\fP command. Valid values are the same as those for the |
| \fB\-\-log\-level\fP command line option of the \fBcmake(1)\fP program. |
| If this variable is set and the \fB\-\-log\-level\fP command line option is |
| given, the command line option takes precedence. |
| .sp |
| The main advantage to using this variable is to make a log level persist |
| between CMake runs. Setting it as a cache variable will ensure that |
| subsequent CMake runs will continue to use the chosen log level. |
| .sp |
| Projects should not set this variable, it is intended for users so that |
| they may control the log level according to their own needs. |
| .SS CMAKE_MODULE_PATH |
| .sp |
| Semicolon\-separated list of directories specifying a search path |
| for CMake modules to be loaded by the \fBinclude()\fP or |
| \fBfind_package()\fP commands before checking the default modules that come |
| with CMake. By default it is empty, it is intended to be set by the project. |
| .SS CMAKE_POLICY_DEFAULT_CMP<NNNN> |
| .sp |
| Default for CMake Policy \fBCMP<NNNN>\fP when it is otherwise left unset. |
| .sp |
| Commands \fBcmake_minimum_required(VERSION)\fP and |
| \fBcmake_policy(VERSION)\fP by default leave policies introduced after |
| the given version unset. Set \fBCMAKE_POLICY_DEFAULT_CMP<NNNN>\fP to \fBOLD\fP |
| or \fBNEW\fP to specify the default for policy \fBCMP<NNNN>\fP, where \fB<NNNN>\fP |
| is the policy number. |
| .sp |
| This variable should not be set by a project in CMake code as a way to |
| set its own policies; use \fBcmake_policy(SET)\fP instead. This |
| variable is meant to externally set policies for which a project has |
| not itself been updated: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| Users running CMake may set this variable in the cache |
| (e.g. \fB\-DCMAKE_POLICY_DEFAULT_CMP<NNNN>=<OLD|NEW>\fP). Set it to \fBOLD\fP |
| to quiet a policy warning while using old behavior or to \fBNEW\fP to |
| try building the project with new behavior. |
| .IP \(bu 2 |
| Projects may set this variable before a call to \fBadd_subdirectory()\fP |
| that adds a third\-party project in order to set its policies without |
| modifying third\-party code. |
| .UNINDENT |
| .SS CMAKE_POLICY_WARNING_CMP<NNNN> |
| .sp |
| Explicitly enable or disable the warning when CMake Policy \fBCMP<NNNN>\fP |
| has not been set explicitly by \fBcmake_policy()\fP or implicitly |
| by \fBcmake_minimum_required()\fP\&. This is meaningful |
| only for the policies that do not warn by default: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0025\fP controls the warning for |
| policy \fBCMP0025\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0047\fP controls the warning for |
| policy \fBCMP0047\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0056\fP controls the warning for |
| policy \fBCMP0056\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0060\fP controls the warning for |
| policy \fBCMP0060\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0065\fP controls the warning for |
| policy \fBCMP0065\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0066\fP controls the warning for |
| policy \fBCMP0066\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0067\fP controls the warning for |
| policy \fBCMP0067\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0082\fP controls the warning for |
| policy \fBCMP0082\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0089\fP controls the warning for |
| policy \fBCMP0089\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0102\fP controls the warning for |
| policy \fBCMP0102\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0112\fP controls the warning for |
| policy \fBCMP0112\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0116\fP controls the warning for |
| policy \fBCMP0116\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0126\fP controls the warning for |
| policy \fBCMP0126\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0128\fP controls the warning for |
| policy \fBCMP0128\fP\&. |
| .IP \(bu 2 |
| \fBCMAKE_POLICY_WARNING_CMP0129\fP controls the warning for |
| policy \fBCMP0129\fP\&. |
| .UNINDENT |
| .sp |
| 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. \fB\-DCMAKE_POLICY_WARNING_CMP<NNNN>=ON\fP). |
| Alternatively, running \fBcmake(1)\fP with the \fB\-\-debug\-output\fP, |
| \fB\-\-trace\fP, or \fB\-\-trace\-expand\fP option will also enable the warning. |
| .SS CMAKE_PREFIX_PATH |
| .sp |
| Semicolon\-separated list of directories specifying installation |
| \fIprefixes\fP to be searched by the \fBfind_package()\fP, |
| \fBfind_program()\fP, \fBfind_library()\fP, \fBfind_file()\fP, and |
| \fBfind_path()\fP commands. Each command will add appropriate |
| subdirectories (like \fBbin\fP, \fBlib\fP, or \fBinclude\fP) as specified in its own |
| documentation. |
| .sp |
| By default this is empty. It is intended to be set by the project. |
| .sp |
| See also \fBCMAKE_SYSTEM_PREFIX_PATH\fP, \fBCMAKE_INCLUDE_PATH\fP, |
| \fBCMAKE_LIBRARY_PATH\fP, \fBCMAKE_PROGRAM_PATH\fP, and |
| \fBCMAKE_IGNORE_PATH\fP\&. |
| .SS CMAKE_PROGRAM_PATH |
| .sp |
| Semicolon\-separated list of directories specifying a search path |
| for the \fBfind_program()\fP command. By default it is empty, it is |
| intended to be set by the project. See also |
| \fBCMAKE_SYSTEM_PROGRAM_PATH\fP and \fBCMAKE_PREFIX_PATH\fP\&. |
| .SS CMAKE_PROJECT_INCLUDE |
| .sp |
| New in version 3.15. |
| |
| .sp |
| A CMake language file or module to be included as the last step of all |
| \fBproject()\fP command calls. This is intended for injecting custom code |
| into project builds without modifying their source. |
| .sp |
| See also the \fBCMAKE_PROJECT_<PROJECT\-NAME>_INCLUDE\fP, |
| \fBCMAKE_PROJECT_<PROJECT\-NAME>_INCLUDE_BEFORE\fP and |
| \fBCMAKE_PROJECT_INCLUDE_BEFORE\fP variables. |
| .SS CMAKE_PROJECT_INCLUDE_BEFORE |
| .sp |
| New in version 3.15. |
| |
| .sp |
| A CMake language file or module to be included as the first step of all |
| \fBproject()\fP command calls. This is intended for injecting custom code |
| into project builds without modifying their source. |
| .sp |
| See also the \fBCMAKE_PROJECT_<PROJECT\-NAME>_INCLUDE\fP, |
| \fBCMAKE_PROJECT_<PROJECT\-NAME>_INCLUDE_BEFORE\fP and |
| \fBCMAKE_PROJECT_INCLUDE\fP variables. |
| .SS CMAKE_PROJECT_<PROJECT\-NAME>_INCLUDE |
| .sp |
| A CMake language file or module to be included as the last step of any |
| \fBproject()\fP command calls that specify \fB<PROJECT\-NAME>\fP as the project |
| name. This is intended for injecting custom code into project builds without |
| modifying their source. |
| .sp |
| See also the \fBCMAKE_PROJECT_<PROJECT\-NAME>_INCLUDE_BEFORE\fP, |
| \fBCMAKE_PROJECT_INCLUDE\fP and |
| \fBCMAKE_PROJECT_INCLUDE_BEFORE\fP variables. |
| .SS CMAKE_PROJECT_<PROJECT\-NAME>_INCLUDE_BEFORE |
| .sp |
| New in version 3.17. |
| |
| .sp |
| A CMake language file or module to be included as the first step of any |
| \fBproject()\fP command calls that specify \fB<PROJECT\-NAME>\fP as the project |
| name. This is intended for injecting custom code into project builds without |
| modifying their source. |
| .sp |
| See also the \fBCMAKE_PROJECT_<PROJECT\-NAME>_INCLUDE\fP, |
| \fBCMAKE_PROJECT_INCLUDE\fP and |
| \fBCMAKE_PROJECT_INCLUDE_BEFORE\fP variables. |
| .SS CMAKE_REQUIRE_FIND_PACKAGE_<PackageName> |
| .sp |
| New in version 3.22. |
| |
| .sp |
| Variable for making \fBfind_package()\fP call \fBREQUIRED\fP\&. |
| .sp |
| Every non\-\fBREQUIRED\fP \fBfind_package()\fP call in a project can be |
| turned into \fBREQUIRED\fP by setting the variable |
| \fBCMAKE_REQUIRE_FIND_PACKAGE_<PackageName>\fP to \fBTRUE\fP\&. |
| This can be used to assert assumptions about build environment and to |
| ensure the build will fail early if they do not hold. |
| .sp |
| See also the \fBCMAKE_DISABLE_FIND_PACKAGE_<PackageName>\fP variable. |
| .SS CMAKE_SKIP_INSTALL_ALL_DEPENDENCY |
| .sp |
| Don\(aqt make the \fBinstall\fP target depend on the \fBall\fP target. |
| .sp |
| By default, the \fBinstall\fP target depends on the \fBall\fP target. This |
| has the effect, that when \fBmake install\fP is invoked or \fBINSTALL\fP is |
| built, first the \fBall\fP target is built, then the installation starts. |
| If \fI\%CMAKE_SKIP_INSTALL_ALL_DEPENDENCY\fP is set to \fBTRUE\fP, this |
| dependency is not created, so the installation process will start immediately, |
| independent from whether the project has been completely built or not. |
| .SS CMAKE_STAGING_PREFIX |
| .sp |
| This variable may be set to a path to install to when cross\-compiling. This can |
| be useful if the path in \fBCMAKE_SYSROOT\fP is read\-only, or otherwise |
| should remain pristine. |
| .sp |
| The \fI\%CMAKE_STAGING_PREFIX\fP location is also used as a search prefix |
| by the \fBfind_*\fP commands. This can be controlled by setting the |
| \fBCMAKE_FIND_NO_INSTALL_PREFIX\fP variable. |
| .sp |
| If any \fBRPATH\fP/\fBRUNPATH\fP entries passed to the linker contain the |
| \fI\%CMAKE_STAGING_PREFIX\fP, the matching path fragments are replaced |
| with the \fBCMAKE_INSTALL_PREFIX\fP\&. |
| .SS CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS |
| .sp |
| New in version 3.8. |
| |
| .sp |
| This variable contains a list of env vars as a list of tokens with the |
| syntax \fBvar=value\fP\&. |
| .sp |
| Example: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS |
| "FOO=FOO1\e;FOO2\e;FOON" |
| "BAR=BAR1\e;BAR2\e;BARN" |
| "BAZ=BAZ1\e;BAZ2\e;BAZN" |
| "FOOBAR=FOOBAR1\e;FOOBAR2\e;FOOBARN" |
| "VALID=" |
| ) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| In case of malformed variables CMake will fail: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS |
| "THIS_IS_NOT_VALID" |
| ) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE |
| .sp |
| New in version 3.8. |
| |
| .sp |
| If this variable evaluates to \fBON\fP at the end of the top\-level |
| \fBCMakeLists.txt\fP file, the \fBSublime Text 2\fP extra generator |
| excludes the build tree from the \fB\&.sublime\-project\fP if it is inside the |
| source tree. |
| .SS CMAKE_SUPPRESS_REGENERATION |
| .sp |
| New in version 3.12. |
| |
| .sp |
| If \fBCMAKE_SUPPRESS_REGENERATION\fP is \fBOFF\fP, which is default, then CMake |
| adds a special target on which all other targets depend that checks the build |
| system and optionally re\-runs CMake to regenerate the build system when |
| the target specification source changes. |
| .sp |
| If this variable evaluates to \fBON\fP at the end of the top\-level |
| \fBCMakeLists.txt\fP file, CMake will not add the regeneration target to the |
| build system or perform any build system checks. |
| .SS CMAKE_SYSROOT |
| .sp |
| Path to pass to the compiler in the \fB\-\-sysroot\fP flag. |
| .sp |
| The \fBCMAKE_SYSROOT\fP content is passed to the compiler in the \fB\-\-sysroot\fP |
| flag, if supported. The path is also stripped from the \fBRPATH\fP/\fBRUNPATH\fP |
| if necessary on installation. The \fBCMAKE_SYSROOT\fP is also used to prefix |
| paths searched by the \fBfind_*\fP commands. |
| .sp |
| This variable may only be set in a toolchain file specified by |
| the \fBCMAKE_TOOLCHAIN_FILE\fP variable. |
| .sp |
| See also the \fBCMAKE_SYSROOT_COMPILE\fP and |
| \fBCMAKE_SYSROOT_LINK\fP variables. |
| .SS CMAKE_SYSROOT_COMPILE |
| .sp |
| New in version 3.9. |
| |
| .sp |
| Path to pass to the compiler in the \fB\-\-sysroot\fP flag when compiling source |
| files. This is the same as \fBCMAKE_SYSROOT\fP but is used only for |
| compiling sources and not linking. |
| .sp |
| This variable may only be set in a toolchain file specified by |
| the \fBCMAKE_TOOLCHAIN_FILE\fP variable. |
| .SS CMAKE_SYSROOT_LINK |
| .sp |
| New in version 3.9. |
| |
| .sp |
| Path to pass to the compiler in the \fB\-\-sysroot\fP flag when linking. This is |
| the same as \fBCMAKE_SYSROOT\fP but is used only for linking and not |
| compiling sources. |
| .sp |
| This variable may only be set in a toolchain file specified by |
| the \fBCMAKE_TOOLCHAIN_FILE\fP variable. |
| .SS CMAKE_SYSTEM_APPBUNDLE_PATH |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Search path for macOS application bundles used by the \fBfind_program()\fP, |
| and \fBfind_package()\fP commands. By default it contains the standard |
| directories for the current system. It is \fInot\fP intended to be modified by |
| the project, use \fBCMAKE_APPBUNDLE_PATH\fP for this. |
| .SS CMAKE_SYSTEM_FRAMEWORK_PATH |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Search path for macOS frameworks used by the \fBfind_library()\fP, |
| \fBfind_package()\fP, \fBfind_path()\fP, and \fBfind_file()\fP |
| commands. By default it contains the standard directories for the |
| current system. It is \fInot\fP intended to be modified by the project, |
| use \fBCMAKE_FRAMEWORK_PATH\fP for this. |
| .SS CMAKE_SYSTEM_IGNORE_PATH |
| .sp |
| Semicolon\-separated list of directories |
| to be ignored by the various \fBfind...()\fP commands. |
| .sp |
| For \fBfind_program()\fP, \fBfind_library()\fP, \fBfind_file()\fP, |
| and \fBfind_path()\fP, any file found in one of the listed directories |
| will be ignored. The listed directories do not apply recursively, so any |
| subdirectories to be ignored must also be explicitly listed. |
| \fBCMAKE_SYSTEM_IGNORE_PATH\fP does not affect the search \fIprefixes\fP used by these |
| four commands. To ignore individual paths under a search prefix |
| (e.g. \fBbin\fP, \fBinclude\fP, \fBlib\fP, etc.), each path must be listed in |
| \fBCMAKE_SYSTEM_IGNORE_PATH\fP as a full absolute path. \fBCMAKE_SYSTEM_IGNORE_PREFIX_PATH\fP |
| provides a more appropriate way to ignore a whole search prefix. |
| .sp |
| \fBfind_package()\fP is also affected by \fBCMAKE_SYSTEM_IGNORE_PATH\fP, but only |
| for \fIConfig mode\fP searches. Any \fB<Name>Config.cmake\fP or |
| \fB<name>\-config.cmake\fP file found in one of the specified directories |
| will be ignored. In addition, any search \fIprefix\fP found in \fBCMAKE_SYSTEM_IGNORE_PATH\fP |
| will be skipped for backward compatibility reasons, but new code should |
| prefer to use \fBCMAKE_SYSTEM_IGNORE_PREFIX_PATH\fP to ignore prefixes instead. |
| .sp |
| Ignoring search locations can be 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. |
| .sp |
| \fBCMAKE_SYSTEM_IGNORE_PATH\fP is populated by CMake as part of its platform |
| and toolchain setup. Its purpose is to ignore locations containing |
| incompatible binaries meant for the host rather than the target platform. |
| The project or end user should not modify this variable, they should use |
| \fBCMAKE_IGNORE_PATH\fP instead. |
| .sp |
| See also the following variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_IGNORE_PREFIX_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_PREFIX_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_LIBRARY_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_INCLUDE_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_PROGRAM_PATH\fP |
| .UNINDENT |
| .SS CMAKE_SYSTEM_IGNORE_PREFIX_PATH |
| .sp |
| New in version 3.23. |
| |
| .sp |
| Semicolon\-separated list of search \fIprefixes\fP |
| to be ignored by the \fBfind_program()\fP, \fBfind_library()\fP, |
| \fBfind_file()\fP, and \fBfind_path()\fP commands. |
| The prefixes are also ignored by the \fIConfig mode\fP of the |
| \fBfind_package()\fP command (\fIModule mode\fP is unaffected). |
| To ignore specific directories instead, see \fBCMAKE_SYSTEM_IGNORE_PATH\fP\&. |
| .sp |
| Ignoring search locations can be 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. |
| .sp |
| \fBCMAKE_SYSTEM_IGNORE_PREFIX_PATH\fP is populated by CMake as part of its platform |
| and toolchain setup. Its purpose is to ignore locations containing |
| incompatible binaries meant for the host rather than the target platform. |
| The project or end user should not modify this variable, they should use |
| \fBCMAKE_IGNORE_PREFIX_PATH\fP instead. |
| .sp |
| See also the following variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_IGNORE_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_PREFIX_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_LIBRARY_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_INCLUDE_PATH\fP |
| .IP \(bu 2 |
| \fBCMAKE_SYSTEM_PROGRAM_PATH\fP |
| .UNINDENT |
| .SS CMAKE_SYSTEM_INCLUDE_PATH |
| .sp |
| Semicolon\-separated list of directories specifying a search path |
| for the \fBfind_file()\fP and \fBfind_path()\fP commands. By default |
| this contains the standard directories for the current system. It is \fInot\fP |
| intended to be modified by the project; use \fBCMAKE_INCLUDE_PATH\fP for |
| this. See also \fBCMAKE_SYSTEM_PREFIX_PATH\fP\&. |
| .SS CMAKE_SYSTEM_LIBRARY_PATH |
| .sp |
| Semicolon\-separated list of directories specifying a search path |
| for the \fBfind_library()\fP command. By default this contains the |
| standard directories for the current system. It is \fInot\fP intended to be |
| modified by the project; use \fBCMAKE_LIBRARY_PATH\fP for this. |
| See also \fBCMAKE_SYSTEM_PREFIX_PATH\fP\&. |
| .SS CMAKE_SYSTEM_PREFIX_PATH |
| .sp |
| Semicolon\-separated list of directories specifying installation |
| \fIprefixes\fP to be searched by the \fBfind_package()\fP, |
| \fBfind_program()\fP, \fBfind_library()\fP, \fBfind_file()\fP, and |
| \fBfind_path()\fP commands. Each command will add appropriate |
| subdirectories (like \fBbin\fP, \fBlib\fP, or \fBinclude\fP) as specified in its own |
| documentation. |
| .sp |
| By default this contains the system directories for the current system, the |
| \fBCMAKE_INSTALL_PREFIX\fP, and the \fBCMAKE_STAGING_PREFIX\fP\&. |
| The installation and staging prefixes may be excluded by setting |
| the \fBCMAKE_FIND_NO_INSTALL_PREFIX\fP variable before the |
| first \fBproject()\fP invocation. |
| .sp |
| The system directories that are contained in \fBCMAKE_SYSTEM_PREFIX_PATH\fP are |
| locations that typically include installed software. An example being |
| \fB/usr/local\fP for UNIX based platforms. In addition to standard platform |
| locations, CMake will also add values to \fBCMAKE_SYSTEM_PREFIX_PATH\fP based on |
| environment variables. The environment variables and search locations that |
| CMake uses may evolve over time, as platforms and their conventions also |
| evolve. The following provides an indicative list of environment variables |
| and locations that CMake searches, but they are subject to change: |
| .INDENT 0.0 |
| .TP |
| .B CrayLinuxEnvironment: |
| .INDENT 7.0 |
| .IP \(bu 2 |
| \fBENV{SYSROOT_DIR}/\fP |
| .IP \(bu 2 |
| \fBENV{SYSROOT_DIR}/usr\fP |
| .IP \(bu 2 |
| \fBENV{SYSROOT_DIR}/usr/local\fP |
| .UNINDENT |
| .TP |
| .B Darwin: |
| .INDENT 7.0 |
| .IP \(bu 2 |
| \fBENV{SDKROOT}/usr\fP When \fBCMAKE_OSX_SYSROOT\fP is not explicitly specified. |
| .UNINDENT |
| .TP |
| .B OpenBSD: |
| .INDENT 7.0 |
| .IP \(bu 2 |
| \fBENV{LOCALBASE}\fP |
| .UNINDENT |
| .TP |
| .B Unix: |
| .INDENT 7.0 |
| .IP \(bu 2 |
| \fBENV{CONDA_PREFIX}\fP when using a conda compiler |
| .UNINDENT |
| .TP |
| .B Windows: |
| .INDENT 7.0 |
| .IP \(bu 2 |
| \fBENV{ProgramW6432}\fP |
| .IP \(bu 2 |
| \fBENV{ProgramFiles}\fP |
| .IP \(bu 2 |
| \fBENV{ProgramFiles(x86)}\fP |
| .IP \(bu 2 |
| \fBENV{SystemDrive}/Program Files\fP |
| .IP \(bu 2 |
| \fBENV{SystemDrive}/Program Files (x86)\fP |
| .UNINDENT |
| .UNINDENT |
| .sp |
| \fBCMAKE_SYSTEM_PREFIX_PATH\fP is \fInot\fP intended to be modified by the project; |
| use \fBCMAKE_PREFIX_PATH\fP for this. |
| .sp |
| See also \fBCMAKE_SYSTEM_INCLUDE_PATH\fP, |
| \fBCMAKE_SYSTEM_LIBRARY_PATH\fP, \fBCMAKE_SYSTEM_PROGRAM_PATH\fP, |
| and \fBCMAKE_SYSTEM_IGNORE_PATH\fP\&. |
| .SS CMAKE_SYSTEM_PROGRAM_PATH |
| .sp |
| Semicolon\-separated list of directories specifying a search path |
| for the \fBfind_program()\fP command. By default this contains the |
| standard directories for the current system. It is \fInot\fP intended to be |
| modified by the project; use \fBCMAKE_PROGRAM_PATH\fP for this. |
| See also \fBCMAKE_SYSTEM_PREFIX_PATH\fP\&. |
| .SS CMAKE_TLS_CAINFO |
| .sp |
| Specify the default value for the \fBfile(DOWNLOAD)\fP and |
| \fBfile(UPLOAD)\fP commands\(aq \fBTLS_CAINFO\fP options. |
| It is unset by default. |
| .sp |
| This variable is also used by the \fBExternalProject\fP and |
| \fBFetchContent\fP modules for internal calls to \fBfile(DOWNLOAD)\fP\&. |
| .SS CMAKE_TLS_VERIFY |
| .sp |
| Specify the default value for the \fBfile(DOWNLOAD)\fP and |
| \fBfile(UPLOAD)\fP commands\(aq \fBTLS_VERIFY\fP options. |
| If not set, the default is \fIoff\fP\&. |
| .sp |
| This variable is also used by the \fBExternalProject\fP and |
| \fBFetchContent\fP modules for internal calls to \fBfile(DOWNLOAD)\fP\&. |
| .sp |
| TLS verification can help provide confidence that one is connecting |
| to the desired server. When downloading known content, one should |
| also use file hashes to verify it. |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_TLS_VERIFY TRUE) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_USER_MAKE_RULES_OVERRIDE |
| .sp |
| Specify a CMake file that overrides platform information. |
| .sp |
| CMake loads the specified file while enabling support for each |
| language from either the \fBproject()\fP or \fBenable_language()\fP |
| commands. It is loaded after CMake\(aqs 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\(aqs defaults. |
| .sp |
| 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 \fBinclude()\fP will work. Use |
| it only as a last resort for behavior that cannot be achieved any |
| other way. For example, one may set the |
| \fBCMAKE_C_FLAGS_INIT\fP variable |
| to change the default value used to initialize the |
| \fBCMAKE_C_FLAGS\fP 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 |
| \fBCMAKE_RUNTIME_OUTPUT_DIRECTORY\fP that affect the placement of |
| binaries. Information set in the file will be used for \fBtry_compile()\fP |
| and \fBtry_run()\fP builds too. |
| .SS CMAKE_WARN_DEPRECATED |
| .sp |
| Whether to issue warnings for deprecated functionality. |
| .sp |
| If not \fBFALSE\fP, use of deprecated functionality will issue warnings. |
| If this variable is not set, CMake behaves as if it were set to \fBTRUE\fP\&. |
| .sp |
| When running \fBcmake(1)\fP, this option can be enabled with the |
| \fB\-Wdeprecated\fP option, or disabled with the \fB\-Wno\-deprecated\fP option. |
| .SS CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION |
| .sp |
| Ask \fBcmake_install.cmake\fP script to warn each time a file with absolute |
| \fBINSTALL DESTINATION\fP is encountered. |
| .sp |
| This variable is used by CMake\-generated \fBcmake_install.cmake\fP scripts. |
| If one sets this variable to \fBON\fP while running the script, it may get |
| warning messages from the script. |
| .SS CMAKE_XCODE_GENERATE_SCHEME |
| .sp |
| New in version 3.9. |
| |
| .sp |
| If enabled, the \fBXcode\fP generator will generate schema files. These |
| are useful to invoke analyze, archive, build\-for\-testing and test |
| actions from the command line. |
| .sp |
| This variable initializes the |
| \fBXCODE_GENERATE_SCHEME\fP |
| target property on all targets. |
| .SS CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY |
| .sp |
| New in version 3.11. |
| |
| .sp |
| If enabled, the \fBXcode\fP generator will generate only a |
| single Xcode project file for the topmost \fBproject()\fP command |
| instead of generating one for every \fBproject()\fP command. |
| .sp |
| This could be useful to speed up the CMake generation step for |
| large projects and to work\-around a bug in the \fBZERO_CHECK\fP logic. |
| .SS CMAKE_XCODE_LINK_BUILD_PHASE_MODE |
| .sp |
| New in version 3.19. |
| |
| .sp |
| This variable is used to initialize the |
| \fBXCODE_LINK_BUILD_PHASE_MODE\fP property on targets. |
| It affects the methods that the \fBXcode\fP generator uses to link |
| different kinds of libraries. Its default value is \fBNONE\fP\&. |
| .SS CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBAddress Sanitizer\fP in the Diagnostics |
| section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_ADDRESS_SANITIZER\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBDetect use of stack after return\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Whether to enable |
| \fBAllow debugging when using document Versions Browser\fP |
| in the Options section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE |
| .sp |
| New in version 3.23. |
| |
| .sp |
| Property value for \fBGPU Frame Capture\fP in the Options section of |
| the generated Xcode scheme. Example values are \fIMetal\fP and |
| \fIDisabled\fP\&. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to disable the \fBMain Thread Checker\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBDynamic Library Loads\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_DYNAMIC_LIBRARY_LOADS\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBDynamic Linker API usage\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_DYNAMIC_LINKER_API_USAGE\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_ENVIRONMENT |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Specify environment variables that should be added to the Arguments |
| section of the generated Xcode scheme. |
| .sp |
| If set to a list of environment variables and values of the form |
| \fBMYVAR=value\fP those environment variables will be added to the |
| scheme. |
| .sp |
| This variable initializes the \fBXCODE_SCHEME_ENVIRONMENT\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_GUARD_MALLOC |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBGuard Malloc\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_GUARD_MALLOC\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable the \fBMain Thread Checker\fP option |
| \fBPause on issues\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_MAIN_THREAD_CHECKER_STOP\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBMalloc Guard Edges\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_MALLOC_GUARD_EDGES\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBMalloc Scribble\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_MALLOC_SCRIBBLE\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_MALLOC_STACK |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBMalloc Stack\fP in the Diagnostics |
| section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_MALLOC_STACK\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_THREAD_SANITIZER |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBThread Sanitizer\fP in the Diagnostics |
| section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_THREAD_SANITIZER\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBThread Sanitizer \- Pause on issues\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_THREAD_SANITIZER_STOP\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBUndefined Behavior Sanitizer\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBUndefined Behavior Sanitizer\fP option |
| \fBPause on issues\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_WORKING_DIRECTORY |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Specify the \fBWorking Directory\fP of the \fIRun\fP and \fIProfile\fP |
| actions in the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_WORKING_DIRECTORY\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Whether to enable \fBZombie Objects\fP |
| in the Diagnostics section of the generated Xcode scheme. |
| .sp |
| This variable initializes the |
| \fBXCODE_SCHEME_ZOMBIE_OBJECTS\fP |
| property on all targets. |
| .sp |
| Please refer to the \fBXCODE_GENERATE_SCHEME\fP target property |
| documentation to see all Xcode schema related properties. |
| .SS <PackageName>_ROOT |
| .sp |
| New in version 3.12. |
| |
| .sp |
| Calls to \fBfind_package(<PackageName>)\fP will search in prefixes |
| specified by the \fB<PackageName>_ROOT\fP CMake variable, where |
| \fB<PackageName>\fP is the name given to the \fBfind_package()\fP call |
| and \fB_ROOT\fP is literal. For example, \fBfind_package(Foo)\fP will search |
| prefixes specified in the \fBFoo_ROOT\fP CMake variable (if set). |
| See policy \fBCMP0074\fP\&. |
| .sp |
| This variable may hold a single prefix or a |
| semicolon\-separated list of multiple prefixes. |
| .sp |
| See also the \fB<PackageName>_ROOT\fP environment variable. |
| .SH VARIABLES THAT DESCRIBE THE SYSTEM |
| .SS ANDROID |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Set to \fB1\fP when the target system (\fBCMAKE_SYSTEM_NAME\fP) is |
| \fBAndroid\fP\&. |
| .SS APPLE |
| .sp |
| Set to \fBTrue\fP when the target system is an Apple platform |
| (macOS, iOS, tvOS or watchOS). |
| .SS BORLAND |
| .sp |
| \fBTrue\fP if the Borland compiler is being used. |
| .sp |
| This is set to \fBtrue\fP if the Borland compiler is being used. |
| .SS CMAKE_ANDROID_NDK_VERSION |
| .sp |
| New in version 3.20. |
| |
| .sp |
| When Cross Compiling for Android with the NDK and using an |
| Android NDK version 11 or higher, this variable is provided by |
| CMake to report the NDK version number. |
| .SS CMAKE_CL_64 |
| .sp |
| Discouraged. Use \fBCMAKE_SIZEOF_VOID_P\fP instead. |
| .sp |
| Set to a true value when using a Microsoft Visual Studio \fBcl\fP compiler that |
| \fItargets\fP a 64\-bit architecture. |
| .SS CMAKE_COMPILER_2005 |
| .sp |
| Using the Visual Studio 2005 compiler from Microsoft |
| .sp |
| Set to true when using the Visual Studio 2005 compiler from Microsoft. |
| .SS CMAKE_HOST_APPLE |
| .sp |
| \fBTrue\fP for Apple macOS operating systems. |
| .sp |
| Set to \fBtrue\fP when the host system is Apple macOS. |
| .SS CMAKE_HOST_SOLARIS |
| .sp |
| New in version 3.6. |
| |
| .sp |
| \fBTrue\fP for Oracle Solaris operating systems. |
| .sp |
| Set to \fBtrue\fP when the host system is Oracle Solaris. |
| .SS CMAKE_HOST_SYSTEM |
| .sp |
| Composite Name of OS CMake is being run on. |
| .sp |
| This variable is the composite of \fBCMAKE_HOST_SYSTEM_NAME\fP and |
| \fBCMAKE_HOST_SYSTEM_VERSION\fP, e.g. |
| \fB${CMAKE_HOST_SYSTEM_NAME}\-${CMAKE_HOST_SYSTEM_VERSION}\fP\&. If |
| \fBCMAKE_HOST_SYSTEM_VERSION\fP is not set, then this variable is |
| the same as \fBCMAKE_HOST_SYSTEM_NAME\fP\&. |
| .SS CMAKE_HOST_SYSTEM_NAME |
| .sp |
| Name of the OS CMake is running on. |
| .sp |
| On systems that have the uname command, this variable is set to the |
| output of \fBuname \-s\fP\&. \fBLinux\fP, \fBWindows\fP, and \fBDarwin\fP for macOS |
| are the values found on the big three operating systems. |
| .SS CMAKE_HOST_SYSTEM_PROCESSOR |
| .sp |
| The name of the CPU CMake is running on. |
| .SS Windows Platforms |
| .sp |
| On Windows, this variable is set to the value of the environment variable |
| \fBPROCESSOR_ARCHITECTURE\fP\&. |
| .SS Unix Platforms |
| .sp |
| On systems that support \fBuname\fP, this variable is set to the output of: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBuname \-m\fP on GNU, Linux, Cygwin, Android, or |
| .IP \(bu 2 |
| \fBarch\fP on OpenBSD, or |
| .IP \(bu 2 |
| on other systems, |
| .INDENT 2.0 |
| .IP \(bu 2 |
| \fBuname \-p\fP if its exit code is nonzero, or |
| .IP \(bu 2 |
| \fBuname \-m\fP otherwise. |
| .UNINDENT |
| .UNINDENT |
| .SS macOS Platforms |
| .sp |
| The value of \fBuname \-m\fP is used by default. |
| .sp |
| On Apple Silicon hosts, the architecture printed by \fBuname \-m\fP may vary |
| based on CMake\(aqs own architecture and that of the invoking process tree. |
| .sp |
| New in version 3.19.2: On Apple Silicon hosts: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| The \fBCMAKE_APPLE_SILICON_PROCESSOR\fP variable or |
| the \fBCMAKE_APPLE_SILICON_PROCESSOR\fP environment variable |
| may be set to specify the host architecture explicitly. |
| .IP \(bu 2 |
| If \fBCMAKE_OSX_ARCHITECTURES\fP is not set, CMake adds explicit |
| flags to tell the compiler to build for the host architecture so the |
| toolchain does not have to guess based on the process tree\(aqs architecture. |
| .UNINDENT |
| |
| .SS CMAKE_HOST_SYSTEM_VERSION |
| .sp |
| The OS version CMake is running on. |
| .sp |
| A numeric version string for the system. On systems that support |
| \fBuname\fP, this variable is set to the output of \fBuname \-r\fP\&. On other |
| systems this is set to major\-minor version numbers. |
| .SS CMAKE_HOST_UNIX |
| .sp |
| \fBTrue\fP for UNIX and UNIX like operating systems. |
| .sp |
| Set to \fBtrue\fP when the host system is UNIX or UNIX like (i.e. APPLE and |
| CYGWIN). |
| .SS CMAKE_HOST_WIN32 |
| .sp |
| \fBTrue\fP if the host system is running Windows, including Windows 64\-bit and MSYS. |
| .sp |
| Set to \fBfalse\fP on Cygwin. |
| .SS CMAKE_LIBRARY_ARCHITECTURE |
| .sp |
| Target architecture library directory name, if detected. |
| .sp |
| This is the value of \fBCMAKE_<LANG>_LIBRARY_ARCHITECTURE\fP as detected |
| for one of the enabled languages. |
| .SS CMAKE_LIBRARY_ARCHITECTURE_REGEX |
| .sp |
| Regex matching possible target architecture library directory names. |
| .sp |
| This is used to detect \fBCMAKE_<LANG>_LIBRARY_ARCHITECTURE\fP from the |
| implicit linker search path by matching the \fB<arch>\fP name. |
| .SS CMAKE_OBJECT_PATH_MAX |
| .sp |
| Maximum object file full\-path length allowed by native build tools. |
| .sp |
| 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. |
| .SS CMAKE_SYSTEM |
| .sp |
| Composite name of operating system CMake is compiling for. |
| .sp |
| This variable is the composite of \fBCMAKE_SYSTEM_NAME\fP and |
| \fBCMAKE_SYSTEM_VERSION\fP, e.g. |
| \fB${CMAKE_SYSTEM_NAME}\-${CMAKE_SYSTEM_VERSION}\fP\&. If |
| \fBCMAKE_SYSTEM_VERSION\fP is not set, then this variable is |
| the same as \fBCMAKE_SYSTEM_NAME\fP\&. |
| .SS CMAKE_SYSTEM_NAME |
| .sp |
| The name of the operating system for which CMake is to build. |
| See the \fBCMAKE_SYSTEM_VERSION\fP variable for the OS version. |
| .sp |
| Note that \fBCMAKE_SYSTEM_NAME\fP is not set to anything by default when running |
| in script mode, since it\(aqs not building anything. |
| .SS System Name for Host Builds |
| .sp |
| \fBCMAKE_SYSTEM_NAME\fP is by default set to the same value as the |
| \fBCMAKE_HOST_SYSTEM_NAME\fP variable so that the build |
| targets the host system. |
| .SS System Name for Cross Compiling |
| .sp |
| \fBCMAKE_SYSTEM_NAME\fP may be set explicitly when first configuring a new build |
| tree in order to enable cross compiling\&. |
| In this case the \fBCMAKE_SYSTEM_VERSION\fP variable must also be |
| set explicitly. |
| .SS CMAKE_SYSTEM_PROCESSOR |
| .sp |
| When not cross\-compiling, this variable has the same value as the |
| \fBCMAKE_HOST_SYSTEM_PROCESSOR\fP variable. In many cases, |
| this will correspond to the target architecture for the build, but |
| this is not guaranteed. (E.g. on Windows, the host may be \fBAMD64\fP |
| even when using a MSVC \fBcl\fP compiler with a 32\-bit target.) |
| .sp |
| When cross\-compiling, a \fBCMAKE_TOOLCHAIN_FILE\fP should set |
| the \fBCMAKE_SYSTEM_PROCESSOR\fP variable to match target architecture |
| that it specifies (via \fBCMAKE_<LANG>_COMPILER\fP and perhaps |
| \fBCMAKE_<LANG>_COMPILER_TARGET\fP). |
| .SS CMAKE_SYSTEM_VERSION |
| .sp |
| The version of the operating system for which CMake is to build. |
| See the \fBCMAKE_SYSTEM_NAME\fP variable for the OS name. |
| .SS System Version for Host Builds |
| .sp |
| When the \fBCMAKE_SYSTEM_NAME\fP variable takes its default value |
| then \fBCMAKE_SYSTEM_VERSION\fP is by default set to the same value as the |
| \fBCMAKE_HOST_SYSTEM_VERSION\fP variable so that the build targets |
| the host system version. |
| .sp |
| In the case of a host build then \fBCMAKE_SYSTEM_VERSION\fP 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. |
| .SS System Version for Cross Compiling |
| .sp |
| When the \fBCMAKE_SYSTEM_NAME\fP variable is set explicitly to |
| enable cross compiling then the |
| value of \fBCMAKE_SYSTEM_VERSION\fP must also be set explicitly to specify |
| the target system version. |
| .SS CYGWIN |
| .sp |
| \fBTrue\fP for Cygwin. |
| .sp |
| Set to \fBtrue\fP when using Cygwin. |
| .SS GHSMULTI |
| .sp |
| New in version 3.3. |
| |
| .sp |
| \fB1\fP when using \fBGreen Hills MULTI\fP generator. |
| .sp |
| Also, Set to \fB1\fP when the target system is a Green Hills platform |
| (i.e. When CMAKE_SYSTEM_NAME is \fBGHS\-MULTI\fP). |
| .SS IOS |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Set to \fB1\fP when the target system (\fBCMAKE_SYSTEM_NAME\fP) is \fBiOS\fP\&. |
| .SS MINGW |
| .sp |
| New in version 3.2. |
| |
| .sp |
| \fBTrue\fP when using MinGW |
| .sp |
| Set to \fBtrue\fP when the compiler is some version of MinGW. |
| .SS MSVC |
| .sp |
| Set to \fBtrue\fP when the compiler is some version of Microsoft Visual C++ |
| or another compiler simulating the Visual C++ \fBcl\fP command\-line syntax. |
| .sp |
| See also the \fBMSVC_VERSION\fP variable. |
| .SS MSVC10 |
| .sp |
| Discouraged. Use the \fBMSVC_VERSION\fP variable instead. |
| .sp |
| \fBTrue\fP when using the Microsoft Visual Studio \fBv100\fP toolset |
| (\fBcl\fP version 16) or another compiler that simulates it. |
| .SS MSVC11 |
| .sp |
| Discouraged. Use the \fBMSVC_VERSION\fP variable instead. |
| .sp |
| \fBTrue\fP when using the Microsoft Visual Studio \fBv110\fP toolset |
| (\fBcl\fP version 17) or another compiler that simulates it. |
| .SS MSVC12 |
| .sp |
| Discouraged. Use the \fBMSVC_VERSION\fP variable instead. |
| .sp |
| \fBTrue\fP when using the Microsoft Visual Studio \fBv120\fP toolset |
| (\fBcl\fP version 18) or another compiler that simulates it. |
| .SS MSVC14 |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Discouraged. Use the \fBMSVC_VERSION\fP variable instead. |
| .sp |
| \fBTrue\fP when using the Microsoft Visual Studio \fBv140\fP or \fBv141\fP |
| toolset (\fBcl\fP version 19) or another compiler that simulates it. |
| .SS MSVC60 |
| .sp |
| Discouraged. Use the \fBMSVC_VERSION\fP variable instead. |
| .sp |
| \fBTrue\fP when using Microsoft Visual C++ 6.0. |
| .sp |
| Set to \fBtrue\fP when the compiler is version 6.0 of Microsoft Visual C++. |
| .SS MSVC70 |
| .sp |
| Discouraged. Use the \fBMSVC_VERSION\fP variable instead. |
| .sp |
| \fBTrue\fP when using Microsoft Visual C++ 7.0. |
| .sp |
| Set to \fBtrue\fP when the compiler is version 7.0 of Microsoft Visual C++. |
| .SS MSVC71 |
| .sp |
| Discouraged. Use the \fBMSVC_VERSION\fP variable instead. |
| .sp |
| \fBTrue\fP when using Microsoft Visual C++ 7.1. |
| .sp |
| Set to \fBtrue\fP when the compiler is version 7.1 of Microsoft Visual C++. |
| .SS MSVC80 |
| .sp |
| Discouraged. Use the \fBMSVC_VERSION\fP variable instead. |
| .sp |
| \fBTrue\fP when using the Microsoft Visual Studio \fBv80\fP toolset |
| (\fBcl\fP version 14) or another compiler that simulates it. |
| .SS MSVC90 |
| .sp |
| Discouraged. Use the \fBMSVC_VERSION\fP variable instead. |
| .sp |
| \fBTrue\fP when using the Microsoft Visual Studio \fBv90\fP toolset |
| (\fBcl\fP version 15) or another compiler that simulates it. |
| .SS MSVC_IDE |
| .sp |
| \fBTrue\fP when using the Microsoft Visual C++ IDE. |
| .sp |
| Set to \fBtrue\fP when the target platform is the Microsoft Visual C++ IDE, as |
| opposed to the command line compiler. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| This variable is only available after compiler detection has been performed, |
| so it is not available to toolchain files or before the first |
| \fBproject()\fP or \fBenable_language()\fP call which uses an |
| MSVC\-like compiler. |
| .UNINDENT |
| .UNINDENT |
| .SS MSVC_TOOLSET_VERSION |
| .sp |
| New in version 3.12. |
| |
| .sp |
| The toolset version of Microsoft Visual C/C++ being used if any. |
| If MSVC\-like is being used, this variable is set based on the version |
| of the compiler as given by the \fBMSVC_VERSION\fP variable. |
| .sp |
| Known toolset version numbers are: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| 80 = VS 2005 (8.0) |
| 90 = VS 2008 (9.0) |
| 100 = VS 2010 (10.0) |
| 110 = VS 2012 (11.0) |
| 120 = VS 2013 (12.0) |
| 140 = VS 2015 (14.0) |
| 141 = VS 2017 (15.0) |
| 142 = VS 2019 (16.0) |
| 143 = VS 2022 (17.0) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Compiler versions newer than those known to CMake will be reported |
| as the latest known toolset version. |
| .sp |
| See also the \fBMSVC_VERSION\fP variable. |
| .SS MSVC_VERSION |
| .sp |
| The version of Microsoft Visual C/C++ being used if any. |
| If a compiler simulating Visual C++ is being used, this variable is set |
| to the toolset version simulated as given by the \fB_MSC_VER\fP |
| preprocessor definition. |
| .sp |
| Known version numbers are: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| 1200 = VS 6.0 |
| 1300 = VS 7.0 |
| 1310 = VS 7.1 |
| 1400 = VS 8.0 (v80 toolset) |
| 1500 = VS 9.0 (v90 toolset) |
| 1600 = VS 10.0 (v100 toolset) |
| 1700 = VS 11.0 (v110 toolset) |
| 1800 = VS 12.0 (v120 toolset) |
| 1900 = VS 14.0 (v140 toolset) |
| 1910\-1919 = VS 15.0 (v141 toolset) |
| 1920\-1929 = VS 16.0 (v142 toolset) |
| 1930\-1939 = VS 17.0 (v143 toolset) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| See also the \fBCMAKE_<LANG>_COMPILER_VERSION\fP and |
| \fBMSVC_TOOLSET_VERSION\fP variable. |
| .SS MSYS |
| .sp |
| New in version 3.14. |
| |
| .sp |
| \fBTrue\fP when using the \fBMSYS Makefiles\fP generator. |
| .SS UNIX |
| .sp |
| Set to \fBTrue\fP when the target system is UNIX or UNIX\-like |
| (e.g. \fBAPPLE\fP and \fBCYGWIN\fP). The |
| \fBCMAKE_SYSTEM_NAME\fP variable should be queried if |
| a more specific understanding of the target system is required. |
| .SS WIN32 |
| .sp |
| Set to \fBTrue\fP when the target system is Windows, including Win64. |
| .SS WINCE |
| .sp |
| New in version 3.1. |
| |
| .sp |
| True when the \fBCMAKE_SYSTEM_NAME\fP variable is set |
| to \fBWindowsCE\fP\&. |
| .SS WINDOWS_PHONE |
| .sp |
| New in version 3.1. |
| |
| .sp |
| True when the \fBCMAKE_SYSTEM_NAME\fP variable is set |
| to \fBWindowsPhone\fP\&. |
| .SS WINDOWS_STORE |
| .sp |
| New in version 3.1. |
| |
| .sp |
| True when the \fBCMAKE_SYSTEM_NAME\fP variable is set |
| to \fBWindowsStore\fP\&. |
| .SS XCODE |
| .sp |
| New in version 3.7. |
| |
| .sp |
| \fBTrue\fP when using \fBXcode\fP generator. |
| .SS XCODE_VERSION |
| .sp |
| Version of Xcode (\fBXcode\fP generator only). |
| .sp |
| Under the \fBXcode\fP generator, this is the version of Xcode |
| as specified in \fBXcode.app/Contents/version.plist\fP (such as \fB3.1.2\fP). |
| .SH VARIABLES THAT CONTROL THE BUILD |
| .SS CMAKE_AIX_EXPORT_ALL_SYMBOLS |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Default value for \fBAIX_EXPORT_ALL_SYMBOLS\fP target property. |
| This variable is used to initialize the property on each target as it is |
| created. |
| .SS CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_ANT_ADDITIONAL_OPTIONS\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_API |
| .sp |
| New in version 3.1. |
| |
| .sp |
| When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio |
| Edition, this variable may be set to specify the default value for the |
| \fBANDROID_API\fP target property. See that target property for |
| additional information. |
| .sp |
| Otherwise, when Cross Compiling for Android, this variable provides |
| the Android API version number targeted. This will be the same value as |
| the \fBCMAKE_SYSTEM_VERSION\fP variable for \fBAndroid\fP platforms. |
| .SS CMAKE_ANDROID_API_MIN |
| .sp |
| New in version 3.2. |
| |
| .sp |
| Default value for the \fBANDROID_API_MIN\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_ARCH |
| .sp |
| New in version 3.4. |
| |
| .sp |
| When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio |
| Edition, this variable may be set to specify the default value for the |
| \fBANDROID_ARCH\fP target property. See that target property for |
| additional information. |
| .sp |
| Otherwise, when Cross Compiling for Android, this variable provides |
| the name of the Android architecture corresponding to the value of the |
| \fBCMAKE_ANDROID_ARCH_ABI\fP variable. The architecture name |
| may be one of: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBarm\fP |
| .IP \(bu 2 |
| \fBarm64\fP |
| .IP \(bu 2 |
| \fBmips\fP |
| .IP \(bu 2 |
| \fBmips64\fP |
| .IP \(bu 2 |
| \fBx86\fP |
| .IP \(bu 2 |
| \fBx86_64\fP |
| .UNINDENT |
| .SS CMAKE_ANDROID_ARCH_ABI |
| .sp |
| New in version 3.7. |
| |
| .sp |
| When Cross Compiling for Android, this variable specifies the |
| target architecture and ABI to be used. Valid values are: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBarm64\-v8a\fP |
| .IP \(bu 2 |
| \fBarmeabi\-v7a\fP |
| .IP \(bu 2 |
| \fBarmeabi\-v6\fP |
| .IP \(bu 2 |
| \fBarmeabi\fP |
| .IP \(bu 2 |
| \fBmips\fP |
| .IP \(bu 2 |
| \fBmips64\fP |
| .IP \(bu 2 |
| \fBx86\fP |
| .IP \(bu 2 |
| \fBx86_64\fP |
| .UNINDENT |
| .sp |
| See also the \fBCMAKE_ANDROID_ARM_MODE\fP and |
| \fBCMAKE_ANDROID_ARM_NEON\fP variables. |
| .SS CMAKE_ANDROID_ARM_MODE |
| .sp |
| New in version 3.7. |
| |
| .sp |
| When Cross Compiling for Android and \fBCMAKE_ANDROID_ARCH_ABI\fP |
| is set to one of the \fBarmeabi\fP architectures, set \fBCMAKE_ANDROID_ARM_MODE\fP |
| to \fBON\fP to target 32\-bit ARM processors (\fB\-marm\fP). Otherwise, the |
| default is to target the 16\-bit Thumb processors (\fB\-mthumb\fP). |
| .SS CMAKE_ANDROID_ARM_NEON |
| .sp |
| New in version 3.7. |
| |
| .sp |
| When Cross Compiling for Android and \fBCMAKE_ANDROID_ARCH_ABI\fP |
| is set to \fBarmeabi\-v7a\fP set \fBCMAKE_ANDROID_ARM_NEON\fP to \fBON\fP to target |
| ARM NEON devices. |
| .SS CMAKE_ANDROID_ASSETS_DIRECTORIES |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_ASSETS_DIRECTORIES\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_EXCEPTIONS |
| .sp |
| New in version 3.20. |
| |
| .sp |
| When Cross Compiling for Android with the NDK, this variable may be set |
| to specify whether exceptions are enabled. |
| .SS CMAKE_ANDROID_GUI |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Default value for the \fBANDROID_GUI\fP target property of |
| executables. See that target property for additional information. |
| .SS CMAKE_ANDROID_JAR_DEPENDENCIES |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_JAR_DEPENDENCIES\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_JAR_DIRECTORIES |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_JAR_DIRECTORIES\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_JAVA_SOURCE_DIR |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_JAVA_SOURCE_DIR\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_NATIVE_LIB_DEPENDENCIES\fP target |
| property. See that target property for additional information. |
| .SS CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_NATIVE_LIB_DIRECTORIES\fP target |
| property. See that target property for additional information. |
| .SS CMAKE_ANDROID_NDK |
| .sp |
| New in version 3.7. |
| |
| .sp |
| 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 \fBplatforms\fP subdirectory holding the \fBandroid\-<api>\fP |
| directories. |
| .SS CMAKE_ANDROID_NDK_DEPRECATED_HEADERS |
| .sp |
| New in version 3.9. |
| |
| .sp |
| When Cross Compiling for Android with the NDK, this variable |
| may be set to specify whether to use the deprecated per\-api\-level |
| headers instead of the unified headers. |
| .sp |
| If not specified, the default will be \fIfalse\fP if using a NDK version |
| that provides the unified headers and \fItrue\fP otherwise. |
| .SS CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG |
| .sp |
| New in version 3.7.1. |
| |
| .sp |
| When Cross Compiling for Android with the NDK, this variable |
| provides the NDK\(aqs "host tag" used to construct the path to prebuilt |
| toolchains that run on the host. |
| .SS CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION |
| .sp |
| New in version 3.7. |
| |
| .sp |
| 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. |
| .sp |
| On NDK r19 or above, this variable must be unset or set to \fBclang\fP\&. |
| .sp |
| On NDK r18 or below, this variable must be set to one of these forms: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fB<major>.<minor>\fP: GCC of specified version |
| .IP \(bu 2 |
| \fBclang<major>.<minor>\fP: Clang of specified version |
| .IP \(bu 2 |
| \fBclang\fP: Clang of most recent available version |
| .UNINDENT |
| .sp |
| A toolchain of the requested version will be selected automatically to |
| match the ABI named in the \fBCMAKE_ANDROID_ARCH_ABI\fP variable. |
| .sp |
| If not specified, the default will be a value that selects the latest |
| available GCC toolchain. |
| .SS CMAKE_ANDROID_PROCESS_MAX |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_PROCESS_MAX\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_PROGUARD |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_PROGUARD\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_PROGUARD_CONFIG_PATH |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_PROGUARD_CONFIG_PATH\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_RTTI |
| .sp |
| New in version 3.20. |
| |
| .sp |
| When Cross Compiling for Android with the NDK, this variable may be set |
| to specify whether RTTI is enabled. |
| .SS CMAKE_ANDROID_SECURE_PROPS_PATH |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_SECURE_PROPS_PATH\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_SKIP_ANT_STEP |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for the \fBANDROID_SKIP_ANT_STEP\fP target property. |
| See that target property for additional information. |
| .SS CMAKE_ANDROID_STANDALONE_TOOLCHAIN |
| .sp |
| New in version 3.7. |
| |
| .sp |
| 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 \fBsysroot\fP subdirectory. |
| .SS CMAKE_ANDROID_STL_TYPE |
| .sp |
| New in version 3.4. |
| |
| .sp |
| When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio |
| Edition, this variable may be set to specify the default value for the |
| \fBANDROID_STL_TYPE\fP target property. See that target property |
| for additional information. |
| .sp |
| 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: |
| .INDENT 0.0 |
| .TP |
| .B \fBnone\fP |
| No C++ Support |
| .TP |
| .B \fBsystem\fP |
| Minimal C++ without STL |
| .TP |
| .B \fBgabi++_static\fP |
| GAbi++ Static |
| .TP |
| .B \fBgabi++_shared\fP |
| GAbi++ Shared |
| .TP |
| .B \fBgnustl_static\fP |
| GNU libstdc++ Static |
| .TP |
| .B \fBgnustl_shared\fP |
| GNU libstdc++ Shared |
| .TP |
| .B \fBc++_static\fP |
| LLVM libc++ Static |
| .TP |
| .B \fBc++_shared\fP |
| LLVM libc++ Shared |
| .TP |
| .B \fBstlport_static\fP |
| STLport Static |
| .TP |
| .B \fBstlport_shared\fP |
| STLport Shared |
| .UNINDENT |
| .sp |
| The default value is \fBgnustl_static\fP on NDK versions that provide it |
| and otherwise \fBc++_static\fP\&. 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. |
| .SS CMAKE_APPLE_SILICON_PROCESSOR |
| .sp |
| New in version 3.19.2. |
| |
| .sp |
| On Apple Silicon hosts running macOS, set this variable to tell |
| CMake what architecture to use for \fBCMAKE_HOST_SYSTEM_PROCESSOR\fP\&. |
| The value must be either \fBarm64\fP or \fBx86_64\fP\&. |
| .sp |
| The value of this variable should never be modified by project code. |
| It is meant to be set as a cache entry provided by the user, |
| e.g. via \fB\-DCMAKE_APPLE_SILICON_PROCESSOR=...\fP\&. |
| .sp |
| See also the \fBCMAKE_APPLE_SILICON_PROCESSOR\fP environment variable. |
| .SS CMAKE_ARCHIVE_OUTPUT_DIRECTORY |
| .sp |
| Where to put all the ARCHIVE |
| target files when built. |
| .sp |
| This variable is used to initialize the \fBARCHIVE_OUTPUT_DIRECTORY\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> |
| .sp |
| New in version 3.3. |
| |
| .sp |
| Where to put all the ARCHIVE |
| target files when built for a specific configuration. |
| .sp |
| This variable is used to initialize the |
| \fBARCHIVE_OUTPUT_DIRECTORY_<CONFIG>\fP property on all the targets. |
| See that target property for additional information. |
| .SS CMAKE_AUTOGEN_ORIGIN_DEPENDS |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Switch for forwarding origin target dependencies to the corresponding |
| \fB_autogen\fP targets. |
| .sp |
| This variable is used to initialize the \fBAUTOGEN_ORIGIN_DEPENDS\fP |
| property on all the targets. See that target property for additional |
| information. |
| .sp |
| By default \fI\%CMAKE_AUTOGEN_ORIGIN_DEPENDS\fP is \fBON\fP\&. |
| .SS CMAKE_AUTOGEN_PARALLEL |
| .sp |
| New in version 3.11. |
| |
| .sp |
| Number of parallel \fBmoc\fP or \fBuic\fP processes to start when using |
| \fBAUTOMOC\fP and \fBAUTOUIC\fP\&. |
| .sp |
| This variable is used to initialize the \fBAUTOGEN_PARALLEL\fP property |
| on all the targets. See that target property for additional information. |
| .sp |
| By default \fI\%CMAKE_AUTOGEN_PARALLEL\fP is unset. |
| .SS CMAKE_AUTOGEN_VERBOSE |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Sets the verbosity of \fBAUTOMOC\fP, \fBAUTOUIC\fP and |
| \fBAUTORCC\fP\&. A positive integer value or a true boolean value |
| lets the \fBAUTO*\fP generators output additional processing information. |
| .sp |
| Setting \fI\%CMAKE_AUTOGEN_VERBOSE\fP has the same effect |
| as setting the \fBVERBOSE\fP environment variable during |
| generation (e.g. by calling \fBmake VERBOSE=1\fP). |
| The extra verbosity is limited to the \fBAUTO*\fP generators though. |
| .sp |
| By default \fI\%CMAKE_AUTOGEN_VERBOSE\fP is unset. |
| .SS CMAKE_AUTOMOC |
| .sp |
| Whether to handle \fBmoc\fP automatically for Qt targets. |
| .sp |
| This variable is used to initialize the \fBAUTOMOC\fP property on all the |
| targets. See that target property for additional information. |
| .SS CMAKE_AUTOMOC_COMPILER_PREDEFINES |
| .sp |
| New in version 3.10. |
| |
| .sp |
| This variable is used to initialize the \fBAUTOMOC_COMPILER_PREDEFINES\fP |
| property on all the targets. See that target property for additional |
| information. |
| .sp |
| By default it is ON. |
| .SS CMAKE_AUTOMOC_DEPEND_FILTERS |
| .sp |
| New in version 3.9. |
| |
| .sp |
| Filter definitions used by \fBCMAKE_AUTOMOC\fP |
| to extract file names from source code as additional dependencies |
| for the \fBmoc\fP file. |
| .sp |
| This variable is used to initialize the \fBAUTOMOC_DEPEND_FILTERS\fP |
| property on all the targets. See that target property for additional |
| information. |
| .sp |
| By default it is empty. |
| .SS CMAKE_AUTOMOC_MACRO_NAMES |
| .sp |
| New in version 3.10. |
| |
| .sp |
| Semicolon\-separated list list of macro names used by |
| \fBCMAKE_AUTOMOC\fP to determine if a C++ file needs to be |
| processed by \fBmoc\fP\&. |
| .sp |
| This variable is used to initialize the \fBAUTOMOC_MACRO_NAMES\fP |
| property on all the targets. See that target property for additional |
| information. |
| .sp |
| The default value is \fBQ_OBJECT;Q_GADGET;Q_NAMESPACE;Q_NAMESPACE_EXPORT\fP\&. |
| .SS Example |
| .sp |
| Let CMake know that source files that contain \fBCUSTOM_MACRO\fP must be \fBmoc\fP |
| processed as well: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_AUTOMOC ON) |
| list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "CUSTOM_MACRO") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_AUTOMOC_MOC_OPTIONS |
| .sp |
| Additional options for \fBmoc\fP when using \fBCMAKE_AUTOMOC\fP\&. |
| .sp |
| This variable is used to initialize the \fBAUTOMOC_MOC_OPTIONS\fP property |
| on all the targets. See that target property for additional information. |
| .SS CMAKE_AUTOMOC_PATH_PREFIX |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Whether to generate the \fB\-p\fP path prefix option for \fBmoc\fP on |
| \fBAUTOMOC\fP enabled Qt targets. |
| .sp |
| This variable is used to initialize the \fBAUTOMOC_PATH_PREFIX\fP |
| property on all the targets. See that target property for additional |
| information. |
| .sp |
| The default value is \fBOFF\fP\&. |
| .SS CMAKE_AUTORCC |
| .sp |
| Whether to handle \fBrcc\fP automatically for Qt targets. |
| .sp |
| This variable is used to initialize the \fBAUTORCC\fP property on all |
| the targets. See that target property for additional information. |
| .SS CMAKE_AUTORCC_OPTIONS |
| .sp |
| Additional options for \fBrcc\fP when using \fBCMAKE_AUTORCC\fP\&. |
| .sp |
| This variable is used to initialize the \fBAUTORCC_OPTIONS\fP property on |
| all the targets. See that target property for additional information. |
| .SS EXAMPLE |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| # ... |
| set(CMAKE_AUTORCC_OPTIONS "\-\-compress;9") |
| # ... |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_AUTOUIC |
| .sp |
| Whether to handle \fBuic\fP automatically for Qt targets. |
| .sp |
| This variable is used to initialize the \fBAUTOUIC\fP property on all |
| the targets. See that target property for additional information. |
| .SS CMAKE_AUTOUIC_OPTIONS |
| .sp |
| Additional options for \fBuic\fP when using \fBCMAKE_AUTOUIC\fP\&. |
| .sp |
| This variable is used to initialize the \fBAUTOUIC_OPTIONS\fP property on |
| all the targets. See that target property for additional information. |
| .SS EXAMPLE |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| # ... |
| set_property(CMAKE_AUTOUIC_OPTIONS "\-\-no\-protection") |
| # ... |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_AUTOUIC_SEARCH_PATHS |
| .sp |
| New in version 3.9. |
| |
| .sp |
| Search path list used by \fBCMAKE_AUTOUIC\fP to find included |
| \fB\&.ui\fP files. |
| .sp |
| This variable is used to initialize the \fBAUTOUIC_SEARCH_PATHS\fP |
| property on all the targets. See that target property for additional |
| information. |
| .sp |
| By default it is empty. |
| .SS CMAKE_BUILD_RPATH |
| .sp |
| New in version 3.8. |
| |
| .sp |
| Semicolon\-separated list specifying runtime path (\fBRPATH\fP) |
| entries to add to binaries linked in the build tree (for platforms that |
| support it). The entries will \fInot\fP be used for binaries in the install |
| tree. See also the \fBCMAKE_INSTALL_RPATH\fP variable. |
| .sp |
| This is used to initialize the \fBBUILD_RPATH\fP target property |
| for all targets. |
| .SS CMAKE_BUILD_RPATH_USE_ORIGIN |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Whether to use relative paths for the build \fBRPATH\fP\&. |
| .sp |
| This is used to initialize the \fBBUILD_RPATH_USE_ORIGIN\fP target |
| property for all targets, see that property for more details. |
| .SS CMAKE_BUILD_WITH_INSTALL_NAME_DIR |
| .sp |
| New in version 3.9. |
| |
| .sp |
| Whether to use \fBINSTALL_NAME_DIR\fP on targets in the build tree. |
| .sp |
| This variable is used to initialize the \fBBUILD_WITH_INSTALL_NAME_DIR\fP |
| property on all targets. |
| .SS CMAKE_BUILD_WITH_INSTALL_RPATH |
| .sp |
| Use the install path for the \fBRPATH\fP\&. |
| .sp |
| Normally CMake uses the build tree for the \fBRPATH\fP when building |
| executables etc on systems that use \fBRPATH\fP\&. When the software is |
| installed the executables etc are relinked by CMake to have the |
| install \fBRPATH\fP\&. If this variable is set to true then the software is |
| always built with the install path for the \fBRPATH\fP and does not need to |
| be relinked when installed. |
| .SS CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Output directory for MS debug symbol \fB\&.pdb\fP files |
| generated by the compiler while building source files. |
| .sp |
| This variable is used to initialize the |
| \fBCOMPILE_PDB_OUTPUT_DIRECTORY\fP property on all the targets. |
| .SS CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG> |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Per\-configuration output directory for MS debug symbol \fB\&.pdb\fP files |
| generated by the compiler while building source files. |
| .sp |
| This is a per\-configuration version of |
| \fBCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY\fP\&. |
| This variable is used to initialize the |
| \fBCOMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>\fP |
| property on all the targets. |
| .SS CMAKE_<CONFIG>_POSTFIX |
| .sp |
| Default filename postfix for libraries under configuration \fB<CONFIG>\fP\&. |
| .sp |
| When a non\-executable target is created its \fB<CONFIG>_POSTFIX\fP |
| target property is initialized with the value of this variable if it is set. |
| .SS CMAKE_CROSS_CONFIGS |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Specifies a semicolon\-separated list of |
| configurations available from all \fBbuild\-<Config>.ninja\fP files in the |
| \fBNinja Multi\-Config\fP generator. This variable activates |
| cross\-config mode. Targets from each config specified in this variable can be |
| built from any \fBbuild\-<Config>.ninja\fP file. Custom commands will use the |
| configuration native to \fBbuild\-<Config>.ninja\fP\&. If it is set to \fBall\fP, all |
| configurations from \fBCMAKE_CONFIGURATION_TYPES\fP are cross\-configs. If |
| it is not specified, or empty, each \fBbuild\-<Config>.ninja\fP file will only |
| contain build rules for its own configuration. |
| .sp |
| The value of this variable must be a subset of |
| \fBCMAKE_CONFIGURATION_TYPES\fP\&. |
| .SS CMAKE_CTEST_ARGUMENTS |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Set this to a semicolon\-separated list of |
| command\-line arguments to pass to \fBctest(1)\fP when running tests |
| through the \fBtest\fP (or \fBRUN_TESTS\fP) target of the generated build system. |
| .SS CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Default value for \fBCUDA_RESOLVE_DEVICE_SYMBOLS\fP target |
| property. This variable is used to initialize the property on each target as |
| it is created. |
| .SS CMAKE_CUDA_RUNTIME_LIBRARY |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Select the CUDA runtime library for use when compiling and linking CUDA. |
| This variable is used to initialize the \fBCUDA_RUNTIME_LIBRARY\fP |
| property on all targets as they are created. |
| .sp |
| The allowed case insensitive values are: |
| .INDENT 0.0 |
| .TP |
| .B \fBNone\fP |
| Link with \fB\-cudart=none\fP or equivalent flag(s) to use no CUDA |
| runtime library. |
| .TP |
| .B \fBShared\fP |
| Link with \fB\-cudart=shared\fP or equivalent flag(s) to use a |
| dynamically\-linked CUDA runtime library. |
| .TP |
| .B \fBStatic\fP |
| Link with \fB\-cudart=static\fP or equivalent flag(s) to use a |
| statically\-linked CUDA runtime library. |
| .UNINDENT |
| .sp |
| Contents of \fBCMAKE_CUDA_RUNTIME_LIBRARY\fP may use |
| \fBgenerator expressions\fP\&. |
| .sp |
| If this variable is not set then the \fBCUDA_RUNTIME_LIBRARY\fP target |
| property will not be set automatically. If that property is not set then |
| CMake uses an appropriate default value based on the compiler to select the |
| CUDA runtime library. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| This property has effect only when the \fBCUDA\fP language is enabled. To |
| control the CUDA runtime linking when only using the CUDA SDK with the |
| \fBC\fP or \fBC++\fP language we recommend using the \fBFindCUDAToolkit\fP |
| module. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_CUDA_SEPARABLE_COMPILATION |
| .sp |
| New in version 3.11. |
| |
| .sp |
| Default value for \fBCUDA_SEPARABLE_COMPILATION\fP target property. |
| This variable is used to initialize the property on each target as it is |
| created. |
| .SS CMAKE_DEBUG_POSTFIX |
| .sp |
| See variable \fBCMAKE_<CONFIG>_POSTFIX\fP\&. |
| .sp |
| This variable is a special case of the more\-general |
| \fBCMAKE_<CONFIG>_POSTFIX\fP variable for the \fIDEBUG\fP configuration. |
| .SS CMAKE_DEFAULT_BUILD_TYPE |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Specifies the configuration to use by default in a \fBbuild.ninja\fP file in the |
| \fBNinja Multi\-Config\fP generator. If this variable is specified, |
| \fBbuild.ninja\fP uses build rules from \fBbuild\-<Config>.ninja\fP by default. All |
| custom commands are executed with this configuration. If the variable is not |
| specified, the first item from \fBCMAKE_CONFIGURATION_TYPES\fP is used |
| instead. |
| .sp |
| The value of this variable must be one of the items from |
| \fBCMAKE_CONFIGURATION_TYPES\fP\&. |
| .SS CMAKE_DEFAULT_CONFIGS |
| .sp |
| New in version 3.17. |
| |
| .sp |
| Specifies a semicolon\-separated list of configurations |
| to build for a target in \fBbuild.ninja\fP if no \fB:<Config>\fP suffix is specified in |
| the \fBNinja Multi\-Config\fP generator. If it is set to \fBall\fP, all |
| configurations from \fBCMAKE_CROSS_CONFIGS\fP are used. If it is not |
| specified, it defaults to \fBCMAKE_DEFAULT_BUILD_TYPE\fP\&. |
| .sp |
| For example, if you set \fBCMAKE_DEFAULT_BUILD_TYPE\fP to \fBRelease\fP, |
| but set \fI\%CMAKE_DEFAULT_CONFIGS\fP to \fBDebug\fP or \fBall\fP, all |
| \fB<target>\fP aliases in \fBbuild.ninja\fP will resolve to \fB<target>:Debug\fP or |
| \fB<target>:all\fP, but custom commands will still use the \fBRelease\fP |
| configuration. |
| .sp |
| The value of this variable must be a subset of \fBCMAKE_CROSS_CONFIGS\fP |
| or be the same as \fBCMAKE_DEFAULT_BUILD_TYPE\fP\&. It must not be |
| specified if \fBCMAKE_DEFAULT_BUILD_TYPE\fP or |
| \fBCMAKE_CROSS_CONFIGS\fP is not used. |
| .SS CMAKE_DISABLE_PRECOMPILE_HEADERS |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Default value for \fBDISABLE_PRECOMPILE_HEADERS\fP of targets. |
| .sp |
| By default \fBCMAKE_DISABLE_PRECOMPILE_HEADERS\fP is \fBOFF\fP\&. |
| .SS CMAKE_DEPENDS_USE_COMPILER |
| .sp |
| New in version 3.20. |
| |
| .sp |
| For the Makefile Generators, source dependencies are now, for a |
| selection of compilers, generated by the compiler itself. By defining this |
| variable with value \fBFALSE\fP, you can restore the legacy behavior (i.e. using |
| \fBCMake\fP for dependencies discovery). |
| .SS CMAKE_ENABLE_EXPORTS |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Specify whether executables export symbols for loadable modules. |
| .sp |
| This variable is used to initialize the \fBENABLE_EXPORTS\fP target |
| property for executable targets when they are created by calls to the |
| \fBadd_executable()\fP command. See the property documentation for details. |
| .SS CMAKE_EXE_LINKER_FLAGS |
| .sp |
| Linker flags to be used to create executables. |
| .sp |
| These flags will be used by the linker when creating an executable. |
| .SS CMAKE_EXE_LINKER_FLAGS_<CONFIG> |
| .sp |
| Flags to be used when linking an executable. |
| .sp |
| Same as \fBCMAKE_C_FLAGS_*\fP but used by the linker when creating |
| executables. |
| .SS CMAKE_EXE_LINKER_FLAGS_<CONFIG>_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Value used to initialize the \fBCMAKE_EXE_LINKER_FLAGS_<CONFIG>\fP |
| cache entry the first time a build tree is configured. |
| This variable is meant to be set by a \fBtoolchain file\fP\&. CMake may prepend or append content to |
| the value based on the environment and target platform. |
| .sp |
| See also \fBCMAKE_EXE_LINKER_FLAGS_INIT\fP\&. |
| .SS CMAKE_EXE_LINKER_FLAGS_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Value used to initialize the \fBCMAKE_EXE_LINKER_FLAGS\fP |
| cache entry the first time a build tree is configured. |
| This variable is meant to be set by a \fBtoolchain file\fP\&. CMake may prepend or append content to |
| the value based on the environment and target platform. |
| .sp |
| See also the configuration\-specific variable |
| \fBCMAKE_EXE_LINKER_FLAGS_<CONFIG>_INIT\fP\&. |
| .SS CMAKE_FOLDER |
| .sp |
| New in version 3.12. |
| |
| .sp |
| Set the folder name. Use to organize targets in an IDE. |
| .sp |
| This variable is used to initialize the \fBFOLDER\fP property on all the |
| targets. See that target property for additional information. |
| .SS CMAKE_FRAMEWORK |
| .sp |
| New in version 3.15. |
| |
| .sp |
| Default value for \fBFRAMEWORK\fP of targets. |
| .sp |
| This variable is used to initialize the \fBFRAMEWORK\fP property on |
| all the targets. See that target property for additional information. |
| .SS CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG> |
| .sp |
| New in version 3.18. |
| |
| .sp |
| Default framework filename postfix under configuration \fB<CONFIG>\fP when |
| using a multi\-config generator. |
| .sp |
| When a framework target is created its \fBFRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>\fP |
| target property is initialized with the value of this variable if it is set. |
| .SS CMAKE_Fortran_FORMAT |
| .sp |
| Set to \fBFIXED\fP or \fBFREE\fP to indicate the Fortran source layout. |
| .sp |
| This variable is used to initialize the \fBFortran_FORMAT\fP property on |
| all the targets. See that target property for additional information. |
| .SS CMAKE_Fortran_MODULE_DIRECTORY |
| .sp |
| Fortran module output directory. |
| .sp |
| This variable is used to initialize the \fBFortran_MODULE_DIRECTORY\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_Fortran_PREPROCESS |
| .sp |
| New in version 3.18. |
| |
| .sp |
| Default value for \fBFortran_PREPROCESS\fP of targets. |
| .sp |
| This variable is used to initialize the \fBFortran_PREPROCESS\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_GHS_NO_SOURCE_GROUP_FILE |
| .sp |
| New in version 3.14. |
| |
| .sp |
| \fBON\fP / \fBOFF\fP boolean to control if the project file for a target should |
| be one single file or multiple files. Refer to |
| \fBGHS_NO_SOURCE_GROUP_FILE\fP for further details. |
| .SS CMAKE_GLOBAL_AUTOGEN_TARGET |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Switch to enable generation of a global \fBautogen\fP target. |
| .sp |
| When \fI\%CMAKE_GLOBAL_AUTOGEN_TARGET\fP is enabled, a custom target |
| \fBautogen\fP is generated. This target depends on all \fBAUTOMOC\fP and |
| \fBAUTOUIC\fP generated \fB<ORIGIN>_autogen\fP targets in the project. |
| By building the global \fBautogen\fP target, all \fBAUTOMOC\fP and |
| \fBAUTOUIC\fP files in the project will be generated. |
| .sp |
| The name of the global \fBautogen\fP target can be changed by setting |
| \fBCMAKE_GLOBAL_AUTOGEN_TARGET_NAME\fP\&. |
| .sp |
| By default \fI\%CMAKE_GLOBAL_AUTOGEN_TARGET\fP is unset. |
| .sp |
| See the \fBcmake\-qt(7)\fP manual for more information on using CMake |
| with Qt. |
| .SS Note |
| .sp |
| \fB<ORIGIN>_autogen\fP targets by default inherit their origin target\(aqs |
| dependencies. This might result in unintended dependency target |
| builds when only \fB<ORIGIN>_autogen\fP targets are built. A solution is to |
| disable \fBAUTOGEN_ORIGIN_DEPENDS\fP on the respective origin targets. |
| .SS CMAKE_GLOBAL_AUTOGEN_TARGET_NAME |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Change the name of the global \fBautogen\fP target. |
| .sp |
| When \fBCMAKE_GLOBAL_AUTOGEN_TARGET\fP is enabled, a global custom target |
| named \fBautogen\fP is created. \fI\%CMAKE_GLOBAL_AUTOGEN_TARGET_NAME\fP |
| allows to set a different name for that target. |
| .sp |
| By default \fI\%CMAKE_GLOBAL_AUTOGEN_TARGET_NAME\fP is unset. |
| .sp |
| See the \fBcmake\-qt(7)\fP manual for more information on using CMake |
| with Qt. |
| .SS CMAKE_GLOBAL_AUTORCC_TARGET |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Switch to enable generation of a global \fBautorcc\fP target. |
| .sp |
| When \fI\%CMAKE_GLOBAL_AUTORCC_TARGET\fP is enabled, a custom target |
| \fBautorcc\fP is generated. This target depends on all \fBAUTORCC\fP |
| generated \fB<ORIGIN>_arcc_<QRC>\fP targets in the project. |
| By building the global \fBautorcc\fP target, all \fBAUTORCC\fP |
| files in the project will be generated. |
| .sp |
| The name of the global \fBautorcc\fP target can be changed by setting |
| \fBCMAKE_GLOBAL_AUTORCC_TARGET_NAME\fP\&. |
| .sp |
| By default \fI\%CMAKE_GLOBAL_AUTORCC_TARGET\fP is unset. |
| .sp |
| See the \fBcmake\-qt(7)\fP manual for more information on using CMake |
| with Qt. |
| .SS CMAKE_GLOBAL_AUTORCC_TARGET_NAME |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Change the name of the global \fBautorcc\fP target. |
| .sp |
| When \fBCMAKE_GLOBAL_AUTORCC_TARGET\fP is enabled, a global custom target |
| named \fBautorcc\fP is created. \fI\%CMAKE_GLOBAL_AUTORCC_TARGET_NAME\fP |
| allows to set a different name for that target. |
| .sp |
| By default \fBCMAKE_GLOBAL_AUTOGEN_TARGET_NAME\fP is unset. |
| .sp |
| See the \fBcmake\-qt(7)\fP manual for more information on using CMake |
| with Qt. |
| .SS CMAKE_GNUtoMS |
| .sp |
| Convert GNU import libraries (\fB\&.dll.a\fP) to MS format (\fB\&.lib\fP). |
| .sp |
| This variable is used to initialize the \fBGNUtoMS\fP property on |
| targets when they are created. See that target property for additional |
| information. |
| .SS CMAKE_INCLUDE_CURRENT_DIR |
| .sp |
| Automatically add the current source and build directories to the include path. |
| .sp |
| If this variable is enabled, CMake automatically adds |
| \fBCMAKE_CURRENT_SOURCE_DIR\fP and \fBCMAKE_CURRENT_BINARY_DIR\fP |
| 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. |
| .sp |
| By default \fBCMAKE_INCLUDE_CURRENT_DIR\fP is \fBOFF\fP\&. |
| .SS CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE |
| .sp |
| Automatically add the current source and build directories to the |
| \fBINTERFACE_INCLUDE_DIRECTORIES\fP target property. |
| .sp |
| If this variable is enabled, CMake automatically adds for each shared |
| library target, static library target, module target and executable |
| target, \fBCMAKE_CURRENT_SOURCE_DIR\fP and |
| \fBCMAKE_CURRENT_BINARY_DIR\fP to |
| the \fBINTERFACE_INCLUDE_DIRECTORIES\fP target property. By default |
| \fBCMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE\fP is \fBOFF\fP\&. |
| .SS CMAKE_INSTALL_NAME_DIR |
| .sp |
| Directory name for installed targets on Apple platforms. |
| .sp |
| \fBCMAKE_INSTALL_NAME_DIR\fP is used to initialize the |
| \fBINSTALL_NAME_DIR\fP property on all targets. See that target |
| property for more information. |
| .SS CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Sets the default for whether toolchain\-defined rpaths should be removed during |
| installation. |
| .sp |
| \fBCMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH\fP is a boolean that provides the |
| default value for the \fBINSTALL_REMOVE_ENVIRONMENT_RPATH\fP property |
| of all subsequently created targets. |
| .SS CMAKE_INSTALL_RPATH |
| .sp |
| The rpath to use for installed targets. |
| .sp |
| 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 \fBINSTALL_RPATH\fP for all targets. |
| .SS CMAKE_INSTALL_RPATH_USE_LINK_PATH |
| .sp |
| Add paths to linker search and installed rpath. |
| .sp |
| \fBCMAKE_INSTALL_RPATH_USE_LINK_PATH\fP is a boolean that if set to \fBTrue\fP |
| will append to the runtime search path (rpath) of installed binaries |
| any directories outside the project that are in the linker search path or |
| contain linked library files. The directories are appended after the |
| value of the \fBINSTALL_RPATH\fP target property. |
| .sp |
| This variable is used to initialize the target property |
| \fBINSTALL_RPATH_USE_LINK_PATH\fP for all targets. |
| .SS CMAKE_INTERPROCEDURAL_OPTIMIZATION |
| .sp |
| New in version 3.9. |
| |
| .sp |
| Default value for \fBINTERPROCEDURAL_OPTIMIZATION\fP of targets. |
| .sp |
| This variable is used to initialize the \fBINTERPROCEDURAL_OPTIMIZATION\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG> |
| .sp |
| New in version 3.9. |
| |
| .sp |
| Default value for \fBINTERPROCEDURAL_OPTIMIZATION_<CONFIG>\fP of targets. |
| .sp |
| This variable is used to initialize the \fBINTERPROCEDURAL_OPTIMIZATION_<CONFIG>\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_IOS_INSTALL_COMBINED |
| .sp |
| New in version 3.5. |
| |
| .sp |
| Default value for \fBIOS_INSTALL_COMBINED\fP of targets. |
| .sp |
| This variable is used to initialize the \fBIOS_INSTALL_COMBINED\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_<LANG>_CLANG_TIDY |
| .sp |
| New in version 3.6. |
| |
| .sp |
| Default value for \fB<LANG>_CLANG_TIDY\fP target property |
| when \fB<LANG>\fP is \fBC\fP, \fBCXX\fP, \fBOBJC\fP or \fBOBJCXX\fP\&. |
| .sp |
| This variable is used to initialize the property on each target as it is |
| created. For example: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_CXX_CLANG_TIDY clang\-tidy \-checks=\-*,readability\-*) |
| add_executable(foo foo.cxx) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_<LANG>_COMPILER_LAUNCHER |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for \fB<LANG>_COMPILER_LAUNCHER\fP target property. |
| This variable is used to initialize the property on each target as it is |
| created. This is done only when \fB<LANG>\fP is \fBC\fP, \fBCXX\fP, \fBFortran\fP, |
| \fBHIP\fP, \fBISPC\fP, \fBOBJC\fP, \fBOBJCXX\fP, or \fBCUDA\fP\&. |
| .sp |
| This variable is initialized to the \fBCMAKE_<LANG>_COMPILER_LAUNCHER\fP |
| environment variable if it is set. |
| .SS CMAKE_<LANG>_CPPCHECK |
| .sp |
| New in version 3.10. |
| |
| .sp |
| Default value for \fB<LANG>_CPPCHECK\fP target property. This variable |
| is used to initialize the property on each target as it is created. This |
| is done only when \fB<LANG>\fP is \fBC\fP or \fBCXX\fP\&. |
| .SS CMAKE_<LANG>_CPPLINT |
| .sp |
| New in version 3.8. |
| |
| .sp |
| Default value for \fB<LANG>_CPPLINT\fP target property. This variable |
| is used to initialize the property on each target as it is created. This |
| is done only when \fB<LANG>\fP is \fBC\fP or \fBCXX\fP\&. |
| .SS CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE |
| .sp |
| New in version 3.3. |
| |
| .sp |
| Default value for \fB<LANG>_INCLUDE_WHAT_YOU_USE\fP target property. |
| This variable is used to initialize the property on each target as it is |
| created. This is done only when \fB<LANG>\fP is \fBC\fP or \fBCXX\fP\&. |
| .SS CMAKE_<LANG>_LINKER_LAUNCHER |
| .sp |
| New in version 3.21. |
| |
| .sp |
| Default value for \fB<LANG>_LINKER_LAUNCHER\fP target property. This |
| variable is used to initialize the property on each target as it is created. |
| This is done only when \fB<LANG>\fP is \fBC\fP, \fBCXX\fP, \fBOBJC\fP, or \fBOBJCXX\fP\&. |
| .sp |
| This variable is initialized to the \fBCMAKE_<LANG>_LINKER_LAUNCHER\fP |
| environment variable if it is set. |
| .SS CMAKE_<LANG>_LINK_LIBRARY_FILE_FLAG |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Language\-specific flag to be used to link a library specified by |
| a path to its file. |
| .sp |
| The flag will be used before a library file path is given to the |
| linker. This is needed only on very few platforms. |
| .SS CMAKE_<LANG>_LINK_LIBRARY_FLAG |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Flag to be used to link a library into a shared library or executable. |
| .sp |
| This flag will be used to specify a library to link to a shared library or an |
| executable for the specific language. On most compilers this is \fB\-l\fP\&. |
| .SS CMAKE_<LANG>_LINK_WHAT_YOU_USE_FLAG |
| .sp |
| New in version 3.22. |
| |
| .sp |
| Linker flag to be used to configure linker so that all specified libraries on |
| the command line will be linked into the target. |
| .sp |
| See also variable \fBCMAKE_LINK_WHAT_YOU_USE_CHECK\fP\&. |
| .SS CMAKE_<LANG>_VISIBILITY_PRESET |
| .sp |
| Default value for the \fB<LANG>_VISIBILITY_PRESET\fP target |
| property when a target is created. |
| .SS CMAKE_LIBRARY_OUTPUT_DIRECTORY |
| .sp |
| Where to put all the LIBRARY |
| target files when built. |
| .sp |
| This variable is used to initialize the \fBLIBRARY_OUTPUT_DIRECTORY\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG> |
| .sp |
| New in version 3.3. |
| |
| .sp |
| Where to put all the LIBRARY |
| target files when built for a specific configuration. |
| .sp |
| This variable is used to initialize the |
| \fBLIBRARY_OUTPUT_DIRECTORY_<CONFIG>\fP property on all the targets. |
| See that target property for additional information. |
| .SS CMAKE_LIBRARY_PATH_FLAG |
| .sp |
| The flag to be used to add a library search path to a compiler. |
| .sp |
| The flag will be used to specify a library directory to the compiler. |
| On most compilers this is \fB\-L\fP\&. |
| .SS CMAKE_LINK_DEF_FILE_FLAG |
| .sp |
| Linker flag to be used to specify a \fB\&.def\fP file for dll creation. |
| .sp |
| The flag will be used to add a \fB\&.def\fP file when creating a dll on |
| Windows; this is only defined on Windows. |
| .SS CMAKE_LINK_DEPENDS_NO_SHARED |
| .sp |
| Whether to skip link dependencies on shared library files. |
| .sp |
| This variable initializes the \fBLINK_DEPENDS_NO_SHARED\fP property on |
| targets when they are created. See that target property for |
| additional information. |
| .SS CMAKE_LINK_INTERFACE_LIBRARIES |
| .sp |
| Default value for \fBLINK_INTERFACE_LIBRARIES\fP of targets. |
| .sp |
| This variable is used to initialize the \fBLINK_INTERFACE_LIBRARIES\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_LINK_LIBRARY_FILE_FLAG |
| .sp |
| Flag to be used to link a library specified by a path to its file. |
| .sp |
| The flag will be used before a library file path is given to the |
| linker. This is needed only on very few platforms. |
| .SS CMAKE_LINK_LIBRARY_FLAG |
| .sp |
| Flag to be used to link a library into an executable. |
| .sp |
| The flag will be used to specify a library to link to an executable. |
| On most compilers this is \fB\-l\fP\&. |
| .SS CMAKE_LINK_WHAT_YOU_USE |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Default value for \fBLINK_WHAT_YOU_USE\fP target property. |
| This variable is used to initialize the property on each target as it is |
| created. |
| .SS CMAKE_LINK_WHAT_YOU_USE_CHECK |
| .sp |
| New in version 3.22. |
| |
| .sp |
| Defines the command executed after the link step to check libraries usage. |
| This check is currently only defined on \fBELF\fP platforms with value |
| \fBldd \-u \-r\fP\&. |
| .sp |
| See also \fBCMAKE_<LANG>_LINK_WHAT_YOU_USE_FLAG\fP variables. |
| .SS CMAKE_MACOSX_BUNDLE |
| .sp |
| Default value for \fBMACOSX_BUNDLE\fP of targets. |
| .sp |
| This variable is used to initialize the \fBMACOSX_BUNDLE\fP property on |
| all the targets. See that target property for additional information. |
| .sp |
| This variable is set to \fBON\fP by default if \fBCMAKE_SYSTEM_NAME\fP |
| equals to iOS, tvOS or watchOS\&. |
| .SS CMAKE_MACOSX_RPATH |
| .sp |
| Whether to use rpaths on macOS and iOS. |
| .sp |
| This variable is used to initialize the \fBMACOSX_RPATH\fP property on |
| all targets. |
| .SS CMAKE_MAP_IMPORTED_CONFIG_<CONFIG> |
| .sp |
| Default value for \fBMAP_IMPORTED_CONFIG_<CONFIG>\fP of targets. |
| .sp |
| This variable is used to initialize the |
| \fBMAP_IMPORTED_CONFIG_<CONFIG>\fP property on all the targets. See |
| that target property for additional information. |
| .SS CMAKE_MODULE_LINKER_FLAGS |
| .sp |
| Linker flags to be used to create modules. |
| .sp |
| These flags will be used by the linker when creating a module. |
| .SS CMAKE_MODULE_LINKER_FLAGS_<CONFIG> |
| .sp |
| Flags to be used when linking a module. |
| .sp |
| Same as \fBCMAKE_C_FLAGS_*\fP but used by the linker when creating modules. |
| .SS CMAKE_MODULE_LINKER_FLAGS_<CONFIG>_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Value used to initialize the \fBCMAKE_MODULE_LINKER_FLAGS_<CONFIG>\fP |
| cache entry the first time a build tree is configured. |
| This variable is meant to be set by a \fBtoolchain file\fP\&. CMake may prepend or append content to |
| the value based on the environment and target platform. |
| .sp |
| See also \fBCMAKE_MODULE_LINKER_FLAGS_INIT\fP\&. |
| .SS CMAKE_MODULE_LINKER_FLAGS_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Value used to initialize the \fBCMAKE_MODULE_LINKER_FLAGS\fP |
| cache entry the first time a build tree is configured. |
| This variable is meant to be set by a \fBtoolchain file\fP\&. CMake may prepend or append content to |
| the value based on the environment and target platform. |
| .sp |
| See also the configuration\-specific variable |
| \fBCMAKE_MODULE_LINKER_FLAGS_<CONFIG>_INIT\fP\&. |
| .SS CMAKE_MSVCIDE_RUN_PATH |
| .sp |
| New in version 3.10. |
| |
| .sp |
| Extra PATH locations that should be used when executing |
| \fBadd_custom_command()\fP or \fBadd_custom_target()\fP when using the |
| \fBVisual Studio 9 2008\fP (or above) generator. This allows |
| for running commands and using dll\(aqs that the IDE environment is not aware of. |
| .sp |
| If not set explicitly the value is initialized by the \fBCMAKE_MSVCIDE_RUN_PATH\fP |
| environment variable, if set, and otherwise left empty. |
| .SS CMAKE_MSVC_RUNTIME_LIBRARY |
| .sp |
| New in version 3.15. |
| |
| .sp |
| Select the MSVC runtime library for use by compilers targeting the MSVC ABI. |
| This variable is used to initialize the \fBMSVC_RUNTIME_LIBRARY\fP |
| property on all targets as they are created. It is also propagated by |
| calls to the \fBtry_compile()\fP command into the test project. |
| .sp |
| The allowed values are: |
| .INDENT 0.0 |
| .TP |
| .B \fBMultiThreaded\fP |
| Compile with \fB\-MT\fP or equivalent flag(s) to use a multi\-threaded |
| statically\-linked runtime library. |
| .TP |
| .B \fBMultiThreadedDLL\fP |
| Compile with \fB\-MD\fP or equivalent flag(s) to use a multi\-threaded |
| dynamically\-linked runtime library. |
| .TP |
| .B \fBMultiThreadedDebug\fP |
| Compile with \fB\-MTd\fP or equivalent flag(s) to use a multi\-threaded |
| statically\-linked runtime library. |
| .TP |
| .B \fBMultiThreadedDebugDLL\fP |
| Compile with \fB\-MDd\fP or equivalent flag(s) to use a multi\-threaded |
| dynamically\-linked runtime library. |
| .UNINDENT |
| .sp |
| The value is ignored on non\-MSVC compilers but an unsupported value will |
| be rejected as an error when using a compiler targeting the MSVC ABI. |
| .sp |
| The value may also be the empty string (\fB""\fP) in which case no runtime |
| library selection flag will be added explicitly by CMake. Note that with |
| Visual Studio Generators the native build system may choose to |
| add its own default runtime library selection flag. |
| .sp |
| Use \fBgenerator expressions\fP to |
| support per\-configuration specification. For example, the code: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| selects for all following targets a multi\-threaded statically\-linked runtime |
| library with or without debug information depending on the configuration. |
| .sp |
| If this variable is not set then the \fBMSVC_RUNTIME_LIBRARY\fP target |
| property will not be set automatically. If that property is not set then |
| CMake uses the default value \fBMultiThreaded$<$<CONFIG:Debug>:Debug>DLL\fP |
| to select a MSVC runtime library. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| This variable has effect only when policy \fBCMP0091\fP is set to \fBNEW\fP |
| prior to the first \fBproject()\fP or \fBenable_language()\fP command |
| that enables a language using a compiler targeting the MSVC ABI. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_NINJA_OUTPUT_PATH_PREFIX |
| .sp |
| New in version 3.6. |
| |
| .sp |
| Set output files path prefix for the \fBNinja\fP generator. |
| .sp |
| Every output files listed in the generated \fBbuild.ninja\fP 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 \fBsubninja\fP file into a \fIsuper\fP ninja |
| project. For example, a ninja build file generated with a command |
| like: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| cd top\-build\-dir/sub && |
| cmake \-G Ninja \-DCMAKE_NINJA_OUTPUT_PATH_PREFIX=sub/ path/to/source |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| can be embedded in \fBtop\-build\-dir/build.ninja\fP with a directive like |
| this: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| subninja sub/build.ninja |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The \fBauto\-regeneration\fP rule in \fBtop\-build\-dir/build.ninja\fP must have an |
| order\-only dependency on \fBsub/build.ninja\fP\&. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| When \fBCMAKE_NINJA_OUTPUT_PATH_PREFIX\fP is set, the project generated |
| by CMake cannot be used as a standalone project. No default targets |
| are specified. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_NO_BUILTIN_CHRPATH |
| .sp |
| Do not use the builtin binary editor to fix runtime library search |
| paths on installation. |
| .sp |
| When an ELF or XCOFF binary needs to have a different runtime library |
| search path after installation than it does in the build tree, CMake uses |
| a builtin editor to change the runtime search path 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. |
| .sp |
| New in version 3.20: This variable also applies to XCOFF binaries\(aq LIBPATH. Prior to the |
| addition of the XCOFF editor in CMake 3.20, this variable applied only |
| to ELF binaries\(aq RPATH/RUNPATH. |
| |
| .SS CMAKE_NO_SYSTEM_FROM_IMPORTED |
| .sp |
| Default value for \fBNO_SYSTEM_FROM_IMPORTED\fP of targets. |
| .sp |
| This variable is used to initialize the \fBNO_SYSTEM_FROM_IMPORTED\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_OPTIMIZE_DEPENDENCIES |
| .sp |
| New in version 3.19. |
| |
| .sp |
| Initializes the \fBOPTIMIZE_DEPENDENCIES\fP target property. |
| .SS CMAKE_OSX_ARCHITECTURES |
| .sp |
| Target specific architectures for macOS and iOS. |
| .sp |
| This variable is used to initialize the \fBOSX_ARCHITECTURES\fP |
| property on each target as it is created. See that target property |
| for additional information. |
| .sp |
| The value of this variable should be set prior to the first |
| \fBproject()\fP or \fBenable_language()\fP 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 should be set as a \fBCACHE\fP entry (or else CMake may |
| remove it while initializing a cache entry of the same name). |
| .sp |
| Despite the \fBOSX\fP part in the variable name(s) they apply also to |
| other SDKs than macOS like iOS, tvOS, or watchOS. |
| .sp |
| This variable is ignored on platforms other than Apple. |
| .SS CMAKE_OSX_DEPLOYMENT_TARGET |
| .sp |
| Specify the minimum version of the target platform (e.g. macOS or iOS) |
| on which the target binaries are to be deployed. CMake uses this |
| variable value for the \fB\-mmacosx\-version\-min\fP flag or their respective |
| target platform equivalents. For older Xcode versions that shipped |
| multiple macOS SDKs this variable also helps to choose the SDK in case |
| \fBCMAKE_OSX_SYSROOT\fP is unset. |
| .sp |
| If not set explicitly the value is initialized by the |
| \fBMACOSX_DEPLOYMENT_TARGET\fP environment variable, if set, |
| and otherwise computed based on the host platform. |
| .sp |
| The value of this variable should be set prior to the first |
| \fBproject()\fP or \fBenable_language()\fP 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 should be set as a \fBCACHE\fP entry (or else CMake may |
| remove it while initializing a cache entry of the same name). |
| .sp |
| Despite the \fBOSX\fP part in the variable name(s) they apply also to |
| other SDKs than macOS like iOS, tvOS, or watchOS. |
| .sp |
| This variable is ignored on platforms other than Apple. |
| .SS CMAKE_OSX_SYSROOT |
| .sp |
| Specify the location or name of the macOS platform SDK to be used. |
| CMake uses this value to compute the value of the \fB\-isysroot\fP flag |
| or equivalent and to help the \fBfind_*\fP commands locate files in |
| the SDK. |
| .sp |
| If not set explicitly the value is initialized by the \fBSDKROOT\fP |
| environment variable, if set, and otherwise computed based on the |
| \fBCMAKE_OSX_DEPLOYMENT_TARGET\fP or the host platform. |
| .sp |
| The value of this variable should be set prior to the first |
| \fBproject()\fP or \fBenable_language()\fP 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 should be set as a \fBCACHE\fP entry (or else CMake may |
| remove it while initializing a cache entry of the same name). |
| .sp |
| Despite the \fBOSX\fP part in the variable name(s) they apply also to |
| other SDKs than macOS like iOS, tvOS, or watchOS. |
| .sp |
| This variable is ignored on platforms other than Apple. |
| .SS CMAKE_PCH_WARN_INVALID |
| .sp |
| New in version 3.18. |
| |
| .sp |
| This variable is used to initialize the \fBPCH_WARN_INVALID\fP |
| property of targets when they are created. |
| .SS CMAKE_PCH_INSTANTIATE_TEMPLATES |
| .sp |
| New in version 3.19. |
| |
| .sp |
| This variable is used to initialize the \fBPCH_INSTANTIATE_TEMPLATES\fP |
| property of targets when they are created. |
| .SS CMAKE_PDB_OUTPUT_DIRECTORY |
| .sp |
| Output directory for MS debug symbol \fB\&.pdb\fP files generated by the |
| linker for executable and shared library targets. |
| .sp |
| This variable is used to initialize the \fBPDB_OUTPUT_DIRECTORY\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG> |
| .sp |
| Per\-configuration output directory for MS debug symbol \fB\&.pdb\fP files |
| generated by the linker for executable and shared library targets. |
| .sp |
| This is a per\-configuration version of \fBCMAKE_PDB_OUTPUT_DIRECTORY\fP\&. |
| This variable is used to initialize the |
| \fBPDB_OUTPUT_DIRECTORY_<CONFIG>\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_PLATFORM_NO_VERSIONED_SONAME |
| .sp |
| New in version 3.1. |
| |
| .sp |
| This variable is used to globally control whether the |
| \fBVERSION\fP and \fBSOVERSION\fP target |
| properties should be used for shared libraries. |
| When set to true, adding version information to each |
| shared library target is disabled. |
| .sp |
| By default this variable is set only on platforms where |
| CMake knows it is needed. On other platforms, the |
| specified properties will be used for shared libraries. |
| .SS CMAKE_POSITION_INDEPENDENT_CODE |
| .sp |
| Default value for \fBPOSITION_INDEPENDENT_CODE\fP of targets. |
| .sp |
| This variable is used to initialize the |
| \fBPOSITION_INDEPENDENT_CODE\fP property on all the targets. |
| See that target property for additional information. If set, its |
| value is also used by the \fBtry_compile()\fP command. |
| .SS CMAKE_RUNTIME_OUTPUT_DIRECTORY |
| .sp |
| Where to put all the RUNTIME |
| target files when built. |
| .sp |
| This variable is used to initialize the \fBRUNTIME_OUTPUT_DIRECTORY\fP |
| property on all the targets. See that target property for additional |
| information. |
| .SS CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG> |
| .sp |
| New in version 3.3. |
| |
| .sp |
| Where to put all the RUNTIME |
| target files when built for a specific configuration. |
| .sp |
| This variable is used to initialize the |
| \fBRUNTIME_OUTPUT_DIRECTORY_<CONFIG>\fP property on all the targets. |
| See that target property for additional information. |
| .SS CMAKE_SHARED_LINKER_FLAGS |
| .sp |
| Linker flags to be used to create shared libraries. |
| .sp |
| These flags will be used by the linker when creating a shared library. |
| .SS CMAKE_SHARED_LINKER_FLAGS_<CONFIG> |
| .sp |
| Flags to be used when linking a shared library. |
| .sp |
| Same as \fBCMAKE_C_FLAGS_*\fP but used by the linker when creating shared |
| libraries. |
| .SS CMAKE_SHARED_LINKER_FLAGS_<CONFIG>_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Value used to initialize the \fBCMAKE_SHARED_LINKER_FLAGS_<CONFIG>\fP |
| cache entry the first time a build tree is configured. |
| This variable is meant to be set by a \fBtoolchain file\fP\&. CMake may prepend or append content to |
| the value based on the environment and target platform. |
| .sp |
| See also \fBCMAKE_SHARED_LINKER_FLAGS_INIT\fP\&. |
| .SS CMAKE_SHARED_LINKER_FLAGS_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Value used to initialize the \fBCMAKE_SHARED_LINKER_FLAGS\fP |
| cache entry the first time a build tree is configured. |
| This variable is meant to be set by a \fBtoolchain file\fP\&. CMake may prepend or append content to |
| the value based on the environment and target platform. |
| .sp |
| See also the configuration\-specific variable |
| \fBCMAKE_SHARED_LINKER_FLAGS_<CONFIG>_INIT\fP\&. |
| .SS CMAKE_SKIP_BUILD_RPATH |
| .sp |
| Do not include RPATHs in the build tree. |
| .sp |
| 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. |
| .SS CMAKE_SKIP_INSTALL_RPATH |
| .sp |
| Do not include RPATHs in the install tree. |
| .sp |
| 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 |
| \fBCMAKE_SKIP_RPATH\fP instead. |
| .SS CMAKE_STATIC_LINKER_FLAGS |
| .sp |
| Flags to be used to create static libraries. These flags will be passed |
| to the archiver when creating a static library. |
| .sp |
| See also \fBCMAKE_STATIC_LINKER_FLAGS_<CONFIG>\fP\&. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| Static libraries do not actually link. They are essentially archives |
| of object files. The use of the name "linker" in the name of this |
| variable is kept for compatibility. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_STATIC_LINKER_FLAGS_<CONFIG> |
| .sp |
| Flags to be used to create static libraries. These flags will be passed |
| to the archiver when creating a static library in the \fB<CONFIG>\fP |
| configuration. |
| .sp |
| See also \fBCMAKE_STATIC_LINKER_FLAGS\fP\&. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| Static libraries do not actually link. They are essentially archives |
| of object files. The use of the name "linker" in the name of this |
| variable is kept for compatibility. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_STATIC_LINKER_FLAGS_<CONFIG>_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Value used to initialize the \fBCMAKE_STATIC_LINKER_FLAGS_<CONFIG>\fP |
| cache entry the first time a build tree is configured. |
| This variable is meant to be set by a \fBtoolchain file\fP\&. CMake may prepend or append content to |
| the value based on the environment and target platform. |
| .sp |
| See also \fBCMAKE_STATIC_LINKER_FLAGS_INIT\fP\&. |
| .SS CMAKE_STATIC_LINKER_FLAGS_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Value used to initialize the \fBCMAKE_STATIC_LINKER_FLAGS\fP |
| cache entry the first time a build tree is configured. |
| This variable is meant to be set by a \fBtoolchain file\fP\&. CMake may prepend or append content to |
| the value based on the environment and target platform. |
| .sp |
| See also the configuration\-specific variable |
| \fBCMAKE_STATIC_LINKER_FLAGS_<CONFIG>_INIT\fP\&. |
| .SS CMAKE_TRY_COMPILE_CONFIGURATION |
| .sp |
| Build configuration used for \fBtry_compile()\fP and \fBtry_run()\fP |
| projects. |
| .sp |
| Projects built by \fBtry_compile()\fP and \fBtry_run()\fP 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. |
| .SS CMAKE_TRY_COMPILE_PLATFORM_VARIABLES |
| .sp |
| New in version 3.6. |
| |
| .sp |
| List of variables that the \fBtry_compile()\fP command source file signature |
| must propagate into the test project in order to target the same platform as |
| the host project. |
| .sp |
| This variable should not be set by project code. It is meant to be set by |
| CMake\(aqs platform information modules for the current toolchain, or by a |
| toolchain file when used with \fBCMAKE_TOOLCHAIN_FILE\fP\&. |
| .sp |
| Variables meaningful to CMake, such as \fBCMAKE_<LANG>_FLAGS\fP, are |
| propagated automatically. The \fBCMAKE_TRY_COMPILE_PLATFORM_VARIABLES\fP |
| variable may be set to pass custom variables meaningful to a toolchain file. |
| For example, a toolchain file may contain: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_SYSTEM_NAME ...) |
| set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES MY_CUSTOM_VARIABLE) |
| # ... use MY_CUSTOM_VARIABLE ... |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| If a user passes \fB\-DMY_CUSTOM_VARIABLE=SomeValue\fP 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 \fBtry_compile()\fP |
| command source file signature. |
| .SS CMAKE_TRY_COMPILE_TARGET_TYPE |
| .sp |
| New in version 3.6. |
| |
| .sp |
| Type of target generated for \fBtry_compile()\fP calls using the |
| source file signature. Valid values are: |
| .INDENT 0.0 |
| .TP |
| .B \fBEXECUTABLE\fP |
| Use \fBadd_executable()\fP to name the source file in the |
| generated project. This is the default if no value is given. |
| .TP |
| .B \fBSTATIC_LIBRARY\fP |
| Use \fBadd_library()\fP with the \fBSTATIC\fP 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. |
| .UNINDENT |
| .SS CMAKE_UNITY_BUILD |
| .sp |
| New in version 3.16. |
| |
| .sp |
| This variable is used to initialize the \fBUNITY_BUILD\fP |
| property of targets when they are created. Setting it to true |
| enables batch compilation of multiple sources within each target. |
| This feature is known as a \fIUnity\fP or \fIJumbo\fP build. |
| .sp |
| Projects should not set this variable, it is intended as a developer |
| control to be set on the \fBcmake(1)\fP command line or other |
| equivalent methods. The developer must have the ability to enable or |
| disable unity builds according to the capabilities of their own machine |
| and compiler. |
| .sp |
| By default, this variable is not set, which will result in unity builds |
| being disabled. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| This option currently does not work well in combination with |
| the \fBCMAKE_EXPORT_COMPILE_COMMANDS\fP variable. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_UNITY_BUILD_BATCH_SIZE |
| .sp |
| New in version 3.16. |
| |
| .sp |
| This variable is used to initialize the \fBUNITY_BUILD_BATCH_SIZE\fP |
| property of targets when they are created. It specifies the default upper |
| limit on the number of source files that may be combined in any one unity |
| source file when unity builds are enabled for a target. |
| .SS CMAKE_UNITY_BUILD_UNIQUE_ID |
| .sp |
| New in version 3.20. |
| |
| .sp |
| This variable is used to initialize the \fBUNITY_BUILD_UNIQUE_ID\fP |
| property of targets when they are created. It specifies the name of the |
| unique identifier generated per file in a unity build. |
| .SS CMAKE_USE_RELATIVE_PATHS |
| .sp |
| This variable has no effect. The partially implemented effect it |
| had in previous releases was removed in CMake 3.4. |
| .SS CMAKE_VISIBILITY_INLINES_HIDDEN |
| .sp |
| Default value for the \fBVISIBILITY_INLINES_HIDDEN\fP target |
| property when a target is created. |
| .SS CMAKE_VS_GLOBALS |
| .sp |
| New in version 3.13. |
| |
| .sp |
| List of \fBKey=Value\fP records to be set per target as target properties |
| \fBVS_GLOBAL_<variable>\fP with \fBvariable=Key\fP and value \fBValue\fP\&. |
| .sp |
| For example: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CMAKE_VS_GLOBALS |
| "DefaultLanguage=en\-US" |
| "MinimumVisualStudioVersion=14.0" |
| ) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| will set properties \fBVS_GLOBAL_DefaultLanguage\fP to \fBen\-US\fP and |
| \fBVS_GLOBAL_MinimumVisualStudioVersion\fP to \fB14.0\fP for all targets |
| (except for \fBINTERFACE\fP libraries). |
| .sp |
| This variable is meant to be set by a |
| \fBtoolchain file\fP\&. |
| .SS CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD |
| .sp |
| New in version 3.3. |
| |
| .sp |
| Include \fBINSTALL\fP target to default build. |
| .sp |
| In Visual Studio solution, by default the \fBINSTALL\fP target will not be part |
| of the default build. Setting this variable will enable the \fBINSTALL\fP target |
| to be part of the default build. |
| .SS CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD |
| .sp |
| New in version 3.8. |
| |
| .sp |
| Include \fBPACKAGE\fP target to default build. |
| .sp |
| In Visual Studio solution, by default the \fBPACKAGE\fP target will not be part |
| of the default build. Setting this variable will enable the \fBPACKAGE\fP target |
| to be part of the default build. |
| .SS CMAKE_VS_JUST_MY_CODE_DEBUGGING |
| .sp |
| New in version 3.15. |
| |
| .sp |
| Enable Just My Code with Visual Studio debugger. |
| .sp |
| This variable is used to initialize the \fBVS_JUST_MY_CODE_DEBUGGING\fP |
| property on all targets when they are created. See that target property for |
| additional information. |
| .SS CMAKE_VS_SDK_EXCLUDE_DIRECTORIES |
| .sp |
| New in version 3.12. |
| |
| .sp |
| This variable allows to override Visual Studio default Exclude Directories. |
| .SS CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES |
| .sp |
| New in version 3.12. |
| |
| .sp |
| This variable allows to override Visual Studio default Executable Directories. |
| .SS CMAKE_VS_SDK_INCLUDE_DIRECTORIES |
| .sp |
| New in version 3.12. |
| |
| .sp |
| This variable allows to override Visual Studio default Include Directories. |
| .SS CMAKE_VS_SDK_LIBRARY_DIRECTORIES |
| .sp |
| New in version 3.12. |
| |
| .sp |
| This variable allows to override Visual Studio default Library Directories. |
| .SS CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES |
| .sp |
| New in version 3.12. |
| |
| .sp |
| This variable allows to override Visual Studio default Library WinRT |
| Directories. |
| .SS CMAKE_VS_SDK_REFERENCE_DIRECTORIES |
| .sp |
| New in version 3.12. |
| |
| .sp |
| This variable allows to override Visual Studio default Reference Directories. |
| .SS CMAKE_VS_SDK_SOURCE_DIRECTORIES |
| .sp |
| New in version 3.12. |
| |
| .sp |
| This variable allows to override Visual Studio default Source Directories. |
| .SS CMAKE_VS_WINRT_BY_DEFAULT |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Inform Visual Studio Generators for VS 2010 and above that the |
| target platform enables WinRT compilation by default and it needs to |
| be explicitly disabled if \fB/ZW\fP or \fBVS_WINRT_COMPONENT\fP is |
| omitted (as opposed to enabling it when either of those options is |
| present) |
| .sp |
| This makes cmake configuration consistent in terms of WinRT among |
| platforms \- if you did not enable the WinRT compilation explicitly, it |
| will be disabled (by either not enabling it or explicitly disabling it) |
| .sp |
| Note: WinRT compilation is always explicitly disabled for C language |
| source files, even if it is expliclty enabled for a project |
| .sp |
| This variable is meant to be set by a |
| \fBtoolchain file\fP for such platforms. |
| .SS CMAKE_WIN32_EXECUTABLE |
| .sp |
| Default value for \fBWIN32_EXECUTABLE\fP of targets. |
| .sp |
| This variable is used to initialize the \fBWIN32_EXECUTABLE\fP property |
| on all the targets. See that target property for additional information. |
| .SS CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Default value for \fBWINDOWS_EXPORT_ALL_SYMBOLS\fP target property. |
| This variable is used to initialize the property on each target as it is |
| created. |
| .SS CMAKE_XCODE_ATTRIBUTE_<an\-attribute> |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Set Xcode target attributes directly. |
| .sp |
| Tell the \fBXcode\fP generator to set \fB<an\-attribute>\fP to a given |
| value in the generated Xcode project. Ignored on other generators. |
| .sp |
| This offers low\-level control over the generated Xcode project file. |
| It is meant as a last resort for specifying settings that CMake does |
| not otherwise have a way to control. Although this can override a |
| setting CMake normally produces on its own, doing so bypasses CMake\(aqs |
| model of the project and can break things. |
| .sp |
| See the \fBXCODE_ATTRIBUTE_<an\-attribute>\fP target property |
| to set attributes on a specific target. |
| .sp |
| Contents of \fBCMAKE_XCODE_ATTRIBUTE_<an\-attribute>\fP may use |
| "generator expressions" with the syntax \fB$<...>\fP\&. See the |
| \fBcmake\-generator\-expressions(7)\fP manual for available |
| expressions. See the \fBcmake\-buildsystem(7)\fP manual |
| for more on defining buildsystem properties. |
| .SS EXECUTABLE_OUTPUT_PATH |
| .sp |
| Old executable location variable. |
| .sp |
| The target property \fBRUNTIME_OUTPUT_DIRECTORY\fP supersedes this |
| variable for a target if it is set. Executable targets are otherwise placed in |
| this directory. |
| .SS LIBRARY_OUTPUT_PATH |
| .sp |
| Old library location variable. |
| .sp |
| The target properties \fBARCHIVE_OUTPUT_DIRECTORY\fP, |
| \fBLIBRARY_OUTPUT_DIRECTORY\fP, and \fBRUNTIME_OUTPUT_DIRECTORY\fP |
| supersede this variable for a target if they are set. Library targets are |
| otherwise placed in this directory. |
| .SH VARIABLES FOR LANGUAGES |
| .SS CMAKE_COMPILER_IS_GNUCC |
| .sp |
| New in version 3.7. |
| |
| .sp |
| True if the \fBC\fP compiler is GNU. |
| Use \fBCMAKE_C_COMPILER_ID\fP instead. |
| .SS CMAKE_COMPILER_IS_GNUCXX |
| .sp |
| New in version 3.7. |
| |
| .sp |
| True if the C++ (\fBCXX\fP) compiler is GNU. |
| Use \fBCMAKE_CXX_COMPILER_ID\fP instead. |
| .SS CMAKE_COMPILER_IS_GNUG77 |
| .sp |
| New in version 3.7. |
| |
| .sp |
| True if the \fBFortran\fP compiler is GNU. |
| Use \fBCMAKE_Fortran_COMPILER_ID\fP instead. |
| .SS CMAKE_CUDA_ARCHITECTURES |
| .sp |
| New in version 3.18. |
| |
| .sp |
| Default value for \fBCUDA_ARCHITECTURES\fP property of targets. |
| .sp |
| Initialized by the \fBCUDAARCHS\fP environment variable if set. |
| Otherwise as follows depending on \fBCMAKE_CUDA_COMPILER_ID\fP: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| For \fBClang\fP: the oldest architecture that works. |
| .IP \(bu 2 |
| For \fBNVIDIA\fP: the default architecture chosen by the compiler. |
| See policy \fBCMP0104\fP\&. |
| .UNINDENT |
| .sp |
| Users are encouraged to override this, as the default varies across compilers |
| and compiler versions. |
| .sp |
| This variable is used to initialize the \fBCUDA_ARCHITECTURES\fP property |
| on all targets. See the target property for additional information. |
| .SS Examples |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| cmake_minimum_required(VERSION) |
| |
| if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) |
| set(CMAKE_CUDA_ARCHITECTURES 75) |
| endif() |
| |
| project(example LANGUAGES CUDA) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| \fBCMAKE_CUDA_ARCHITECTURES\fP will default to \fB75\fP unless overridden by the user. |
| .SS CMAKE_CUDA_COMPILE_FEATURES |
| .sp |
| New in version 3.17. |
| |
| .sp |
| List of features known to the CUDA compiler |
| .sp |
| These features are known to be available for use with the CUDA compiler. This |
| list is a subset of the features listed in the |
| \fBCMAKE_CUDA_KNOWN_FEATURES\fP global property. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_CUDA_EXTENSIONS |
| .sp |
| New in version 3.8. |
| |
| .sp |
| Default value for \fBCUDA_EXTENSIONS\fP target property if set when a |
| target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_CUDA_HOST_COMPILER |
| .sp |
| New in version 3.10. |
| |
| .sp |
| When \fBCMAKE_CUDA_COMPILER_ID\fP is |
| \fBNVIDIA\fP, \fBCMAKE_CUDA_HOST_COMPILER\fP selects the compiler executable to use |
| when compiling host code for \fBCUDA\fP language files. |
| This maps to the \fBnvcc \-ccbin\fP option. |
| .sp |
| The \fBCMAKE_CUDA_HOST_COMPILER\fP variable may be set explicitly before CUDA is |
| first enabled by a \fBproject()\fP or \fBenable_language()\fP command. |
| This can be done via \fB\-DCMAKE_CUDA_HOST_COMPILER=...\fP on the command line |
| or in a toolchain file\&. Or, one may set |
| the \fBCUDAHOSTCXX\fP environment variable to provide a default value. |
| .sp |
| Once the CUDA language is enabled, the \fBCMAKE_CUDA_HOST_COMPILER\fP variable |
| is read\-only and changes to it are undefined behavior. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| Since \fBCMAKE_CUDA_HOST_COMPILER\fP is meaningful only when the |
| \fBCMAKE_CUDA_COMPILER_ID\fP is \fBNVIDIA\fP, |
| it does not make sense to set \fBCMAKE_CUDA_HOST_COMPILER\fP without also |
| setting \fBCMAKE_CUDA_COMPILER\fP to NVCC. |
| .UNINDENT |
| .UNINDENT |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| Ignored when using Visual Studio Generators\&. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_CUDA_STANDARD |
| .sp |
| New in version 3.8. |
| |
| .sp |
| Default value for \fBCUDA_STANDARD\fP target property if set when a |
| target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_CUDA_STANDARD_REQUIRED |
| .sp |
| New in version 3.8. |
| |
| .sp |
| Default value for \fBCUDA_STANDARD_REQUIRED\fP target property if set |
| when a target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES |
| .sp |
| New in version 3.8. |
| |
| .sp |
| When the \fBCUDA\fP language has been enabled, this provides a |
| semicolon\-separated list of include directories provided |
| by the CUDA Toolkit. The value may be useful for C++ source files |
| to include CUDA headers. |
| .SS CMAKE_CXX_COMPILE_FEATURES |
| .sp |
| New in version 3.1. |
| |
| .sp |
| List of features known to the C++ compiler |
| .sp |
| These features are known to be available for use with the C++ compiler. This |
| list is a subset of the features listed in the |
| \fBCMAKE_CXX_KNOWN_FEATURES\fP global property. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_CXX_EXTENSIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Default value for \fBCXX_EXTENSIONS\fP target property if set when a |
| target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_CXX_STANDARD |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Default value for \fBCXX_STANDARD\fP target property if set when a target |
| is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_CXX_STANDARD_REQUIRED |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Default value for \fBCXX_STANDARD_REQUIRED\fP target property if set when |
| a target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_C_COMPILE_FEATURES |
| .sp |
| New in version 3.1. |
| |
| .sp |
| List of features known to the C compiler |
| .sp |
| These features are known to be available for use with the C compiler. This |
| list is a subset of the features listed in the |
| \fBCMAKE_C_KNOWN_FEATURES\fP global property. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_C_EXTENSIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Default value for \fBC_EXTENSIONS\fP target property if set when a target |
| is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_C_STANDARD |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Default value for \fBC_STANDARD\fP target property if set when a target |
| is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_C_STANDARD_REQUIRED |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Default value for \fBC_STANDARD_REQUIRED\fP target property if set when |
| a target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_Fortran_MODDIR_DEFAULT |
| .sp |
| Fortran default module output directory. |
| .sp |
| Most Fortran compilers write \fB\&.mod\fP files to the current working |
| directory. For those that do not, this is set to \fB\&.\fP and used when |
| the \fBFortran_MODULE_DIRECTORY\fP target property is not set. |
| .SS CMAKE_Fortran_MODDIR_FLAG |
| .sp |
| Fortran flag for module output directory. |
| .sp |
| This stores the flag needed to pass the value of the |
| \fBFortran_MODULE_DIRECTORY\fP target property to the compiler. |
| .SS CMAKE_Fortran_MODOUT_FLAG |
| .sp |
| Fortran flag to enable module output. |
| .sp |
| Most Fortran compilers write \fB\&.mod\fP files out by default. For others, |
| this stores the flag needed to enable module output. |
| .SS CMAKE_HIP_ARCHITECTURES |
| .sp |
| New in version 3.21. |
| |
| .sp |
| Default value for \fBHIP_ARCHITECTURES\fP property of targets. |
| .sp |
| This is initialized to the architectures reported by \fBrocm_agent_enumerator\fP, |
| if available, and otherwise to the default chosen by the compiler. |
| .sp |
| This variable is used to initialize the \fBHIP_ARCHITECTURES\fP property |
| on all targets. See the target property for additional information. |
| .SS CMAKE_HIP_EXTENSIONS |
| .sp |
| New in version 3.21. |
| |
| .sp |
| Default value for \fBHIP_EXTENSIONS\fP target property if set when a |
| target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_HIP_STANDARD |
| .sp |
| New in version 3.21. |
| |
| .sp |
| Default value for \fBHIP_STANDARD\fP target property if set when a target |
| is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_HIP_STANDARD_REQUIRED |
| .sp |
| New in version 3.21. |
| |
| .sp |
| Default value for \fBHIP_STANDARD_REQUIRED\fP target property if set when |
| a target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_ISPC_HEADER_DIRECTORY |
| .sp |
| New in version 3.19. |
| |
| .sp |
| ISPC generated header output directory. |
| .sp |
| This variable is used to initialize the \fBISPC_HEADER_DIRECTORY\fP |
| property on all the targets. See the target property for additional |
| information. |
| .SS CMAKE_ISPC_HEADER_SUFFIX |
| .sp |
| New in version 3.19.2. |
| |
| .sp |
| Output suffix to be used for ISPC generated headers. |
| .sp |
| This variable is used to initialize the \fBISPC_HEADER_SUFFIX\fP |
| property on all the targets. See the target property for additional |
| information. |
| .SS CMAKE_ISPC_INSTRUCTION_SETS |
| .sp |
| New in version 3.19. |
| |
| .sp |
| Default value for \fBISPC_INSTRUCTION_SETS\fP property of targets. |
| .sp |
| This variable is used to initialize the \fBISPC_INSTRUCTION_SETS\fP property |
| on all targets. See the target property for additional information. |
| .SS CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE |
| .sp |
| New in version 3.7.1. |
| |
| .sp |
| When Cross Compiling for Android this variable contains the |
| toolchain binutils machine name (e.g. \fBgcc \-dumpmachine\fP). The |
| binutils typically have a \fB<machine>\-\fP prefix on their name. |
| .sp |
| See also \fBCMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX\fP |
| and \fBCMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX\fP\&. |
| .SS CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX |
| .sp |
| New in version 3.7. |
| |
| .sp |
| When Cross Compiling for Android this variable contains the absolute |
| path prefixing the toolchain GNU compiler and its binutils. |
| .sp |
| See also \fBCMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX\fP |
| and \fBCMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE\fP\&. |
| .sp |
| For example, the path to the linker is: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| ${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ld${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX} |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX |
| .sp |
| New in version 3.7. |
| |
| .sp |
| When Cross Compiling for Android this variable contains the |
| host platform suffix of the toolchain GNU compiler and its binutils. |
| .sp |
| See also \fBCMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX\fP |
| and \fBCMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE\fP\&. |
| .SS CMAKE_<LANG>_ARCHIVE_APPEND |
| .sp |
| Rule variable to append to a static archive. |
| .sp |
| This is a rule variable that tells CMake how to append to a static |
| archive. It is used in place of \fBCMAKE_<LANG>_CREATE_STATIC_LIBRARY\fP |
| on some platforms in order to support large object counts. See also |
| \fBCMAKE_<LANG>_ARCHIVE_CREATE\fP and |
| \fBCMAKE_<LANG>_ARCHIVE_FINISH\fP\&. |
| .SS CMAKE_<LANG>_ARCHIVE_CREATE |
| .sp |
| Rule variable to create a new static archive. |
| .sp |
| This is a rule variable that tells CMake how to create a static |
| archive. It is used in place of \fBCMAKE_<LANG>_CREATE_STATIC_LIBRARY\fP |
| on some platforms in order to support large object counts. See also |
| \fBCMAKE_<LANG>_ARCHIVE_APPEND\fP and |
| \fBCMAKE_<LANG>_ARCHIVE_FINISH\fP\&. |
| .SS CMAKE_<LANG>_ARCHIVE_FINISH |
| .sp |
| Rule variable to finish an existing static archive. |
| .sp |
| This is a rule variable that tells CMake how to finish a static |
| archive. It is used in place of \fBCMAKE_<LANG>_CREATE_STATIC_LIBRARY\fP |
| on some platforms in order to support large object counts. See also |
| \fBCMAKE_<LANG>_ARCHIVE_CREATE\fP and |
| \fBCMAKE_<LANG>_ARCHIVE_APPEND\fP\&. |
| .SS CMAKE_<LANG>_BYTE_ORDER |
| .sp |
| New in version 3.20. |
| |
| .sp |
| Byte order of \fB<LANG>\fP compiler target architecture, if known. |
| If defined and not empty, the value is one of: |
| .INDENT 0.0 |
| .TP |
| .B \fBBIG_ENDIAN\fP |
| The target architecture is Big Endian. |
| .TP |
| .B \fBLITTLE_ENDIAN\fP |
| The target architecture is Little Endian. |
| .UNINDENT |
| .sp |
| This is defined for languages \fBC\fP, \fBCXX\fP, \fBOBJC\fP, \fBOBJCXX\fP, |
| and \fBCUDA\fP\&. |
| .sp |
| If \fBCMAKE_OSX_ARCHITECTURES\fP specifies multiple architectures, the |
| value of \fBCMAKE_<LANG>_BYTE_ORDER\fP is non\-empty only if all architectures |
| share the same byte order. |
| .SS CMAKE_<LANG>_COMPILER |
| .sp |
| The full path to the compiler for \fBLANG\fP\&. |
| .sp |
| This is the command that will be used as the \fB<LANG>\fP compiler. Once |
| set, you can not change this variable. |
| .SS Usage |
| .sp |
| This variable can be set by the user during the first time a build tree is configured. |
| .sp |
| If a non\-full path value is supplied then CMake will resolve the full path of |
| the compiler. |
| .sp |
| The variable could be set in a user supplied toolchain file or via \fI\-D\fP on the command line. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| Options that are required to make the compiler work correctly can be included |
| as items in a list; they can not be changed. |
| .UNINDENT |
| .UNINDENT |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| #set within user supplied toolchain file |
| set(CMAKE_C_COMPILER /full/path/to/qcc \-\-arg1 \-\-arg2) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| or |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| $ cmake ... \-DCMAKE_C_COMPILER=\(aqqcc;\-\-arg1;\-\-arg2\(aq |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN |
| .sp |
| The external toolchain for cross\-compiling, if supported. |
| .sp |
| 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. |
| \fBCMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN\fP may be set to a path to |
| the external toolchain and will be passed to the compiler driver if supported. |
| .sp |
| This variable may only be set in a toolchain file specified by |
| the \fBCMAKE_TOOLCHAIN_FILE\fP variable. |
| .SS CMAKE_<LANG>_COMPILER_ID |
| .sp |
| Compiler identification string. |
| .sp |
| A short string unique to the compiler vendor. Possible values |
| include: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| Absoft = Absoft Fortran (absoft.com) |
| ADSP = Analog VisualDSP++ (analog.com) |
| AppleClang = Apple Clang (apple.com) |
| ARMCC = ARM Compiler (arm.com) |
| ARMClang = ARM Compiler based on Clang (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) |
| Flang = Flang LLVM Fortran Compiler |
| Fujitsu = Fujitsu HPC compiler (Trad mode) |
| FujitsuClang = Fujitsu HPC compiler (Clang mode) |
| G95 = G95 Fortran (g95.org) |
| GNU = GNU Compiler Collection (gcc.gnu.org) |
| GHS = Green Hills Software (www.ghs.com) |
| HP = Hewlett\-Packard Compiler (hp.com) |
| IAR = IAR Systems (iar.com) |
| Intel = Intel Compiler (intel.com) |
| IntelLLVM = Intel LLVM\-Based Compiler (intel.com) |
| LCC = MCST Elbrus C/C++/Fortran Compiler (mcst.ru) |
| MSVC = Microsoft Visual Studio (microsoft.com) |
| NVHPC = NVIDIA HPC SDK Compiler (nvidia.com) |
| NVIDIA = NVIDIA CUDA Compiler (nvidia.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) |
| XLClang = IBM Clang\-based XL (ibm.com) |
| IBMClang = IBM LLVM\-based Compiler (ibm.com) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| This variable is not guaranteed to be defined for all compilers or |
| languages. |
| .SS CMAKE_<LANG>_COMPILER_LOADED |
| .sp |
| Defined to true if the language is enabled. |
| .sp |
| When language \fB<LANG>\fP is enabled by \fBproject()\fP or |
| \fBenable_language()\fP this variable is defined to \fB1\fP\&. |
| .SS CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND |
| .sp |
| New in version 3.10. |
| |
| .sp |
| Command that outputs the compiler pre definitions. |
| .sp |
| See \fBAUTOMOC\fP which uses |
| \fI\%CMAKE_CXX_COMPILER_PREDEFINES_COMMAND\fP |
| to generate the \fBAUTOMOC_COMPILER_PREDEFINES\fP\&. |
| .SS CMAKE_<LANG>_COMPILER_TARGET |
| .sp |
| The target for cross\-compiling, if supported. |
| .sp |
| 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. |
| .sp |
| This variable may only be set in a toolchain file specified by |
| the \fBCMAKE_TOOLCHAIN_FILE\fP variable. |
| .SS CMAKE_<LANG>_COMPILER_VERSION |
| .sp |
| Compiler version string. |
| .sp |
| Compiler version in major[.minor[.patch[.tweak]]] format. This |
| variable is not guaranteed to be defined for all compilers or |
| languages. |
| .sp |
| For example \fBCMAKE_C_COMPILER_VERSION\fP and |
| \fBCMAKE_CXX_COMPILER_VERSION\fP might indicate the respective C and C++ |
| compiler version. |
| .SS CMAKE_<LANG>_COMPILE_OBJECT |
| .sp |
| Rule variable to compile a single object file. |
| .sp |
| This is a rule variable that tells CMake how to compile a single |
| object file for the language \fB<LANG>\fP\&. |
| .SS CMAKE_<LANG>_CREATE_SHARED_LIBRARY |
| .sp |
| Rule variable to create a shared library. |
| .sp |
| This is a rule variable that tells CMake how to create a shared |
| library for the language \fB<LANG>\fP\&. This rule variable is a \fB;\fP delimited |
| list of commands to run to perform the linking step. |
| .SS CMAKE_<LANG>_CREATE_SHARED_MODULE |
| .sp |
| Rule variable to create a shared module. |
| .sp |
| This is a rule variable that tells CMake how to create a shared |
| library for the language \fB<LANG>\fP\&. This rule variable is a \fB;\fP delimited |
| list of commands to run. |
| .SS CMAKE_<LANG>_CREATE_STATIC_LIBRARY |
| .sp |
| Rule variable to create a static library. |
| .sp |
| This is a rule variable that tells CMake how to create a static |
| library for the language \fB<LANG>\fP\&. |
| .SS CMAKE_<LANG>_EXTENSIONS |
| .sp |
| The variations are: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBCMAKE_C_EXTENSIONS\fP |
| .IP \(bu 2 |
| \fBCMAKE_CXX_EXTENSIONS\fP |
| .IP \(bu 2 |
| \fBCMAKE_CUDA_EXTENSIONS\fP |
| .IP \(bu 2 |
| \fBCMAKE_HIP_EXTENSIONS\fP |
| .IP \(bu 2 |
| \fBCMAKE_OBJC_EXTENSIONS\fP |
| .IP \(bu 2 |
| \fBCMAKE_OBJCXX_EXTENSIONS\fP |
| .UNINDENT |
| .sp |
| Default values for \fB<LANG>_EXTENSIONS\fP target properties if set when |
| a target is created. For the compiler\(aqs default setting see |
| \fBCMAKE_<LANG>_EXTENSIONS_DEFAULT\fP\&. |
| .sp |
| For supported CMake versions see the respective pages. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_<LANG>_EXTENSIONS_DEFAULT |
| .sp |
| New in version 3.22. |
| |
| .sp |
| Compiler\(aqs default extensions mode. Used as the default for the |
| \fB<LANG>_EXTENSIONS\fP target property when |
| \fBCMAKE_<LANG>_EXTENSIONS\fP is not set (see \fBCMP0128\fP). |
| .sp |
| This variable is read\-only. Modifying it is undefined behavior. |
| .SS CMAKE_<LANG>_FLAGS |
| .sp |
| Flags for all build types. |
| .sp |
| \fB<LANG>\fP flags used regardless of the value of \fBCMAKE_BUILD_TYPE\fP\&. |
| .sp |
| This is initialized for each language from environment variables: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBCMAKE_C_FLAGS\fP: |
| Initialized by the \fBCFLAGS\fP environment variable. |
| .IP \(bu 2 |
| \fBCMAKE_CXX_FLAGS\fP: |
| Initialized by the \fBCXXFLAGS\fP environment variable. |
| .IP \(bu 2 |
| \fBCMAKE_CUDA_FLAGS\fP: |
| Initialized by the \fBCUDAFLAGS\fP environment variable. |
| .IP \(bu 2 |
| \fBCMAKE_Fortran_FLAGS\fP: |
| Initialized by the \fBFFLAGS\fP environment variable. |
| .UNINDENT |
| .sp |
| This value is a command\-line string fragment. Therefore, multiple options |
| should be separated by spaces, and options with spaces should be quoted. |
| .sp |
| The flags in this variable will be passed to the compiler before those |
| in the per\-configuration \fBCMAKE_<LANG>_FLAGS_<CONFIG>\fP variant, |
| and before flags added by the \fBadd_compile_options()\fP or |
| \fBtarget_compile_options()\fP commands. |
| .SS CMAKE_<LANG>_FLAGS_<CONFIG> |
| .sp |
| Flags for language \fB<LANG>\fP when building for the \fB<CONFIG>\fP configuration. |
| .sp |
| The flags in this variable will be passed to the compiler after those |
| in the \fBCMAKE_<LANG>_FLAGS\fP variable, but before flags added |
| by the \fBadd_compile_options()\fP or \fBtarget_compile_options()\fP |
| commands. |
| .SS CMAKE_<LANG>_FLAGS_<CONFIG>_INIT |
| .sp |
| New in version 3.11. |
| |
| .sp |
| Value used to initialize the \fBCMAKE_<LANG>_FLAGS_<CONFIG>\fP cache |
| entry the first time a build tree is configured for language \fB<LANG>\fP\&. |
| This variable is meant to be set by a \fBtoolchain file\fP\&. CMake may prepend or append content to |
| the value based on the environment and target platform. |
| .sp |
| See also \fBCMAKE_<LANG>_FLAGS_INIT\fP\&. |
| .SS CMAKE_<LANG>_FLAGS_DEBUG |
| .sp |
| This variable is the \fBDebug\fP variant of the |
| \fBCMAKE_<LANG>_FLAGS_<CONFIG>\fP variable. |
| .SS CMAKE_<LANG>_FLAGS_DEBUG_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| This variable is the \fBDebug\fP variant of the |
| \fBCMAKE_<LANG>_FLAGS_<CONFIG>_INIT\fP variable. |
| .SS CMAKE_<LANG>_FLAGS_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Value used to initialize the \fBCMAKE_<LANG>_FLAGS\fP cache entry |
| the first time a build tree is configured for language \fB<LANG>\fP\&. |
| This variable is meant to be set by a \fBtoolchain file\fP\&. CMake may prepend or append content to |
| the value based on the environment and target platform. For example, |
| the contents of a \fBxxxFLAGS\fP environment variable will be prepended, |
| where \fBxxx\fP will be language\-specific but not necessarily the same as |
| \fB<LANG>\fP (e.g. \fBCXXFLAGS\fP for \fBCXX\fP, \fBFFLAGS\fP for |
| \fBFortran\fP, and so on). |
| This value is a command\-line string fragment. Therefore, multiple options |
| should be separated by spaces, and options with spaces should be quoted. |
| .sp |
| See also the configuration\-specific |
| \fBCMAKE_<LANG>_FLAGS_<CONFIG>_INIT\fP variable. |
| .SS CMAKE_<LANG>_FLAGS_MINSIZEREL |
| .sp |
| This variable is the \fBMinSizeRel\fP variant of the |
| \fBCMAKE_<LANG>_FLAGS_<CONFIG>\fP variable. |
| .SS CMAKE_<LANG>_FLAGS_MINSIZEREL_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| This variable is the \fBMinSizeRel\fP variant of the |
| \fBCMAKE_<LANG>_FLAGS_<CONFIG>_INIT\fP variable. |
| .SS CMAKE_<LANG>_FLAGS_RELEASE |
| .sp |
| This variable is the \fBRelease\fP variant of the |
| \fBCMAKE_<LANG>_FLAGS_<CONFIG>\fP variable. |
| .SS CMAKE_<LANG>_FLAGS_RELEASE_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| This variable is the \fBRelease\fP variant of the |
| \fBCMAKE_<LANG>_FLAGS_<CONFIG>_INIT\fP variable. |
| .SS CMAKE_<LANG>_FLAGS_RELWITHDEBINFO |
| .sp |
| This variable is the \fBRelWithDebInfo\fP variant of the |
| \fBCMAKE_<LANG>_FLAGS_<CONFIG>\fP variable. |
| .SS CMAKE_<LANG>_FLAGS_RELWITHDEBINFO_INIT |
| .sp |
| New in version 3.7. |
| |
| .sp |
| This variable is the \fBRelWithDebInfo\fP variant of the |
| \fBCMAKE_<LANG>_FLAGS_<CONFIG>_INIT\fP variable. |
| .SS CMAKE_<LANG>_IGNORE_EXTENSIONS |
| .sp |
| File extensions that should be ignored by the build. |
| .sp |
| This is a list of file extensions that may be part of a project for a |
| given language but are not compiled. |
| .SS CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES |
| .sp |
| Directories implicitly searched by the compiler for header files. |
| .sp |
| CMake does not explicitly specify these directories on compiler |
| command lines for language \fB<LANG>\fP\&. This prevents system include |
| directories from being treated as user include directories on some |
| compilers, which is important for \fBC\fP, \fBCXX\fP, and \fBCUDA\fP to |
| avoid overriding standard library headers. |
| .sp |
| This value is not used for \fBFortran\fP because it has no standard |
| library headers and some compilers do not search their implicit |
| include directories for module \fB\&.mod\fP files. |
| .SS CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES |
| .sp |
| Implicit linker search path detected for language \fB<LANG>\fP\&. |
| .sp |
| Compilers typically pass directories containing language runtime |
| libraries and default library search paths when they invoke a linker. |
| These paths are implicit linker search directories for the compiler\(aqs |
| language. For each language enabled by the \fBproject()\fP or |
| \fBenable_language()\fP command, CMake automatically detects these |
| directories and reports the results in this variable. |
| .sp |
| When linking to a static library, CMake adds the implicit link directories |
| from this variable for each language used in the static library (except |
| the language whose compiler is used to drive linking). In the case of an |
| imported static library, the \fBIMPORTED_LINK_INTERFACE_LANGUAGES\fP |
| target property lists the languages whose implicit link information is |
| needed. If any of the languages is not enabled, its value for the |
| \fBCMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES\fP variable may instead be provided |
| by the project. Or, a \fBtoolchain file\fP |
| may set the variable to a value known for the specified toolchain. It will |
| either be overridden when the language is enabled, or used as a fallback. |
| .sp |
| Some toolchains read implicit directories from an environment variable such as |
| \fBLIBRARY_PATH\fP\&. If using such an environment variable, keep its value |
| consistent when operating in a given build tree because CMake saves the value |
| detected when first creating a build tree. |
| .sp |
| If policy \fBCMP0060\fP is not set to \fBNEW\fP, then when a library in one |
| of these directories is given by full path to \fBtarget_link_libraries()\fP |
| CMake will generate the \fB\-l<name>\fP form on link lines for historical |
| purposes. |
| .sp |
| See also the \fBCMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES\fP variable. |
| .SS CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES |
| .sp |
| Implicit linker framework search path detected for language \fB<LANG>\fP\&. |
| .sp |
| These paths are implicit linker framework search directories for the |
| compiler\(aqs language. CMake automatically detects these directories |
| for each language and reports the results in this variable. |
| .SS CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES |
| .sp |
| Implicit link libraries and flags detected for language \fB<LANG>\fP\&. |
| .sp |
| Compilers typically pass language runtime library names and other |
| flags when they invoke a linker. These flags are implicit link |
| options for the compiler\(aqs language. For each language enabled |
| by the \fBproject()\fP or \fBenable_language()\fP command, |
| CMake automatically detects these libraries and flags and reports |
| the results in this variable. |
| .sp |
| When linking to a static library, CMake adds the implicit link libraries and |
| flags from this variable for each language used in the static library (except |
| the language whose compiler is used to drive linking). In the case of an |
| imported static library, the \fBIMPORTED_LINK_INTERFACE_LANGUAGES\fP |
| target property lists the languages whose implicit link information is |
| needed. If any of the languages is not enabled, its value for the |
| \fBCMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES\fP variable may instead be provided |
| by the project. Or, a \fBtoolchain file\fP |
| may set the variable to a value known for the specified toolchain. It will |
| either be overridden when the language is enabled, or used as a fallback. |
| .sp |
| See also the \fBCMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES\fP variable. |
| .SS CMAKE_<LANG>_LIBRARY_ARCHITECTURE |
| .sp |
| Target architecture library directory name detected for \fB<LANG>\fP\&. |
| .sp |
| If the \fB<LANG>\fP compiler passes to the linker an architecture\-specific |
| system library search directory such as \fB<prefix>/lib/<arch>\fP this |
| variable contains the \fB<arch>\fP name if/as detected by CMake. |
| .SS CMAKE_<LANG>_LINK_EXECUTABLE |
| .sp |
| Rule variable to link an executable. |
| .sp |
| Rule variable to link an executable for the given language. |
| .SS CMAKE_<LANG>_LINKER_WRAPPER_FLAG |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Defines the syntax of compiler driver option to pass options to the linker |
| tool. It will be used to translate the \fBLINKER:\fP prefix in the link options |
| (see \fBadd_link_options()\fP and \fBtarget_link_options()\fP). |
| .sp |
| This variable holds a semicolon\-separated list of tokens. |
| If a space (i.e. " ") is specified as last token, flag and \fBLINKER:\fP |
| arguments will be specified as separate arguments to the compiler driver. |
| The \fBCMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP\fP variable can be specified |
| to manage concatenation of arguments. |
| .sp |
| For example, for \fBClang\fP we have: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set (CMAKE_C_LINKER_WRAPPER_FLAG "\-Xlinker" " ") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Specifying \fB"LINKER:\-z,defs"\fP will be transformed in |
| \fB\-Xlinker \-z \-Xlinker defs\fP\&. |
| .sp |
| For \fBGNU GCC\fP: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set (CMAKE_C_LINKER_WRAPPER_FLAG "\-Wl,") |
| set (CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Specifying \fB"LINKER:\-z,defs"\fP will be transformed in \fB\-Wl,\-z,defs\fP\&. |
| .sp |
| And for \fBSunPro\fP: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set (CMAKE_C_LINKER_WRAPPER_FLAG "\-Qoption" "ld" " ") |
| set (CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| Specifying \fB"LINKER:\-z,defs"\fP will be transformed in \fB\-Qoption ld \-z,defs\fP\&. |
| .SS CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP |
| .sp |
| New in version 3.13. |
| |
| .sp |
| This variable is used with \fBCMAKE_<LANG>_LINKER_WRAPPER_FLAG\fP |
| variable to format \fBLINKER:\fP prefix in the link options |
| (see \fBadd_link_options()\fP and \fBtarget_link_options()\fP). |
| .sp |
| When specified, arguments of the \fBLINKER:\fP prefix will be concatenated using |
| this value as separator. |
| .SS CMAKE_<LANG>_OUTPUT_EXTENSION |
| .sp |
| Extension for the output of a compile for a single file. |
| .sp |
| This is the extension for an object file for the given \fB<LANG>\fP\&. For |
| example \fB\&.obj\fP for C on Windows. |
| .SS CMAKE_<LANG>_SIMULATE_ID |
| .sp |
| Identification string of the "simulated" compiler. |
| .sp |
| 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 \fBCMAKE_<LANG>_COMPILER_ID\fP for |
| the simulated compiler. |
| .sp |
| \fBNOTE:\fP |
| .INDENT 0.0 |
| .INDENT 3.5 |
| In other words, this variable describes the ABI compatibility |
| of the generated code. |
| .UNINDENT |
| .UNINDENT |
| .SS CMAKE_<LANG>_SIMULATE_VERSION |
| .sp |
| Version string of "simulated" compiler. |
| .sp |
| 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 \fBCMAKE_<LANG>_COMPILER_VERSION\fP |
| for the simulated compiler. |
| .SS CMAKE_<LANG>_SIZEOF_DATA_PTR |
| .sp |
| Size of pointer\-to\-data types for language \fB<LANG>\fP\&. |
| .sp |
| This holds the size (in bytes) of pointer\-to\-data types in the target |
| platform ABI. It is defined for languages \fBC\fP and \fBCXX\fP (C++). |
| .SS CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS |
| .sp |
| Extensions of source files for the given language. |
| .sp |
| This is the list of extensions for a given language\(aqs source files. |
| .SS CMAKE_<LANG>_STANDARD |
| .sp |
| The variations are: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBCMAKE_C_STANDARD\fP |
| .IP \(bu 2 |
| \fBCMAKE_CXX_STANDARD\fP |
| .IP \(bu 2 |
| \fBCMAKE_CUDA_STANDARD\fP |
| .IP \(bu 2 |
| \fBCMAKE_HIP_STANDARD\fP |
| .IP \(bu 2 |
| \fBCMAKE_OBJC_STANDARD\fP |
| .IP \(bu 2 |
| \fBCMAKE_OBJCXX_STANDARD\fP |
| .UNINDENT |
| .sp |
| Default values for \fB<LANG>_STANDARD\fP target properties if set when a |
| target is created. |
| .sp |
| For supported CMake versions see the respective pages. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_<LANG>_STANDARD_DEFAULT |
| .sp |
| New in version 3.9. |
| |
| .sp |
| The compiler\(aqs default standard for the language \fB<LANG>\fP\&. Empty if the |
| compiler has no conception of standard levels. |
| .SS CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES |
| .sp |
| New in version 3.6. |
| |
| .sp |
| Include directories to be used for every source file compiled with |
| the \fB<LANG>\fP 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. |
| .sp |
| This variable should not be set by project code. It is meant to be set by |
| CMake\(aqs platform information modules for the current toolchain, or by a |
| toolchain file when used with \fBCMAKE_TOOLCHAIN_FILE\fP\&. |
| .sp |
| See also \fBCMAKE_<LANG>_STANDARD_LIBRARIES\fP\&. |
| .SS CMAKE_<LANG>_STANDARD_LIBRARIES |
| .sp |
| New in version 3.6. |
| |
| .sp |
| Libraries linked into every executable and shared library linked |
| for language \fB<LANG>\fP\&. This is meant for specification of system |
| libraries needed by the language for the current platform. |
| .sp |
| This variable should not be set by project code. It is meant to be set by |
| CMake\(aqs platform information modules for the current toolchain, or by a |
| toolchain file when used with \fBCMAKE_TOOLCHAIN_FILE\fP\&. |
| .sp |
| See also \fBCMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES\fP\&. |
| .SS CMAKE_<LANG>_STANDARD_REQUIRED |
| .sp |
| The variations are: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| \fBCMAKE_C_STANDARD_REQUIRED\fP |
| .IP \(bu 2 |
| \fBCMAKE_CXX_STANDARD_REQUIRED\fP |
| .IP \(bu 2 |
| \fBCMAKE_CUDA_STANDARD_REQUIRED\fP |
| .IP \(bu 2 |
| \fBCMAKE_HIP_STANDARD_REQUIRED\fP |
| .IP \(bu 2 |
| \fBCMAKE_OBJC_STANDARD_REQUIRED\fP |
| .IP \(bu 2 |
| \fBCMAKE_OBJCXX_STANDARD_REQUIRED\fP |
| .UNINDENT |
| .sp |
| Default values for \fB<LANG>_STANDARD_REQUIRED\fP target properties if |
| set when a target is created. |
| .sp |
| For supported CMake versions see the respective pages. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_OBJC_EXTENSIONS |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Default value for \fBOBJC_EXTENSIONS\fP target property if set when a |
| target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_OBJC_STANDARD |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Default value for \fBOBJC_STANDARD\fP target property if set when a |
| target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_OBJC_STANDARD_REQUIRED |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Default value for \fBOBJC_STANDARD_REQUIRED\fP target property if set |
| when a target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_OBJCXX_EXTENSIONS |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Default value for \fBOBJCXX_EXTENSIONS\fP target property if set when a |
| target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_OBJCXX_STANDARD |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Default value for \fBOBJCXX_STANDARD\fP target property if set when a |
| target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_OBJCXX_STANDARD_REQUIRED |
| .sp |
| New in version 3.16. |
| |
| .sp |
| Default value for \fBOBJCXX_STANDARD_REQUIRED\fP target property if set |
| when a target is created. |
| .sp |
| See the \fBcmake\-compile\-features(7)\fP manual for information on |
| compile features and a list of supported compilers. |
| .SS CMAKE_Swift_LANGUAGE_VERSION |
| .sp |
| New in version 3.7. |
| |
| .sp |
| Set to the Swift language version number. If not set, the oldest legacy |
| version known to be available in the host Xcode version is assumed: |
| .INDENT 0.0 |
| .IP \(bu 2 |
| Swift \fB4.0\fP for Xcode 10.2 and above. |
| .IP \(bu 2 |
| Swift \fB3.0\fP for Xcode 8.3 and above. |
| .IP \(bu 2 |
| Swift \fB2.3\fP for Xcode 8.2 and below. |
| .UNINDENT |
| .SS CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG> |
| .sp |
| Specify a CMake file that overrides platform information for \fB<LANG>\fP\&. |
| .sp |
| This is a language\-specific version of |
| \fBCMAKE_USER_MAKE_RULES_OVERRIDE\fP loaded only when enabling language |
| \fB<LANG>\fP\&. |
| .SH VARIABLES FOR CTEST |
| .SS CTEST_BINARY_DIRECTORY |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBBuildDirectory\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_BUILD_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBMakeCommand\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_BUILD_NAME |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBBuildName\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_BZR_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBBZRCommand\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_BZR_UPDATE_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBBZRUpdateOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_CHANGE_ID |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Specify the CTest \fBChangeId\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .sp |
| 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. |
| .SS CTEST_CHECKOUT_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Tell the \fBctest_start()\fP command how to checkout or initialize |
| the source directory in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_CONFIGURATION_TYPE |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBDefaultCTestConfigurationType\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .sp |
| If the configuration type is set via \fB\-C <cfg>\fP from the command line |
| then this variable is populated accordingly. |
| .SS CTEST_CONFIGURE_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBConfigureCommand\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_COVERAGE_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBCoverageCommand\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS Cobertura |
| .sp |
| Using \fI\%Cobertura\fP as the coverage generation within your multi\-module |
| Java project can generate a series of XML files. |
| .sp |
| 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 \fBcobertura.ser\fP 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 \fBCTEST_COVERAGE_COMMAND\fP variable to point to a file which will |
| perform these same steps, such as a \fB\&.sh\fP or \fB\&.bat\fP file. |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CTEST_COVERAGE_COMMAND .../run\-coverage\-and\-consolidate.sh) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| where the \fBrun\-coverage\-and\-consolidate.sh\fP script is perhaps created by |
| the \fBconfigure_file()\fP command and might contain the following code: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| #!/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 . \e |
| \-\-format xml $SourceDirs |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The script uses \fBfind\fP to capture the paths to all of the \fBcobertura.ser\fP |
| files found below the project\(aqs source directory. It keeps the list of files |
| and supplies it as an argument to the \fBcobertura\-merge\fP program. The |
| \fB\-\-datafile\fP argument signifies where the result of the merge will be kept. |
| .sp |
| The combined \fBcoberturamerge.ser\fP file is then used to generate the XML report |
| using the \fBcobertura\-report\fP program. The call to the cobertura\-report |
| program requires some named arguments. |
| .INDENT 0.0 |
| .TP |
| .B \fB\-\-datafila\fP |
| path to the merged \fB\&.ser\fP file |
| .TP |
| .B \fB\-\-destination\fP |
| path to put the output files(s) |
| .TP |
| .B \fB\-\-format\fP |
| file format to write output in: xml or html |
| .UNINDENT |
| .sp |
| The rest of the supplied arguments consist of the full paths to the |
| \fB/src/main/java\fP directories of each module within the source tree. These |
| directories are needed and should not be forgotten. |
| .SS CTEST_COVERAGE_EXTRA_FLAGS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBCoverageExtraFlags\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_CURL_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBCurlOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_CUSTOM_COVERAGE_EXCLUDE |
| .sp |
| A list of regular expressions which will be used to exclude files by their |
| path from coverage output by the \fBctest_coverage()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_ERROR_EXCEPTION |
| .sp |
| A list of regular expressions which will be used to exclude when detecting |
| error messages in build outputs by the \fBctest_test()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_ERROR_MATCH |
| .sp |
| A list of regular expressions which will be used to detect error messages in |
| build outputs by the \fBctest_test()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_ERROR_POST_CONTEXT |
| .sp |
| The number of lines to include as context which follow an error message by the |
| \fBctest_test()\fP command. The default is 10. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_ERROR_PRE_CONTEXT |
| .sp |
| The number of lines to include as context which precede an error message by |
| the \fBctest_test()\fP command. The default is 10. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE |
| .sp |
| When saving a failing test\(aqs output, this is the maximum size, in bytes, that |
| will be collected by the \fBctest_test()\fP command. Defaults to 307200 |
| (300 KiB). |
| .sp |
| If a test\(aqs output contains the literal string "CTEST_FULL_OUTPUT", |
| the output will not be truncated and may exceed the maximum size. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .sp |
| For controlling the output collection of passing tests, see |
| \fBCTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE\fP\&. |
| .SS CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS |
| .sp |
| The maximum number of errors in a single build step which will be detected. |
| After this, the \fBctest_test()\fP command will truncate the output. |
| Defaults to 50. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS |
| .sp |
| The maximum number of warnings in a single build step which will be detected. |
| After this, the \fBctest_test()\fP command will truncate the output. |
| Defaults to 50. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE |
| .sp |
| When saving a passing test\(aqs output, this is the maximum size, in bytes, that |
| will be collected by the \fBctest_test()\fP command. Defaults to 1024 |
| (1 KiB). |
| .sp |
| If a test\(aqs output contains the literal string "CTEST_FULL_OUTPUT", |
| the output will not be truncated and may exceed the maximum size. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .sp |
| For controlling the output collection of failing tests, see |
| \fBCTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE\fP\&. |
| .SS CTEST_CUSTOM_MEMCHECK_IGNORE |
| .sp |
| A list of regular expressions to use to exclude tests during the |
| \fBctest_memcheck()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_POST_MEMCHECK |
| .sp |
| A list of commands to run at the end of the \fBctest_memcheck()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_POST_TEST |
| .sp |
| A list of commands to run at the end of the \fBctest_test()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_PRE_MEMCHECK |
| .sp |
| A list of commands to run at the start of the \fBctest_memcheck()\fP |
| command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_PRE_TEST |
| .sp |
| A list of commands to run at the start of the \fBctest_test()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_TESTS_IGNORE |
| .sp |
| A list of test names to be excluded from the set of tests run by the |
| \fBctest_test()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_WARNING_EXCEPTION |
| .sp |
| A list of regular expressions which will be used to exclude when detecting |
| warning messages in build outputs by the \fBctest_build()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CUSTOM_WARNING_MATCH |
| .sp |
| A list of regular expressions which will be used to detect warning messages in |
| build outputs by the \fBctest_build()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_CVS_CHECKOUT |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Deprecated. Use \fBCTEST_CHECKOUT_COMMAND\fP instead. |
| .SS CTEST_CVS_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBCVSCommand\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_CVS_UPDATE_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBCVSUpdateOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_DROP_LOCATION |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBDropLocation\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_DROP_METHOD |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBDropMethod\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_DROP_SITE |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBDropSite\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_DROP_SITE_CDASH |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBIsCDash\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_DROP_SITE_PASSWORD |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBDropSitePassword\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_DROP_SITE_USER |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBDropSiteUser\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_EXTRA_COVERAGE_GLOB |
| .sp |
| New in version 3.4. |
| |
| .sp |
| A list of regular expressions which will be used to find files which should be |
| covered by the \fBctest_coverage()\fP command. |
| .sp |
| It is initialized by \fBctest(1)\fP, but may be edited in a \fBCTestCustom\fP |
| file. See \fBctest_read_custom_files()\fP documentation. |
| .SS CTEST_GIT_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBGITCommand\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_GIT_INIT_SUBMODULES |
| .sp |
| New in version 3.6. |
| |
| .sp |
| Specify the CTest \fBGITInitSubmodules\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_GIT_UPDATE_CUSTOM |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBGITUpdateCustom\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_GIT_UPDATE_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBGITUpdateOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_HG_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBHGCommand\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_HG_UPDATE_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBHGUpdateOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_LABELS_FOR_SUBPROJECTS |
| .sp |
| New in version 3.10. |
| |
| .sp |
| Specify the CTest \fBLabelsForSubprojects\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_MEMORYCHECK_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBMemoryCheckCommand\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_MEMORYCHECK_COMMAND_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBMemoryCheckCommandOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_MEMORYCHECK_SANITIZER_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBMemoryCheckSanitizerOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .sp |
| CTest prepends correct sanitizer options \fB*_OPTIONS\fP |
| environment variable to executed command. CTests adds |
| its own \fBlog_path\fP to sanitizer options, don\(aqt provide your |
| own \fBlog_path\fP\&. |
| .SS CTEST_MEMORYCHECK_SUPPRESSIONS_FILE |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBMemoryCheckSuppressionFile\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_MEMORYCHECK_TYPE |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBMemoryCheckType\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| Valid values are \fBValgrind\fP, \fBPurify\fP, \fBBoundsChecker\fP, \fBDrMemory\fP, |
| \fBCudaSanitizer\fP, \fBThreadSanitizer\fP, \fBAddressSanitizer\fP, \fBLeakSanitizer\fP, |
| \fBMemorySanitizer\fP and \fBUndefinedBehaviorSanitizer\fP\&. |
| .SS CTEST_NIGHTLY_START_TIME |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBNightlyStartTime\fP setting in a \fBctest(1)\fP |
| dashboard client script. |
| .sp |
| Note that this variable must always be set for a nightly build in a |
| dashboard script. It is needed so that nightly builds can be properly grouped |
| together in CDash. |
| .SS CTEST_P4_CLIENT |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBP4Client\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_P4_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBP4Command\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_P4_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBP4Options\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_P4_UPDATE_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBP4UpdateOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_RESOURCE_SPEC_FILE |
| .sp |
| New in version 3.18. |
| |
| .sp |
| Specify the CTest \fBResourceSpecFile\fP setting in a \fBctest(1)\fP |
| dashboard client script. |
| .sp |
| This can also be used to specify the resource spec file from a CMake build. If |
| no \fBRESOURCE_SPEC_FILE\fP is passed to \fBctest_test()\fP, and |
| \fBCTEST_RESOURCE_SPEC_FILE\fP is not specified in the dashboard script, the |
| value of this variable from the build is used. |
| .SS CTEST_RUN_CURRENT_SCRIPT |
| .sp |
| New in version 3.11. |
| |
| .sp |
| Setting this to 0 prevents \fBctest(1)\fP from being run again when it |
| reaches the end of a script run by calling \fBctest \-S\fP\&. |
| .SS CTEST_SCP_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Legacy option. Not used. |
| .SS CTEST_SCRIPT_DIRECTORY |
| .sp |
| The directory containing the top\-level CTest script. |
| The concept is similar to \fBCMAKE_SOURCE_DIR\fP\&. |
| .SS CTEST_SITE |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBSite\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_SUBMIT_INACTIVITY_TIMEOUT |
| .sp |
| New in version 3.23. |
| |
| .sp |
| Specify the CTest \fBSubmitInactivityTimeout\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_SUBMIT_URL |
| .sp |
| New in version 3.14. |
| |
| .sp |
| Specify the CTest \fBSubmitURL\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_SOURCE_DIRECTORY |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBSourceDirectory\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_SVN_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBSVNCommand\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_SVN_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBSVNOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_SVN_UPDATE_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBSVNUpdateOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_TEST_LOAD |
| .sp |
| New in version 3.4. |
| |
| .sp |
| Specify the \fBTestLoad\fP setting in the CTest Test Step |
| of a \fBctest(1)\fP dashboard client script. This sets the |
| default value for the \fBTEST_LOAD\fP option of the \fBctest_test()\fP |
| command. |
| .SS CTEST_TEST_TIMEOUT |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBTimeOut\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_TRIGGER_SITE |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Legacy option. Not used. |
| .SS CTEST_UPDATE_COMMAND |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBUpdateCommand\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_UPDATE_OPTIONS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBUpdateOptions\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_UPDATE_VERSION_ONLY |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest UpdateVersionOnly setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_UPDATE_VERSION_OVERRIDE |
| .sp |
| New in version 3.15. |
| |
| .sp |
| Specify the CTest UpdateVersionOverride setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SS CTEST_USE_LAUNCHERS |
| .sp |
| New in version 3.1. |
| |
| .sp |
| Specify the CTest \fBUseLaunchers\fP setting |
| in a \fBctest(1)\fP dashboard client script. |
| .SH VARIABLES FOR CPACK |
| .SS CPACK_ABSOLUTE_DESTINATION_FILES |
| .sp |
| List of files which have been installed using an \fBABSOLUTE DESTINATION\fP path. |
| .sp |
| This variable is a Read\-Only variable which is set internally by CPack |
| during installation and before packaging using |
| \fBCMAKE_ABSOLUTE_DESTINATION_FILES\fP defined in \fBcmake_install.cmake\fP |
| scripts. The value can be used within CPack project configuration |
| file and/or \fBCPack<GEN>.cmake\fP file of \fB<GEN>\fP generator. |
| .SS CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY |
| .sp |
| Boolean toggle to include/exclude top level directory (component case). |
| .sp |
| Similar usage as \fBCPACK_INCLUDE_TOPLEVEL_DIRECTORY\fP but for the |
| component case. See \fBCPACK_INCLUDE_TOPLEVEL_DIRECTORY\fP |
| documentation for the detail. |
| .SS CPACK_CUSTOM_INSTALL_VARIABLES |
| .sp |
| New in version 3.21. |
| |
| .sp |
| CPack variables (set via e.g. \fBcpack \-D\fP, \fBCPackConfig.cmake\fP or |
| \fBCPACK_PROJECT_CONFIG_FILE\fP scripts) are not directly visible in |
| installation scripts. Instead, one can pass a list of \fBvarName=value\fP |
| pairs in the \fBCPACK_CUSTOM_INSTALL_VARIABLES\fP variable. At install time, |
| each list item will result in a variable of the specified name (\fBvarName\fP) |
| being set to the given \fBvalue\fP\&. The \fB=\fP can be omitted for an empty |
| \fBvalue\fP\&. |
| .sp |
| \fBCPACK_CUSTOM_INSTALL_VARIABLES\fP allows the packaging installation to be |
| influenced by the user or driving script at CPack runtime without having to |
| regenerate the install scripts. |
| .SS Example |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| install(FILES large.txt DESTINATION data) |
| |
| install(CODE [[ |
| if(ENABLE_COMPRESSION) |
| # "run\-compressor" is a fictional tool that produces |
| # large.txt.xz from large.txt and then removes the input file |
| execute_process(COMMAND run\-compressor $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/large.txt) |
| endif() |
| ]]) |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| With the above example snippet, \fBcpack\fP will by default |
| run the installation script with \fBENABLE_COMPRESSION\fP unset, resulting in |
| a package containing the uncompressed \fBlarge.txt\fP\&. This can be overridden |
| when invoking \fBcpack\fP like so: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| cpack \-D "CPACK_CUSTOM_INSTALL_VARIABLES=ENABLE_COMPRESSION=TRUE" |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| The installation script will then run with \fBENABLE_COMPRESSION\fP set to |
| \fBTRUE\fP, resulting in a package containing the compressed \fBlarge.txt.xz\fP |
| instead. |
| .SS CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION |
| .sp |
| Ask CPack to error out as soon as a file with absolute \fBINSTALL DESTINATION\fP |
| is encountered. |
| .sp |
| The fatal error is emitted before the installation of the offending |
| file takes place. Some CPack generators, like \fBNSIS\fP, enforce this |
| internally. This variable triggers the definition |
| of \fBCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION\fP when CPack |
| runs. |
| .SS CPACK_INCLUDE_TOPLEVEL_DIRECTORY |
| .sp |
| Boolean toggle to include/exclude top level directory. |
| .sp |
| When preparing a package CPack installs the item under the so\-called |
| top level directory. The purpose of is to include (set to \fB1\fP or \fBON\fP or |
| \fBTRUE\fP) the top level directory in the package or not (set to \fB0\fP or |
| \fBOFF\fP or \fBFALSE\fP). |
| .sp |
| 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\(aqt. The user may override the default value by |
| setting this variable. |
| .sp |
| There is a similar variable |
| \fBCPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY\fP 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. |
| .SS CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS |
| .sp |
| New in version 3.11. |
| |
| .sp |
| Default permissions for implicitly created directories during packaging. |
| .sp |
| This variable serves the same purpose during packaging as the |
| \fBCMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS\fP variable |
| serves during installation (e.g. \fBmake install\fP). |
| .sp |
| If \fIinclude(CPack)\fP is used then by default this variable is set to the content |
| of \fBCMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS\fP\&. |
| .SS CPACK_PACKAGING_INSTALL_PREFIX |
| .sp |
| The prefix used in the built package. |
| .sp |
| Each CPack generator has a default value (like \fB/usr\fP). This default |
| value may be overwritten from the \fBCMakeLists.txt\fP or the \fBcpack(1)\fP |
| command line by setting an alternative value. Example: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| This is not the same purpose as \fBCMAKE_INSTALL_PREFIX\fP which is used |
| when installing from the build tree without building a package. |
| .SS CPACK_SET_DESTDIR |
| .sp |
| Boolean toggle to make CPack use \fBDESTDIR\fP mechanism when packaging. |
| .sp |
| \fBDESTDIR\fP 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 |
| \fBCMAKE_INSTALL_PREFIX\fP documentation). It is usually invoked like |
| this: |
| .INDENT 0.0 |
| .INDENT 3.5 |
| .sp |
| .nf |
| .ft C |
| make DESTDIR=/home/john install |
| .ft P |
| .fi |
| .UNINDENT |
| .UNINDENT |
| .sp |
| which will install the concerned software using the installation |
| prefix, e.g. \fB/usr/local\fP prepended with the \fBDESTDIR\fP value which |
| finally gives \fB/home/john/usr/local\fP\&. When preparing a package, CPack |
| first installs the items to be packaged in a local (to the build tree) |
| directory by using the same \fBDESTDIR\fP mechanism. Nevertheless, if |
| \fBCPACK_SET_DESTDIR\fP is set then CPack will set \fBDESTDIR\fP before doing the |
| local install. The most noticeable difference is that without |
| \fBCPACK_SET_DESTDIR\fP, CPack uses \fBCPACK_PACKAGING_INSTALL_PREFIX\fP |
| as a prefix whereas with \fBCPACK_SET_DESTDIR\fP set, CPack will use |
| \fBCMAKE_INSTALL_PREFIX\fP as a prefix. |
| .sp |
| Manually setting \fBCPACK_SET_DESTDIR\fP may help (or simply be necessary) |
| if some install rules uses absolute \fBDESTINATION\fP (see CMake |
| \fBinstall()\fP command). However, starting with CPack/CMake 2.8.3 RPM |
| and DEB installers tries to handle \fBDESTDIR\fP automatically so that it is |
| seldom necessary for the user to set it. |
| .SS CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION |
| .sp |
| Ask CPack to warn each time a file with absolute \fBINSTALL DESTINATION\fP is |
| encountered. |
| .sp |
| This variable triggers the definition of |
| \fBCMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION\fP when CPack runs |
| \fBcmake_install.cmake\fP scripts. |
| .SH VARIABLE EXPANSION OPERATORS |
| .SS CACHE |
| .sp |
| New in version 3.13. |
| |
| .sp |
| Operator to read cache variables. |
| .sp |
| Use the syntax \fB$CACHE{VAR}\fP to read cache entry \fBVAR\fP\&. |
| See the cmake\-language(7) variables |
| documentation for more complete documentation of the interaction of |
| normal variables and cache entries. |
| .sp |
| When evaluating Variable References of the form \fB${VAR}\fP, |
| CMake first searches for a normal variable with that name, and if not |
| found CMake will search for a cache entry with that name. |
| The \fB$CACHE{VAR}\fP syntax can be used to do direct cache lookup and |
| ignore any existing normal variable. |
| .sp |
| See the \fBset()\fP and \fBunset()\fP commands to see how to |
| write or remove cache variables. |
| .SS ENV |
| .sp |
| Operator to read environment variables. |
| .sp |
| Use the syntax \fB$ENV{VAR}\fP to read environment variable \fBVAR\fP\&. |
| .sp |
| To test whether an environment variable is defined, use the signature |
| \fBif(DEFINED ENV{<name>})\fP of the \fBif()\fP command. |
| .sp |
| See the \fBset()\fP and \fBunset()\fP commands to see how to |
| write or remove environment variables. |
| .SH INTERNAL VARIABLES |
| .sp |
| CMake has many internal variables. Most of them are undocumented. |
| Some of them, however, were at some point described as normal |
| variables, and therefore may be encountered in legacy code. They |
| are subject to change, and not recommended for use in project code. |
| .SS CMAKE_HOME_DIRECTORY |
| .sp |
| Path to top of source tree. Same as \fBCMAKE_SOURCE_DIR\fP\&. |
| .sp |
| This is an internal cache entry used to locate the source directory |
| when loading a \fBCMakeCache.txt\fP from a build tree. It should not |
| be used in project code. The variable \fBCMAKE_SOURCE_DIR\fP |
| has the same value and should be preferred. |
| .SS CMAKE_INTERNAL_PLATFORM_ABI |
| .sp |
| An internal variable subject to change. |
| .sp |
| This is used in determining the compiler ABI and is subject to change. |
| .SS CMAKE_<LANG>_COMPILER_ABI |
| .sp |
| An internal variable subject to change. |
| .sp |
| This is used in determining the compiler ABI and is subject to change. |
| .SS CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID |
| .sp |
| New in version 3.10. |
| |
| .sp |
| An internal variable subject to change. |
| .sp |
| This is used to identify the variant of a compiler based on its target |
| architecture. For some compilers this is needed to determine the correct |
| usage. |
| .SS CMAKE_<LANG>_COMPILER_VERSION_INTERNAL |
| .sp |
| New in version 3.10. |
| |
| .sp |
| An internal variable subject to change. |
| .sp |
| This is used to identify the variant of a compiler based on an internal |
| version number. For some compilers this is needed to determine the |
| correct usage. |
| .SS CMAKE_<LANG>_LINKER_PREFERENCE |
| .sp |
| An internal variable subject to change. |
| .sp |
| Preference value for linker language selection. |
| .sp |
| The "linker language" for executable, shared library, and module |
| targets is the language whose compiler will invoke the linker. The |
| \fBLINKER_LANGUAGE\fP 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 \fBCMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES\fP variable. |
| .SS CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES |
| .sp |
| An internal variable subject to change. |
| .sp |
| True if \fBCMAKE_<LANG>_LINKER_PREFERENCE\fP propagates across targets. |
| .sp |
| 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. |
| .SS CMAKE_<LANG>_PLATFORM_ID |
| .sp |
| An internal variable subject to change. |
| .sp |
| This is used in determining the platform and is subject to change. |
| .SS CMAKE_NOT_USING_CONFIG_FLAGS |
| .sp |
| Skip \fB_BUILD_TYPE\fP flags if true. |
| .sp |
| This is an internal flag used by the generators in CMake to tell CMake |
| to skip the \fB_BUILD_TYPE\fP flags. |
| .SS CMAKE_VS_INTEL_Fortran_PROJECT_VERSION |
| .sp |
| When generating for \fBVisual Studio 9 2008\fP or greater with the Intel |
| Fortran plugin installed, this specifies the \fB\&.vfproj\fP project file format |
| version. This is intended for internal use by CMake and should not be |
| used by project code. |
| .SH COPYRIGHT |
| 2000-2022 Kitware, Inc. and Contributors |
| .\" Generated by docutils manpage writer. |
| . |