barrier/tool/win/cmake/doc/cmake-2.8/cmake-commands.html

573 lines
163 KiB
HTML

<html><head><title>cmake-commands - cmake</title></head><body>
<h2><a name="section_Index"/>Master Index CMake 2.8.0</h2>
<ul>
<li><a href="#section_Introduction"<b>Introduction</b></a></li>
<li><a href="#section_Commands"<b>Commands</b></a></li>
<li><a href="#section_Copyright"<b>Copyright</b></a></li>
<li><a href="#section_See Also"<b>See Also</b></a></li>
</ul>
<h2><a name="section_Introduction"/>Introduction</h2>
<ul>
</ul>
<p>cmake-commands - Reference of available CMake commands.
<h2><a name="section_Commands"/>Commands</h2>
<ul>
<li><a href="#command:add_custom_command"><b><code>add_custom_command</code></b></a></li> <li><a href="#command:add_custom_target"><b><code>add_custom_target</code></b></a></li> <li><a href="#command:add_definitions"><b><code>add_definitions</code></b></a></li> <li><a href="#command:add_dependencies"><b><code>add_dependencies</code></b></a></li> <li><a href="#command:add_executable"><b><code>add_executable</code></b></a></li> <li><a href="#command:add_library"><b><code>add_library</code></b></a></li> <li><a href="#command:add_subdirectory"><b><code>add_subdirectory</code></b></a></li> <li><a href="#command:add_test"><b><code>add_test</code></b></a></li> <li><a href="#command:aux_source_directory"><b><code>aux_source_directory</code></b></a></li> <li><a href="#command:break"><b><code>break</code></b></a></li> <li><a href="#command:build_command"><b><code>build_command</code></b></a></li> <li><a href="#command:cmake_minimum_required"><b><code>cmake_minimum_required</code></b></a></li> <li><a href="#command:cmake_policy"><b><code>cmake_policy</code></b></a></li> <li><a href="#command:configure_file"><b><code>configure_file</code></b></a></li> <li><a href="#command:create_test_sourcelist"><b><code>create_test_sourcelist</code></b></a></li> <li><a href="#command:define_property"><b><code>define_property</code></b></a></li> <li><a href="#command:else"><b><code>else</code></b></a></li> <li><a href="#command:elseif"><b><code>elseif</code></b></a></li> <li><a href="#command:enable_language"><b><code>enable_language</code></b></a></li> <li><a href="#command:enable_testing"><b><code>enable_testing</code></b></a></li> <li><a href="#command:endforeach"><b><code>endforeach</code></b></a></li> <li><a href="#command:endfunction"><b><code>endfunction</code></b></a></li> <li><a href="#command:endif"><b><code>endif</code></b></a></li> <li><a href="#command:endmacro"><b><code>endmacro</code></b></a></li> <li><a href="#command:endwhile"><b><code>endwhile</code></b></a></li> <li><a href="#command:execute_process"><b><code>execute_process</code></b></a></li> <li><a href="#command:export"><b><code>export</code></b></a></li> <li><a href="#command:file"><b><code>file</code></b></a></li> <li><a href="#command:find_file"><b><code>find_file</code></b></a></li> <li><a href="#command:find_library"><b><code>find_library</code></b></a></li> <li><a href="#command:find_package"><b><code>find_package</code></b></a></li> <li><a href="#command:find_path"><b><code>find_path</code></b></a></li> <li><a href="#command:find_program"><b><code>find_program</code></b></a></li> <li><a href="#command:fltk_wrap_ui"><b><code>fltk_wrap_ui</code></b></a></li> <li><a href="#command:foreach"><b><code>foreach</code></b></a></li> <li><a href="#command:function"><b><code>function</code></b></a></li> <li><a href="#command:get_cmake_property"><b><code>get_cmake_property</code></b></a></li> <li><a href="#command:get_directory_property"><b><code>get_directory_property</code></b></a></li> <li><a href="#command:get_filename_component"><b><code>get_filename_component</code></b></a></li> <li><a href="#command:get_property"><b><code>get_property</code></b></a></li> <li><a href="#command:get_source_file_property"><b><code>get_source_file_property</code></b></a></li> <li><a href="#command:get_target_property"><b><code>get_target_property</code></b></a></li> <li><a href="#command:get_test_property"><b><code>get_test_property</code></b></a></li> <li><a href="#command:if"><b><code>if</code></b></a></li> <li><a href="#command:include"><b><code>include</code></b></a></li> <li><a href="#command:include_directories"><b><code>include_directories</code></b></a></li> <li><a href="#command:include_external_msproject"><b><code>include_external_msproject</code></b></a></li> <li><a href="#command:include_regular_expression"><b><code>include_regular_expression</code></b></a></li> <li><a href="#command:install"><b><code>install</code></b></a></li> <li><a href="#command:link_directories"><b><code>link_directories</code></b></a></li> <li><a href="#command:list"><b><code>list</code></b></a></li> <li><a href="#command:load_cache"><b><code>load_cache</code></b></a></li> <li><a href="#command:load_command"><b><code>load_command</code></b></a></li> <li><a href="#command:macro"><b><code>macro</code></b></a></li> <li><a href="#command:mark_as_advanced"><b><code>mark_as_advanced</code></b></a></li> <li><a href="#command:math"><b><code>math</code></b></a></li> <li><a href="#command:message"><b><code>message</code></b></a></li> <li><a href="#command:option"><b><code>option</code></b></a></li> <li><a href="#command:output_required_files"><b><code>output_required_files</code></b></a></li> <li><a href="#command:project"><b><code>project</code></b></a></li> <li><a href="#command:qt_wrap_cpp"><b><code>qt_wrap_cpp</code></b></a></li> <li><a href="#command:qt_wrap_ui"><b><code>qt_wrap_ui</code></b></a></li> <li><a href="#command:remove_definitions"><b><code>remove_definitions</code></b></a></li> <li><a href="#command:return"><b><code>return</code></b></a></li> <li><a href="#command:separate_arguments"><b><code>separate_arguments</code></b></a></li> <li><a href="#command:set"><b><code>set</code></b></a></li> <li><a href="#command:set_directory_properties"><b><code>set_directory_properties</code></b></a></li> <li><a href="#command:set_property"><b><code>set_property</code></b></a></li> <li><a href="#command:set_source_files_properties"><b><code>set_source_files_properties</code></b></a></li> <li><a href="#command:set_target_properties"><b><code>set_target_properties</code></b></a></li> <li><a href="#command:set_tests_properties"><b><code>set_tests_properties</code></b></a></li> <li><a href="#command:site_name"><b><code>site_name</code></b></a></li> <li><a href="#command:source_group"><b><code>source_group</code></b></a></li> <li><a href="#command:string"><b><code>string</code></b></a></li> <li><a href="#command:target_link_libraries"><b><code>target_link_libraries</code></b></a></li> <li><a href="#command:try_compile"><b><code>try_compile</code></b></a></li> <li><a href="#command:try_run"><b><code>try_run</code></b></a></li> <li><a href="#command:unset"><b><code>unset</code></b></a></li> <li><a href="#command:variable_watch"><b><code>variable_watch</code></b></a></li> <li><a href="#command:while"><b><code>while</code></b></a></li></ul>
<ul>
<li>
<a name="command:add_custom_command"><b><code>add_custom_command</code></b></a>: Add a custom build rule to the generated build system.<br>
<p>There are two main signatures for add_custom_command The first signature is for adding a custom command to produce an output.<br><pre> add_custom_command(OUTPUT output1 [output2 ...]<br> COMMAND command1 [ARGS] [args1...]<br> [COMMAND command2 [ARGS] [args2...] ...]<br> [MAIN_DEPENDENCY depend]<br> [DEPENDS [depends...]]<br> [IMPLICIT_DEPENDS &lt;lang1&gt; depend1 ...]<br> [WORKING_DIRECTORY dir]<br> [COMMENT comment] [VERBATIM] [APPEND])<br></pre>
<p>This defines a command to generate specified OUTPUT file(s). A target created in the same directory (CMakeLists.txt file) that specifies any output of the custom command as a source file is given a rule to generate the file using the command at build time. If an output name is a relative path it will be interpreted relative to the build tree directory corresponding to the current source directory. Note that MAIN_DEPENDENCY is completely optional and is used as a suggestion to visual studio about where to hang the custom command. In makefile terms this creates a new target in the following form:<br><pre> OUTPUT: MAIN_DEPENDENCY DEPENDS<br> COMMAND<br></pre>
<p>If more than one command is specified they will be executed in order. The optional ARGS argument is for backward compatibility and will be ignored.<br><p>The second signature adds a custom command to a target such as a library or executable. This is useful for performing an operation before or after building the target. The command becomes part of the target and will only execute when the target itself is built. If the target is already built, the command will not execute.<br><pre> add_custom_command(TARGET target<br> PRE_BUILD | PRE_LINK | POST_BUILD<br> COMMAND command1 [ARGS] [args1...]<br> [COMMAND command2 [ARGS] [args2...] ...]<br> [WORKING_DIRECTORY dir]<br> [COMMENT comment] [VERBATIM])<br></pre>
<p>This defines a new command that will be associated with building the specified target. When the command will happen is determined by which of the following is specified:<br><pre> PRE_BUILD - run before all other dependencies<br> PRE_LINK - run after other dependencies<br> POST_BUILD - run after the target has been built<br></pre>
<p>Note that the PRE_BUILD option is only supported on Visual Studio 7 or later. For all other generators PRE_BUILD will be treated as PRE_LINK.<br><p>If WORKING_DIRECTORY is specified the command will be executed in the directory given. If COMMENT is set, the value will be displayed as a message before the commands are executed at build time. If APPEND is specified the COMMAND and DEPENDS option values are appended to the custom command for the first output specified. There must have already been a previous call to this command with the same output. The COMMENT, WORKING_DIRECTORY, and MAIN_DEPENDENCY options are currently ignored when APPEND is given, but may be used in the future.<br><p>If VERBATIM is given then all arguments to the commands will be escaped properly for the build tool so that the invoked command receives each argument unchanged. Note that one level of escapes is still used by the CMake language processor before add_custom_command even sees the arguments. Use of VERBATIM is recommended as it enables correct behavior. When VERBATIM is not given the behavior is platform specific because there is no protection of tool-specific special characters.<br><p>If the output of the custom command is not actually created as a file on disk it should be marked as SYMBOLIC with SET_SOURCE_FILES_PROPERTIES.<br><p>The IMPLICIT_DEPENDS option requests scanning of implicit dependencies of an input file. The language given specifies the programming language whose corresponding dependency scanner should be used. Currently only C and CXX language scanners are supported. Dependencies discovered from the scanning are added to those of the custom command at build time. Note that the IMPLICIT_DEPENDS option is currently supported only for Makefile generators and will be ignored by other generators.<br><p>If COMMAND specifies an executable target (created by ADD_EXECUTABLE) it will automatically be replaced by the location of the executable created at build time. Additionally a target-level dependency will be added so that the executable target will be built before any target using this custom command. However this does NOT add a file-level dependency that would cause the custom command to re-run whenever the executable is recompiled.<br><p>The DEPENDS option specifies files on which the command depends. If any dependency is an OUTPUT of another custom command in the same directory (CMakeLists.txt file) CMake automatically brings the other custom command into the target in which this command is built. If DEPENDS specifies any target (created by an ADD_* command) a target-level dependency is created to make sure the target is built before any target using this custom command. Additionally, if the target is an executable or library a file-level dependency is created to cause the custom command to re-run whenever the target is recompiled.<br>
</li>
<li>
<a name="command:add_custom_target"><b><code>add_custom_target</code></b></a>: Add a target with no output so it will always be built.<br>
<pre> add_custom_target(Name [ALL] [command1 [args1...]]<br> [COMMAND command2 [args2...] ...]<br> [DEPENDS depend depend depend ... ]<br> [WORKING_DIRECTORY dir]<br> [COMMENT comment] [VERBATIM]<br> [SOURCES src1 [src2...]])<br></pre>
<p>Adds a target with the given name that executes the given commands. The target has no output file and is ALWAYS CONSIDERED OUT OF DATE even if the commands try to create a file with the name of the target. Use ADD_CUSTOM_COMMAND to generate a file with dependencies. By default nothing depends on the custom target. Use ADD_DEPENDENCIES to add dependencies to or from other targets. If the ALL option is specified it indicates that this target should be added to the default build target so that it will be run every time (the command cannot be called ALL). The command and arguments are optional and if not specified an empty target will be created. If WORKING_DIRECTORY is set, then the command will be run in that directory. If COMMENT is set, the value will be displayed as a message before the commands are executed at build time. Dependencies listed with the DEPENDS argument may reference files and outputs of custom commands created with add_custom_command() in the same directory (CMakeLists.txt file).<br><p>If VERBATIM is given then all arguments to the commands will be escaped properly for the build tool so that the invoked command receives each argument unchanged. Note that one level of escapes is still used by the CMake language processor before add_custom_target even sees the arguments. Use of VERBATIM is recommended as it enables correct behavior. When VERBATIM is not given the behavior is platform specific because there is no protection of tool-specific special characters.<br><p>The SOURCES option specifies additional source files to be included in the custom target. Specified source files will be added to IDE project files for convenience in editing even if they have not build rules.
</li>
<li>
<a name="command:add_definitions"><b><code>add_definitions</code></b></a>: Adds -D define flags to the compilation of source files.<br>
<pre> add_definitions(-DFOO -DBAR ...)<br></pre>
<p>Adds flags to the compiler command line for sources in the current directory and below. This command can be used to add any flags, but it was originally intended to add preprocessor definitions. Flags beginning in -D or /D that look like preprocessor definitions are automatically added to the COMPILE_DEFINITIONS property for the current directory. Definitions with non-trival values may be left in the set of flags instead of being converted for reasons of backwards compatibility. See documentation of the directory, target, and source file COMPILE_DEFINITIONS properties for details on adding preprocessor definitions to specific scopes and configurations.
</li>
<li>
<a name="command:add_dependencies"><b><code>add_dependencies</code></b></a>: Add a dependency between top-level targets.<br>
<pre> add_dependencies(target-name depend-target1<br> depend-target2 ...)<br></pre>
<p>Make a top-level target depend on other top-level targets. A top-level target is one created by ADD_EXECUTABLE, ADD_LIBRARY, or ADD_CUSTOM_TARGET. Adding dependencies with this command can be used to make sure one target is built before another target. See the DEPENDS option of ADD_CUSTOM_TARGET and ADD_CUSTOM_COMMAND for adding file-level dependencies in custom rules. See the OBJECT_DEPENDS option in SET_SOURCE_FILES_PROPERTIES to add file-level dependencies to object files.
</li>
<li>
<a name="command:add_executable"><b><code>add_executable</code></b></a>: Add an executable to the project using the specified source files.<br>
<pre> add_executable(&lt;name&gt; [WIN32] [MACOSX_BUNDLE]<br> [EXCLUDE_FROM_ALL]<br> source1 source2 ... sourceN)<br></pre>
<p>Adds an executable target called &lt;name&gt; to be built from the source files listed in the command invocation. The &lt;name&gt; corresponds to the logical target name and must be globally unique within a project. The actual file name of the executable built is constructed based on conventions of the native platform (such as &lt;name&gt;.exe or just &lt;name&gt;). <br><p>By default the executable file will be created in the build tree directory corresponding to the source tree directory in which the command was invoked. See documentation of the RUNTIME_OUTPUT_DIRECTORY target property to change this location. See documentation of the OUTPUT_NAME target property to change the &lt;name&gt; part of the final file name. <br><p>If WIN32 is given the property WIN32_EXECUTABLE will be set on the target created. See documentation of that target property for details.<br><p>If MACOSX_BUNDLE is given the corresponding property will be set on the created target. See documentation of the MACOSX_BUNDLE target property for details.<br><p>If EXCLUDE_FROM_ALL is given the corresponding property will be set on the created target. See documentation of the EXCLUDE_FROM_ALL target property for details.<br><p>The add_executable command can also create IMPORTED executable targets using this signature:<br><pre> add_executable(&lt;name&gt; IMPORTED)<br></pre>
<p>An IMPORTED executable target references an executable file located outside the project. No rules are generated to build it. The target name has scope in the directory in which it is created and below. It may be referenced like any target built within the project. IMPORTED executables are useful for convenient reference from commands like add_custom_command. Details about the imported executable are specified by setting properties whose names begin in "IMPORTED_". The most important such property is IMPORTED_LOCATION (and its per-configuration version IMPORTED_LOCATION_&lt;CONFIG&gt;) which specifies the location of the main executable file on disk. See documentation of the IMPORTED_* properties for more information.
</li>
<li>
<a name="command:add_library"><b><code>add_library</code></b></a>: Add a library to the project using the specified source files.<br>
<pre> add_library(&lt;name&gt; [STATIC | SHARED | MODULE]<br> [EXCLUDE_FROM_ALL]<br> source1 source2 ... sourceN)<br></pre>
<p>Adds a library target called &lt;name&gt; to be built from the source files listed in the command invocation. The &lt;name&gt; corresponds to the logical target name and must be globally unique within a project. The actual file name of the library built is constructed based on conventions of the native platform (such as lib&lt;name&gt;.a or &lt;name&gt;.lib).<br><p>STATIC, SHARED, or MODULE may be given to specify the type of library to be created. STATIC libraries are archives of object files for use when linking other targets. SHARED libraries are linked dynamically and loaded at runtime. MODULE libraries are plugins that are not linked into other targets but may be loaded dynamically at runtime using dlopen-like functionality. If no type is given explicitly the type is STATIC or SHARED based on whether the current value of the variable BUILD_SHARED_LIBS is true.<br><p>By default the library file will be created in the build tree directory corresponding to the source tree directory in which the command was invoked. See documentation of the ARCHIVE_OUTPUT_DIRECTORY, LIBRARY_OUTPUT_DIRECTORY, and RUNTIME_OUTPUT_DIRECTORY target properties to change this location. See documentation of the OUTPUT_NAME target property to change the &lt;name&gt; part of the final file name. <br><p>If EXCLUDE_FROM_ALL is given the corresponding property will be set on the created target. See documentation of the EXCLUDE_FROM_ALL target property for details.<br><p>The add_library command can also create IMPORTED library targets using this signature:<br><pre> add_library(&lt;name&gt; &lt;SHARED|STATIC|MODULE|UNKNOWN&gt; IMPORTED)<br></pre>
<p>An IMPORTED library target references a library file located outside the project. No rules are generated to build it. The target name has scope in the directory in which it is created and below. It may be referenced like any target built within the project. IMPORTED libraries are useful for convenient reference from commands like target_link_libraries. Details about the imported library are specified by setting properties whose names begin in "IMPORTED_". The most important such property is IMPORTED_LOCATION (and its per-configuration version IMPORTED_LOCATION_&lt;CONFIG&gt;) which specifies the location of the main library file on disk. See documentation of the IMPORTED_* properties for more information.
</li>
<li>
<a name="command:add_subdirectory"><b><code>add_subdirectory</code></b></a>: Add a subdirectory to the build.<br>
<pre> add_subdirectory(source_dir [binary_dir] <br> [EXCLUDE_FROM_ALL])<br></pre>
<p>Add a subdirectory to the build. The source_dir specifies the directory in which the source CmakeLists.txt and code files are located. If it is a relative path it will be evaluated with respect to the current directory (the typical usage), but it may also be an absolute path. The binary_dir specifies the directory in which to place the output files. If it is a relative path it will be evaluated with respect to the current output directory, but it may also be an absolute path. If binary_dir is not specified, the value of source_dir, before expanding any relative path, will be used (the typical usage). The CMakeLists.txt file in the specified source directory will be processed immediately by CMake before processing in the current input file continues beyond this command.<br><p>If the EXCLUDE_FROM_ALL argument is provided then targets in the subdirectory will not be included in the ALL target of the parent directory by default, and will be excluded from IDE project files. Users must explicitly build targets in the subdirectory. This is meant for use when the subdirectory contains a separate part of the project that is useful but not necessary, such as a set of examples. Typically the subdirectory should contain its own project() command invocation so that a full build system will be generated in the subdirectory (such as a VS IDE solution file). Note that inter-target dependencies supercede this exclusion. If a target built by the parent project depends on a target in the subdirectory, the dependee target will be included in the parent project build system to satisfy the dependency.
</li>
<li>
<a name="command:add_test"><b><code>add_test</code></b></a>: Add a test to the project with the specified arguments.<br>
<pre> add_test(testname Exename arg1 arg2 ...)<br></pre>
<p>If the ENABLE_TESTING command has been run, this command adds a test target to the current directory. If ENABLE_TESTING has not been run, this command does nothing. The tests are run by the testing subsystem by executing Exename with the specified arguments. Exename can be either an executable built by this project or an arbitrary executable on the system (like tclsh). The test will be run with the current working directory set to the CMakeList.txt files corresponding directory in the binary tree.<br><pre> add_test(NAME &lt;name&gt; [CONFIGURATIONS [Debug|Release|...]]<br> COMMAND &lt;command&gt; [arg1 [arg2 ...]])<br></pre>
<p>If COMMAND specifies an executable target (created by add_executable) it will automatically be replaced by the location of the executable created at build time. If a CONFIGURATIONS option is given then the test will be executed only when testing under one of the named configurations.<br><p>Arguments after COMMAND may use "generator expressions" with the syntax "$&lt;...&gt;". These expressions are evaluted during build system generation and produce information specific to each generated build configuration. Valid expressions are:<br><pre> $&lt;CONFIGURATION&gt; = configuration name<br> $&lt;TARGET_FILE:tgt&gt; = main file (.exe, .so.1.2, .a)<br> $&lt;TARGET_LINKER_FILE:tgt&gt; = file used to link (.a, .lib, .so)<br> $&lt;TARGET_SONAME_FILE:tgt&gt; = file with soname (.so.3)<br></pre>
<p>where "tgt" is the name of a target. Target file expressions produce a full path, but _DIR and _NAME versions can produce the directory and file name components:<br><pre> $&lt;TARGET_FILE_DIR:tgt&gt;/$&lt;TARGET_FILE_NAME:tgt&gt;<br> $&lt;TARGET_LINKER_FILE_DIR:tgt&gt;/$&lt;TARGET_LINKER_FILE_NAME:tgt&gt;<br> $&lt;TARGET_SONAME_FILE_DIR:tgt&gt;/$&lt;TARGET_SONAME_FILE_NAME:tgt&gt;<br></pre>
<p>Example usage:<br><pre> add_test(NAME mytest<br> COMMAND testDriver --config $&lt;CONFIGURATION&gt;<br> --exe $&lt;TARGET_FILE:myexe&gt;)<br></pre>
<p>This creates a test "mytest" whose command runs a testDriver tool passing the configuration name and the full path to the executable file produced by target "myexe".
</li>
<li>
<a name="command:aux_source_directory"><b><code>aux_source_directory</code></b></a>: Find all source files in a directory.<br>
<pre> aux_source_directory(&lt;dir&gt; &lt;variable&gt;)<br></pre>
<p>Collects the names of all the source files in the specified directory and stores the list in the &lt;variable&gt; provided. This command is intended to be used by projects that use explicit template instantiation. Template instantiation files can be stored in a "Templates" subdirectory and collected automatically using this command to avoid manually listing all instantiations.<br><p>It is tempting to use this command to avoid writing the list of source files for a library or executable target. While this seems to work, there is no way for CMake to generate a build system that knows when a new source file has been added. Normally the generated build system knows when it needs to rerun CMake because the CMakeLists.txt file is modified to add a new source. When the source is just added to the directory without modifying this file, one would have to manually rerun CMake to generate a build system incorporating the new file.
</li>
<li>
<a name="command:break"><b><code>break</code></b></a>: Break from an enclosing foreach or while loop.<br>
<pre> break()<br></pre>
<p>Breaks from an enclosing foreach loop or while loop
</li>
<li>
<a name="command:build_command"><b><code>build_command</code></b></a>: Get the command line that will build this project.<br>
<pre> build_command(&lt;variable&gt; &lt;makecommand&gt;)<br></pre>
<p>Sets the given &lt;variable&gt; to a string containing the command that will build this project from the root of the build tree using the build tool given by &lt;makecommand&gt;. &lt;makecommand&gt; should be msdev, nmake, make or one of the end user build tools. This is useful for configuring testing systems.
</li>
<li>
<a name="command:cmake_minimum_required"><b><code>cmake_minimum_required</code></b></a>: Set the minimum required version of cmake for a project.<br>
<pre> cmake_minimum_required(VERSION major[.minor[.patch]]<br> [FATAL_ERROR])<br></pre>
<p>If the current version of CMake is lower than that required it will stop processing the project and report an error. When a version higher than 2.4 is specified the command implicitly invokes<br><pre> cmake_policy(VERSION major[.minor[.patch]])<br></pre>
<p>which sets the cmake policy version level to the version specified. When version 2.4 or lower is given the command implicitly invokes<br><pre> cmake_policy(VERSION 2.4)<br></pre>
<p>which enables compatibility features for CMake 2.4 and lower.<br><p>The FATAL_ERROR option is accepted but ignored by CMake 2.6 and higher. It should be specified so CMake versions 2.4 and lower fail with an error instead of just a warning.
</li>
<li>
<a name="command:cmake_policy"><b><code>cmake_policy</code></b></a>: Manage CMake Policy settings.<br>
<p>As CMake evolves it is sometimes necessary to change existing behavior in order to fix bugs or improve implementations of existing features. The CMake Policy mechanism is designed to help keep existing projects building as new versions of CMake introduce changes in behavior. Each new policy (behavioral change) is given an identifier of the form "CMP&lt;NNNN&gt;" where "&lt;NNNN&gt;" is an integer index. Documentation associated with each policy describes the OLD and NEW behavior and the reason the policy was introduced. Projects may set each policy to select the desired behavior. When CMake needs to know which behavior to use it checks for a setting specified by the project. If no setting is available the OLD behavior is assumed and a warning is produced requesting that the policy be set.<br><p>The cmake_policy command is used to set policies to OLD or NEW behavior. While setting policies individually is supported, we encourage projects to set policies based on CMake versions.<br><pre> cmake_policy(VERSION major.minor[.patch])<br></pre>
<p>Specify that the current CMake list file is written for the given version of CMake. All policies introduced in the specified version or earlier will be set to use NEW behavior. All policies introduced after the specified version will be unset. This effectively requests behavior preferred as of a given CMake version and tells newer CMake versions to warn about their new policies. The policy version specified must be at least 2.4 or the command will report an error. In order to get compatibility features supporting versions earlier than 2.4 see documentation of policy CMP0001.<br><pre> cmake_policy(SET CMP&lt;NNNN&gt; NEW)<br> cmake_policy(SET CMP&lt;NNNN&gt; OLD)<br></pre>
<p>Tell CMake to use the OLD or NEW behavior for a given policy. Projects depending on the old behavior of a given policy may silence a policy warning by setting the policy state to OLD. Alternatively one may fix the project to work with the new behavior and set the policy state to NEW.<br><pre> cmake_policy(GET CMP&lt;NNNN&gt; &lt;variable&gt;)<br></pre>
<p>Check whether a given policy is set to OLD or NEW behavior. The output variable value will be "OLD" or "NEW" if the policy is set, and empty otherwise.<br><p>CMake keeps policy settings on a stack, so changes made by the cmake_policy command affect only the top of the stack. A new entry on the policy stack is managed automatically for each subdirectory to protect its parents and siblings. CMake also manages a new entry for scripts loaded by include() and find_package() commands except when invoked with the NO_POLICY_SCOPE option (see also policy CMP0011). The cmake_policy command provides an interface to manage custom entries on the policy stack:<br><pre> cmake_policy(PUSH)<br> cmake_policy(POP)<br></pre>
<p>Each PUSH must have a matching POP to erase any changes. This is useful to make temporary changes to policy settings.<br><p>Functions and macros record policy settings when they are created and use the pre-record policies when they are invoked. If the function or macro implementation sets policies, the changes automatically propagate up through callers until they reach the closest nested policy stack entry.
</li>
<li>
<a name="command:configure_file"><b><code>configure_file</code></b></a>: Copy a file to another location and modify its contents.<br>
<pre> configure_file(&lt;input&gt; &lt;output&gt;<br> [COPYONLY] [ESCAPE_QUOTES] [@ONLY])<br></pre>
<p>Copies a file &lt;input&gt; to file &lt;output&gt; and substitutes variable values referenced in the file content. If &lt;input&gt; is a relative path it is evaluated with respect to the current source directory. The &lt;input&gt; must be a file, not a directory. If &lt;output&gt; is a relative path it is evaluated with respect to the current binary directory. If &lt;output&gt; names an existing directory the input file is placed in that directory with its original name. <br><p>This command replaces any variables in the input file referenced as ${VAR} or @VAR@ with their values as determined by CMake. If a variable is not defined, it will be replaced with nothing. If COPYONLY is specified, then no variable expansion will take place. If ESCAPE_QUOTES is specified then any substituted quotes will be C-style escaped. The file will be configured with the current values of CMake variables. If @ONLY is specified, only variables of the form @VAR@ will be replaces and ${VAR} will be ignored. This is useful for configuring scripts that use ${VAR}. Any occurrences of #cmakedefine VAR will be replaced with either #define VAR or /* #undef VAR */ depending on the setting of VAR in CMake. Any occurrences of #cmakedefine01 VAR will be replaced with either #define VAR 1 or #define VAR 0 depending on whether VAR evaluates to TRUE or FALSE in CMake
</li>
<li>
<a name="command:create_test_sourcelist"><b><code>create_test_sourcelist</code></b></a>: Create a test driver and source list for building test programs.<br>
<pre> create_test_sourcelist(sourceListName driverName<br> test1 test2 test3<br> EXTRA_INCLUDE include.h<br> FUNCTION function)<br></pre>
<p>A test driver is a program that links together many small tests into a single executable. This is useful when building static executables with large libraries to shrink the total required size. The list of source files needed to build the test driver will be in sourceListName. DriverName is the name of the test driver program. The rest of the arguments consist of a list of test source files, can be semicolon separated. Each test source file should have a function in it that is the same name as the file with no extension (foo.cxx should have int foo(int, char*[]);) DriverName will be able to call each of the tests by name on the command line. If EXTRA_INCLUDE is specified, then the next argument is included into the generated file. If FUNCTION is specified, then the next argument is taken as a function name that is passed a pointer to ac and av. This can be used to add extra command line processing to each test. The cmake variable CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be placed directly before calling the test main function. CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be placed directly after the call to the test main function.
</li>
<li>
<a name="command:define_property"><b><code>define_property</code></b></a>: Define and document custom properties.<br>
<pre> define_property(&lt;GLOBAL | DIRECTORY | TARGET | SOURCE |<br> TEST | VARIABLE | CACHED_VARIABLE&gt;<br> PROPERTY &lt;name&gt; [INHERITED]<br> BRIEF_DOCS &lt;brief-doc&gt; [docs...]<br> FULL_DOCS &lt;full-doc&gt; [docs...])<br></pre>
<p>Define one property in a scope for use with the set_property and get_property commands. This is primarily useful to associate documentation with property names that may be retrieved with the get_property command. The first argument determines the kind of scope in which the property should be used. It must be one of the following:<br><pre> GLOBAL = associated with the global namespace<br> DIRECTORY = associated with one directory<br> TARGET = associated with one target<br> SOURCE = associated with one source file<br> TEST = associated with a test named with add_test<br> VARIABLE = documents a CMake language variable<br> CACHED_VARIABLE = documents a CMake cache variable<br></pre>
<p>Note that unlike set_property and get_property no actual scope needs to be given; only the kind of scope is important.<br><p>The required PROPERTY option is immediately followed by the name of the property being defined.<br><p>If the INHERITED option then the get_property command will chain up to the next higher scope when the requested property is not set in the scope given to the command. DIRECTORY scope chains to GLOBAL. TARGET, SOURCE, and TEST chain to DIRECTORY.<br><p>The BRIEF_DOCS and FULL_DOCS options are followed by strings to be associated with the property as its brief and full documentation. Corresponding options to the get_property command will retrieve the documentation.
</li>
<li>
<a name="command:else"><b><code>else</code></b></a>: Starts the else portion of an if block.<br>
<pre> else(expression)<br></pre>
<p>See the if command.
</li>
<li>
<a name="command:elseif"><b><code>elseif</code></b></a>: Starts the elseif portion of an if block.<br>
<pre> elseif(expression)<br></pre>
<p>See the if command.
</li>
<li>
<a name="command:enable_language"><b><code>enable_language</code></b></a>: Enable a language (CXX/C/Fortran/etc)<br>
<pre> enable_language(languageName [OPTIONAL] )<br></pre>
<p>This command enables support for the named language in CMake. This is the same as the project command but does not create any of the extra variables that are created by the project command. Example languages are CXX, C, Fortran. If OPTIONAL is used, use the CMAKE_&lt;languageName&gt;_COMPILER_WORKS variable to check whether the language has been enabled successfully.
</li>
<li>
<a name="command:enable_testing"><b><code>enable_testing</code></b></a>: Enable testing for current directory and below.<br>
<pre> enable_testing()<br></pre>
<p>Enables testing for this directory and below. See also the add_test command. Note that ctest expects to find a test file in the build directory root. Therefore, this command should be in the source directory root.
</li>
<li>
<a name="command:endforeach"><b><code>endforeach</code></b></a>: Ends a list of commands in a FOREACH block.<br>
<pre> endforeach(expression)<br></pre>
<p>See the FOREACH command.
</li>
<li>
<a name="command:endfunction"><b><code>endfunction</code></b></a>: Ends a list of commands in a function block.<br>
<pre> endfunction(expression)<br></pre>
<p>See the function command.
</li>
<li>
<a name="command:endif"><b><code>endif</code></b></a>: Ends a list of commands in an if block.<br>
<pre> endif(expression)<br></pre>
<p>See the if command.
</li>
<li>
<a name="command:endmacro"><b><code>endmacro</code></b></a>: Ends a list of commands in a macro block.<br>
<pre> endmacro(expression)<br></pre>
<p>See the macro command.
</li>
<li>
<a name="command:endwhile"><b><code>endwhile</code></b></a>: Ends a list of commands in a while block.<br>
<pre> endwhile(expression)<br></pre>
<p>See the while command.
</li>
<li>
<a name="command:execute_process"><b><code>execute_process</code></b></a>: Execute one or more child processes.<br>
<pre> execute_process(COMMAND &lt;cmd1&gt; [args1...]]<br> [COMMAND &lt;cmd2&gt; [args2...] [...]]<br> [WORKING_DIRECTORY &lt;directory&gt;]<br> [TIMEOUT &lt;seconds&gt;]<br> [RESULT_VARIABLE &lt;variable&gt;]<br> [OUTPUT_VARIABLE &lt;variable&gt;]<br> [ERROR_VARIABLE &lt;variable&gt;]<br> [INPUT_FILE &lt;file&gt;]<br> [OUTPUT_FILE &lt;file&gt;]<br> [ERROR_FILE &lt;file&gt;]<br> [OUTPUT_QUIET]<br> [ERROR_QUIET]<br> [OUTPUT_STRIP_TRAILING_WHITESPACE]<br> [ERROR_STRIP_TRAILING_WHITESPACE])<br></pre>
<p>Runs the given sequence of one or more commands with the standard output of each process piped to the standard input of the next. A single standard error pipe is used for all processes. If WORKING_DIRECTORY is given the named directory will be set as the current working directory of the child processes. If TIMEOUT is given the child processes will be terminated if they do not finish in the specified number of seconds (fractions are allowed). If RESULT_VARIABLE is given the variable will be set to contain the result of running the processes. This will be an integer return code from the last child or a string describing an error condition. If OUTPUT_VARIABLE or ERROR_VARIABLE are given the variable named will be set with the contents of the standard output and standard error pipes respectively. If the same variable is named for both pipes their output will be merged in the order produced. If INPUT_FILE, OUTPUT_FILE, or ERROR_FILE is given the file named will be attached to the standard input of the first process, standard output of the last process, or standard error of all processes respectively. If OUTPUT_QUIET or ERROR_QUIET is given then the standard output or standard error results will be quietly ignored. If more than one OUTPUT_* or ERROR_* option is given for the same pipe the precedence is not specified. If no OUTPUT_* or ERROR_* options are given the output will be shared with the corresponding pipes of the CMake process itself.<br><p>The execute_process command is a newer more powerful version of exec_program, but the old command has been kept for compatibility.
</li>
<li>
<a name="command:export"><b><code>export</code></b></a>: Export targets from the build tree for use by outside projects.<br>
<pre> export(TARGETS [target1 [target2 [...]]] [NAMESPACE &lt;namespace&gt;]<br> [APPEND] FILE &lt;filename&gt;)<br></pre>
<p>Create a file &lt;filename&gt; that may be included by outside projects to import targets from the current project's build tree. This is useful during cross-compiling to build utility executables that can run on the host platform in one project and then import them into another project being compiled for the target platform. If the NAMESPACE option is given the &lt;namespace&gt; string will be prepended to all target names written to the file. If the APPEND option is given the generated code will be appended to the file instead of overwriting it. If a library target is included in the export but a target to which it links is not included the behavior is unspecified.<br><p>The file created by this command is specific to the build tree and should never be installed. See the install(EXPORT) command to export targets from an installation tree.<br><pre> export(PACKAGE &lt;name&gt;)<br></pre>
<p>Store the current build directory in the CMake user package registry for package &lt;name&gt;. The find_package command may consider the directory while searching for package &lt;name&gt;. This helps dependent projects find and use a package from the current project's build tree without help from the user. Note that the entry in the package registry that this command creates works only in conjunction with a package configuration file (&lt;name&gt;Config.cmake) that works with the build tree.
</li>
<li>
<a name="command:file"><b><code>file</code></b></a>: File manipulation command.<br>
<pre> file(WRITE filename "message to write"... )<br> file(APPEND filename "message to write"... )<br> file(READ filename variable [LIMIT numBytes] [OFFSET offset] [HEX])<br> file(STRINGS filename variable [LIMIT_COUNT num]<br> [LIMIT_INPUT numBytes] [LIMIT_OUTPUT numBytes]<br> [LENGTH_MINIMUM numBytes] [LENGTH_MAXIMUM numBytes]<br> [NEWLINE_CONSUME] [REGEX regex]<br> [NO_HEX_CONVERSION])<br> file(GLOB variable [RELATIVE path] [globbing expressions]...)<br> file(GLOB_RECURSE variable [RELATIVE path] <br> [FOLLOW_SYMLINKS] [globbing expressions]...)<br> file(RENAME &lt;oldname&gt; &lt;newname&gt;)<br> file(REMOVE [file1 ...])<br> file(REMOVE_RECURSE [file1 ...])<br> file(MAKE_DIRECTORY [directory1 directory2 ...])<br> file(RELATIVE_PATH variable directory file)<br> file(TO_CMAKE_PATH path result)<br> file(TO_NATIVE_PATH path result)<br> file(DOWNLOAD url file [TIMEOUT timeout] [STATUS status] [LOG log])<br></pre>
<p>WRITE will write a message into a file called 'filename'. It overwrites the file if it already exists, and creates the file if it does not exist.<br><p>APPEND will write a message into a file same as WRITE, except it will append it to the end of the file<br><p>READ will read the content of a file and store it into the variable. It will start at the given offset and read up to numBytes. If the argument HEX is given, the binary data will be converted to hexadecimal representation and this will be stored in the variable.<br><p>STRINGS will parse a list of ASCII strings from a file and store it in a variable. Binary data in the file are ignored. Carriage return (CR) characters are ignored. It works also for Intel Hex and Motorola S-record files, which are automatically converted to binary format when reading them. Disable this using NO_HEX_CONVERSION.<br><p>LIMIT_COUNT sets the maximum number of strings to return. LIMIT_INPUT sets the maximum number of bytes to read from the input file. LIMIT_OUTPUT sets the maximum number of bytes to store in the output variable. LENGTH_MINIMUM sets the minimum length of a string to return. Shorter strings are ignored. LENGTH_MAXIMUM sets the maximum length of a string to return. Longer strings are split into strings no longer than the maximum length. NEWLINE_CONSUME allows newlines to be included in strings instead of terminating them.<br><p>REGEX specifies a regular expression that a string must match to be returned. Typical usage <br><pre> file(STRINGS myfile.txt myfile)<br></pre>
<p>stores a list in the variable "myfile" in which each item is a line from the input file.<br><p>GLOB will generate a list of all files that match the globbing expressions and store it into the variable. Globbing expressions are similar to regular expressions, but much simpler. If RELATIVE flag is specified for an expression, the results will be returned as a relative path to the given path.<br><p>Examples of globbing expressions include:<br><pre> *.cxx - match all files with extension cxx<br> *.vt? - match all files with extension vta,...,vtz<br> f[3-5].txt - match files f3.txt, f4.txt, f5.txt<br></pre>
<p>GLOB_RECURSE will generate a list similar to the regular GLOB, except it will traverse all the subdirectories of the matched directory and match the files. Subdirectories that are symlinks are only traversed if FOLLOW_SYMLINKS is given or cmake policy CMP0009 is not set to NEW. See cmake --help-policy CMP0009 for more information.<br><p>Examples of recursive globbing include:<br><pre> /dir/*.py - match all python files in /dir and subdirectories<br></pre>
<p>MAKE_DIRECTORY will create the given directories, also if their parent directories don't exist yet<br><p>RENAME moves a file or directory within a filesystem, replacing the destination atomically.<br><p>REMOVE will remove the given files, also in subdirectories<br><p>REMOVE_RECURSE will remove the given files and directories, also non-empty directories<br><p>RELATIVE_PATH will determine relative path from directory to the given file.<br><p>TO_CMAKE_PATH will convert path into a cmake style path with unix /. The input can be a single path or a system path like "$ENV{PATH}". Note the double quotes around the ENV call TO_CMAKE_PATH only takes one argument.<br><p>TO_NATIVE_PATH works just like TO_CMAKE_PATH, but will convert from a cmake style path into the native path style \ for windows and / for UNIX.<br><p>DOWNLOAD will download the given URL to the given file. If LOG var is specified a log of the download will be put in var. If STATUS var is specified the status of the operation will be put in var. The status is returned in a list of length 2. The first element is the numeric return value for the operation, and the second element is a string value for the error. A 0 numeric error means no error in the operation. If TIMEOUT time is specified, the operation will timeout after time seconds, time should be specified as an integer.<br><p>The file() command also provides COPY and INSTALL signatures:<br><pre> file(&lt;COPY|INSTALL&gt; files... DESTINATION &lt;dir&gt;<br> [FILE_PERMISSIONS permissions...]<br> [DIRECTORY_PERMISSIONS permissions...]<br> [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]<br> [FILES_MATCHING]<br> [[PATTERN &lt;pattern&gt; | REGEX &lt;regex&gt;]<br> [EXCLUDE] [PERMISSIONS permissions...]] [...])<br></pre>
<p>The COPY signature copies files, directories, and symlinks to a destination folder. Relative input paths are evaluated with respect to the current source directory, and a relative destination is evaluated with respect to the current build directory. Copying preserves input file timestamps, and optimizes out a file if it exists at the destination with the same timestamp. Copying preserves input permissions unless explicit permissions or NO_SOURCE_PERMISSIONS are given (default is USE_SOURCE_PERMISSIONS). See the install(DIRECTORY) command for documentation of permissions, PATTERN, REGEX, and EXCLUDE options. <br><p>The INSTALL signature differs slightly from COPY: it prints status messages, and NO_SOURCE_PERMISSIONS is default. Installation scripts generated by the install() command use this signature (with some undocumented options for internal use).
</li>
<li>
<a name="command:find_file"><b><code>find_file</code></b></a>: Find the full path to a file.<br>
<pre> find_file(&lt;VAR&gt; name1 [path1 path2 ...])<br></pre>
<p>This is the short-hand signature for the command that is sufficient in many cases. It is the same as find_file(&lt;VAR&gt; name1 [PATHS path1 path2 ...])<br><pre> find_file(<br> &lt;VAR&gt;<br> name | NAMES name1 [name2 ...]<br> [HINTS path1 [path2 ... ENV var]]<br> [PATHS path1 [path2 ... ENV var]]<br> [PATH_SUFFIXES suffix1 [suffix2 ...]]<br> [DOC "cache documentation string"]<br> [NO_DEFAULT_PATH]<br> [NO_CMAKE_ENVIRONMENT_PATH]<br> [NO_CMAKE_PATH]<br> [NO_SYSTEM_ENVIRONMENT_PATH]<br> [NO_CMAKE_SYSTEM_PATH]<br> [CMAKE_FIND_ROOT_PATH_BOTH |<br> ONLY_CMAKE_FIND_ROOT_PATH |<br> NO_CMAKE_FIND_ROOT_PATH]<br> )<br></pre>
<p>This command is used to find a full path to named file. A cache entry named by &lt;VAR&gt; is created to store the result of this command. If the full path to a file is found the result is stored in the variable and the search will not be repeated unless the variable is cleared. If nothing is found, the result will be &lt;VAR&gt;-NOTFOUND, and the search will be attempted again the next time find_file is invoked with the same variable. The name of the full path to a file that is searched for is specified by the names listed after the NAMES argument. Additional search locations can be specified after the PATHS argument. If ENV var is found in the HINTS or PATHS section the environment variable var will be read and converted from a system environment variable to a cmake style list of paths. For example ENV PATH would be a way to list the system path variable. The argument after DOC will be used for the documentation string in the cache. PATH_SUFFIXES specifies additional subdirectories to check below each search path.<br><p>If NO_DEFAULT_PATH is specified, then no additional paths are added to the search. If NO_DEFAULT_PATH is not specified, the search process is as follows:<br><p>1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.<br><pre> &lt;prefix&gt;/include for each &lt;prefix&gt; in CMAKE_PREFIX_PATH<br> CMAKE_INCLUDE_PATH<br> CMAKE_FRAMEWORK_PATH<br></pre>
<p>2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.<br><pre> &lt;prefix&gt;/include for each &lt;prefix&gt; in CMAKE_PREFIX_PATH<br> CMAKE_INCLUDE_PATH<br> CMAKE_FRAMEWORK_PATH<br></pre>
<p>3. Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.<br><p>4. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.<br><pre> PATH<br> INCLUDE<br></pre>
<p>5. Search cmake variables defined in the Platform files for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is passed.<br><pre> &lt;prefix&gt;/include for each &lt;prefix&gt; in CMAKE_SYSTEM_PREFIX_PATH<br> CMAKE_SYSTEM_INCLUDE_PATH<br> CMAKE_SYSTEM_FRAMEWORK_PATH<br></pre>
<p>6. Search the paths specified by the PATHS option or in the short-hand version of the command. These are typically hard-coded guesses.<br><p>On Darwin or systems supporting OS X Frameworks, the cmake variable CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:<br><pre> "FIRST" - Try to find frameworks before standard<br> libraries or headers. This is the default on Darwin.<br> "LAST" - Try to find frameworks after standard<br> libraries or headers.<br> "ONLY" - Only try to find frameworks.<br> "NEVER" - Never try to find frameworks.<br></pre>
<p>On Darwin or systems supporting OS X Application Bundles, the cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:<br><pre> "FIRST" - Try to find application bundles before standard<br> programs. This is the default on Darwin.<br> "LAST" - Try to find application bundles after standard<br> programs.<br> "ONLY" - Only try to find application bundles.<br> "NEVER" - Never try to find application bundles.<br></pre>
<p>The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. By default it is empty. It is especially useful when cross-compiling to point to the root directory of the target environment and CMake will search there too. By default at first the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be searched. The default behavior can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE. This behavior can be manually overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as described above. If NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted directories will be searched.<br><p>The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:<br><pre> find_file(&lt;VAR&gt; NAMES name PATHS paths... NO_DEFAULT_PATH)<br> find_file(&lt;VAR&gt; NAMES name)<br></pre>
<p>Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
</li>
<li>
<a name="command:find_library"><b><code>find_library</code></b></a>: Find a library.<br>
<pre> find_library(&lt;VAR&gt; name1 [path1 path2 ...])<br></pre>
<p>This is the short-hand signature for the command that is sufficient in many cases. It is the same as find_library(&lt;VAR&gt; name1 [PATHS path1 path2 ...])<br><pre> find_library(<br> &lt;VAR&gt;<br> name | NAMES name1 [name2 ...]<br> [HINTS path1 [path2 ... ENV var]]<br> [PATHS path1 [path2 ... ENV var]]<br> [PATH_SUFFIXES suffix1 [suffix2 ...]]<br> [DOC "cache documentation string"]<br> [NO_DEFAULT_PATH]<br> [NO_CMAKE_ENVIRONMENT_PATH]<br> [NO_CMAKE_PATH]<br> [NO_SYSTEM_ENVIRONMENT_PATH]<br> [NO_CMAKE_SYSTEM_PATH]<br> [CMAKE_FIND_ROOT_PATH_BOTH |<br> ONLY_CMAKE_FIND_ROOT_PATH |<br> NO_CMAKE_FIND_ROOT_PATH]<br> )<br></pre>
<p>This command is used to find a library. A cache entry named by &lt;VAR&gt; is created to store the result of this command. If the library is found the result is stored in the variable and the search will not be repeated unless the variable is cleared. If nothing is found, the result will be &lt;VAR&gt;-NOTFOUND, and the search will be attempted again the next time find_library is invoked with the same variable. The name of the library that is searched for is specified by the names listed after the NAMES argument. Additional search locations can be specified after the PATHS argument. If ENV var is found in the HINTS or PATHS section the environment variable var will be read and converted from a system environment variable to a cmake style list of paths. For example ENV PATH would be a way to list the system path variable. The argument after DOC will be used for the documentation string in the cache. PATH_SUFFIXES specifies additional subdirectories to check below each search path.<br><p>If NO_DEFAULT_PATH is specified, then no additional paths are added to the search. If NO_DEFAULT_PATH is not specified, the search process is as follows:<br><p>1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.<br><pre> &lt;prefix&gt;/lib for each &lt;prefix&gt; in CMAKE_PREFIX_PATH<br> CMAKE_LIBRARY_PATH<br> CMAKE_FRAMEWORK_PATH<br></pre>
<p>2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.<br><pre> &lt;prefix&gt;/lib for each &lt;prefix&gt; in CMAKE_PREFIX_PATH<br> CMAKE_LIBRARY_PATH<br> CMAKE_FRAMEWORK_PATH<br></pre>
<p>3. Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.<br><p>4. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.<br><pre> PATH<br> LIB<br></pre>
<p>5. Search cmake variables defined in the Platform files for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is passed.<br><pre> &lt;prefix&gt;/lib for each &lt;prefix&gt; in CMAKE_SYSTEM_PREFIX_PATH<br> CMAKE_SYSTEM_LIBRARY_PATH<br> CMAKE_SYSTEM_FRAMEWORK_PATH<br></pre>
<p>6. Search the paths specified by the PATHS option or in the short-hand version of the command. These are typically hard-coded guesses.<br><p>On Darwin or systems supporting OS X Frameworks, the cmake variable CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:<br><pre> "FIRST" - Try to find frameworks before standard<br> libraries or headers. This is the default on Darwin.<br> "LAST" - Try to find frameworks after standard<br> libraries or headers.<br> "ONLY" - Only try to find frameworks.<br> "NEVER" - Never try to find frameworks.<br></pre>
<p>On Darwin or systems supporting OS X Application Bundles, the cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:<br><pre> "FIRST" - Try to find application bundles before standard<br> programs. This is the default on Darwin.<br> "LAST" - Try to find application bundles after standard<br> programs.<br> "ONLY" - Only try to find application bundles.<br> "NEVER" - Never try to find application bundles.<br></pre>
<p>The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. By default it is empty. It is especially useful when cross-compiling to point to the root directory of the target environment and CMake will search there too. By default at first the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be searched. The default behavior can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_LIBRARY. This behavior can be manually overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as described above. If NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted directories will be searched.<br><p>The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:<br><pre> find_library(&lt;VAR&gt; NAMES name PATHS paths... NO_DEFAULT_PATH)<br> find_library(&lt;VAR&gt; NAMES name)<br></pre>
<p>Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.<br><p>If the library found is a framework, then VAR will be set to the full path to the framework &lt;fullPath&gt;/A.framework. When a full path to a framework is used as a library, CMake will use a -framework A, and a -F&lt;fullPath&gt; to link the framework to the target.
</li>
<li>
<a name="command:find_package"><b><code>find_package</code></b></a>: Load settings for an external project.<br>
<pre> find_package(&lt;package&gt; [version] [EXACT] [QUIET]<br> [[REQUIRED|COMPONENTS] [components...]]<br> [NO_POLICY_SCOPE])<br></pre>
<p>Finds and loads settings from an external project. &lt;package&gt;_FOUND will be set to indicate whether the package was found. When the package is found package-specific information is provided through variables documented by the package itself. The QUIET option disables messages if the package cannot be found. The REQUIRED option stops processing with an error message if the package cannot be found. A package-specific list of components may be listed after the REQUIRED option or after the COMPONENTS option if no REQUIRED option is given. The [version] argument requests a version with which the package found should be compatible (format is major[.minor[.patch[.tweak]]]). The EXACT option requests that the version be matched exactly. If no [version] is given to a recursive invocation inside a find-module, the [version] and EXACT arguments are forwarded automatically from the outer call. Version support is currently provided only on a package-by-package basis (details below).<br><p>User code should generally look for packages using the above simple signature. The remainder of this command documentation specifies the full command signature and details of the search process. Project maintainers wishing to provide a package to be found by this command are encouraged to read on.<br><p>The command has two modes by which it searches for packages: "Module" mode and "Config" mode. Module mode is available when the command is invoked with the above reduced signature. CMake searches for a file called "Find&lt;package&gt;.cmake" in the CMAKE_MODULE_PATH followed by the CMake installation. If the file is found, it is read and processed by CMake. It is responsible for finding the package, checking the version, and producing any needed messages. Many find-modules provide limited or no support for versioning; check the module documentation. If no module is found the command proceeds to Config mode.<br><p>The complete Config mode command signature is:<br><pre> find_package(&lt;package&gt; [version] [EXACT] [QUIET]<br> [[REQUIRED|COMPONENTS] [components...]] [NO_MODULE]<br> [NO_POLICY_SCOPE]<br> [NAMES name1 [name2 ...]]<br> [CONFIGS config1 [config2 ...]]<br> [HINTS path1 [path2 ... ]]<br> [PATHS path1 [path2 ... ]]<br> [PATH_SUFFIXES suffix1 [suffix2 ...]]<br> [NO_DEFAULT_PATH]<br> [NO_CMAKE_ENVIRONMENT_PATH]<br> [NO_CMAKE_PATH]<br> [NO_SYSTEM_ENVIRONMENT_PATH]<br> [NO_CMAKE_PACKAGE_REGISTRY]<br> [NO_CMAKE_BUILDS_PATH]<br> [NO_CMAKE_SYSTEM_PATH]<br> [CMAKE_FIND_ROOT_PATH_BOTH |<br> ONLY_CMAKE_FIND_ROOT_PATH |<br> NO_CMAKE_FIND_ROOT_PATH])<br></pre>
<p>The NO_MODULE option may be used to skip Module mode explicitly. It is also implied by use of options not specified in the reduced signature. <br><p>Config mode attempts to locate a configuration file provided by the package to be found. A cache entry called &lt;package&gt;_DIR is created to hold the directory containing the file. By default the command searches for a package with the name &lt;package&gt;. If the NAMES option is given the names following it are used instead of &lt;package&gt;. The command searches for a file called "&lt;name&gt;Config.cmake" or "&lt;lower-case-name&gt;-config.cmake" for each name specified. A replacement set of possible configuration file names may be given using the CONFIGS option. The search procedure is specified below. Once found, the configuration file is read and processed by CMake. Since the file is provided by the package it already knows the location of package contents. The full path to the configuration file is stored in the cmake variable &lt;package&gt;_CONFIG.<br><p>If the package configuration file cannot be found CMake will generate an error describing the problem unless the QUIET argument is specified. If REQUIRED is specified and the package is not found a fatal error is generated and the configure step stops executing. If &lt;package&gt;_DIR has been set to a directory not containing a configuration file CMake will ignore it and search from scratch.<br><p>When the [version] argument is given Config mode will only find a version of the package that claims compatibility with the requested version (format is major[.minor[.patch[.tweak]]]). If the EXACT option is given only a version of the package claiming an exact match of the requested version may be found. CMake does not establish any convention for the meaning of version numbers. Package version numbers are checked by "version" files provided by the packages themselves. For a candidate package configuration file "&lt;config-file&gt;.cmake" the corresponding version file is located next to it and named either "&lt;config-file&gt;-version.cmake" or "&lt;config-file&gt;Version.cmake". If no such version file is available then the configuration file is assumed to not be compatible with any requested version. When a version file is found it is loaded to check the requested version number. The version file is loaded in a nested scope in which the following variables have been defined:<br><pre> PACKAGE_FIND_NAME = the &lt;package&gt; name<br> PACKAGE_FIND_VERSION = full requested version string<br> PACKAGE_FIND_VERSION_MAJOR = major version if requested, else 0<br> PACKAGE_FIND_VERSION_MINOR = minor version if requested, else 0<br> PACKAGE_FIND_VERSION_PATCH = patch version if requested, else 0<br> PACKAGE_FIND_VERSION_TWEAK = tweak version if requested, else 0<br> PACKAGE_FIND_VERSION_COUNT = number of version components, 0 to 4<br></pre>
<p>The version file checks whether it satisfies the requested version and sets these variables:<br><pre> PACKAGE_VERSION = full provided version string<br> PACKAGE_VERSION_EXACT = true if version is exact match<br> PACKAGE_VERSION_COMPATIBLE = true if version is compatible<br> PACKAGE_VERSION_UNSUITABLE = true if unsuitable as any version<br></pre>
<p>These variables are checked by the find_package command to determine whether the configuration file provides an acceptable version. They are not available after the find_package call returns. If the version is acceptable the following variables are set:<br><pre> &lt;package&gt;_VERSION = full provided version string<br> &lt;package&gt;_VERSION_MAJOR = major version if provided, else 0<br> &lt;package&gt;_VERSION_MINOR = minor version if provided, else 0<br> &lt;package&gt;_VERSION_PATCH = patch version if provided, else 0<br> &lt;package&gt;_VERSION_TWEAK = tweak version if provided, else 0<br> &lt;package&gt;_VERSION_COUNT = number of version components, 0 to 4<br></pre>
<p>and the corresponding package configuration file is loaded. When multiple package configuration files are available whose version files claim compatibility with the version requested it is unspecified which one is chosen. No attempt is made to choose a highest or closest version number.<br><p>Config mode provides an elaborate interface and search procedure. Much of the interface is provided for completeness and for use internally by find-modules loaded by Module mode. Most user code should simply call<br><pre> find_package(&lt;package&gt; [major[.minor]] [EXACT] [REQUIRED|QUIET])<br></pre>
<p>in order to find a package. Package maintainers providing CMake package configuration files are encouraged to name and install them such that the procedure outlined below will find them without requiring use of additional options.<br><p>CMake constructs a set of possible installation prefixes for the package. Under each prefix several directories are searched for a configuration file. The tables below show the directories searched. Each entry is meant for installation trees following Windows (W), UNIX (U), or Apple (A) conventions.<br><pre> &lt;prefix&gt;/ (W)<br> &lt;prefix&gt;/(cmake|CMake)/ (W)<br> &lt;prefix&gt;/&lt;name&gt;*/ (W)<br> &lt;prefix&gt;/&lt;name&gt;*/(cmake|CMake)/ (W)<br> &lt;prefix&gt;/(share|lib)/cmake/&lt;name&gt;*/ (U)<br> &lt;prefix&gt;/(share|lib)/&lt;name&gt;*/ (U)<br> &lt;prefix&gt;/(share|lib)/&lt;name&gt;*/(cmake|CMake)/ (U)<br></pre>
<p>On systems supporting OS X Frameworks and Application Bundles the following directories are searched for frameworks or bundles containing a configuration file:<br><pre> &lt;prefix&gt;/&lt;name&gt;.framework/Resources/ (A)<br> &lt;prefix&gt;/&lt;name&gt;.framework/Resources/CMake/ (A)<br> &lt;prefix&gt;/&lt;name&gt;.framework/Versions/*/Resources/ (A)<br> &lt;prefix&gt;/&lt;name&gt;.framework/Versions/*/Resources/CMake/ (A)<br> &lt;prefix&gt;/&lt;name&gt;.app/Contents/Resources/ (A)<br> &lt;prefix&gt;/&lt;name&gt;.app/Contents/Resources/CMake/ (A)<br></pre>
<p>In all cases the &lt;name&gt; is treated as case-insensitive and corresponds to any of the names specified (&lt;package&gt; or names given by NAMES). If PATH_SUFFIXES is specified the suffixes are appended to each (W) or (U) directory entry one-by-one.<br><p>This set of directories is intended to work in cooperation with projects that provide configuration files in their installation trees. Directories above marked with (W) are intended for installations on Windows where the prefix may point at the top of an application's installation directory. Those marked with (U) are intended for installations on UNIX platforms where the prefix is shared by multiple packages. This is merely a convention, so all (W) and (U) directories are still searched on all platforms. Directories marked with (A) are intended for installations on Apple platforms. The cmake variables CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE determine the order of preference as specified below.<br><p>The set of installation prefixes is constructed using the following steps. If NO_DEFAULT_PATH is specified all NO_* options are enabled.<br><p>1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.<br><pre> CMAKE_PREFIX_PATH<br> CMAKE_FRAMEWORK_PATH<br> CMAKE_APPBUNDLE_PATH<br></pre>
<p>2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.<br><pre> CMAKE_PREFIX_PATH<br> CMAKE_FRAMEWORK_PATH<br> CMAKE_APPBUNDLE_PATH<br></pre>
<p>3. Search paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.<br><p>4. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is passed. Path entries ending in "/bin" or "/sbin" are automatically converted to their parent directories.<br><pre> PATH<br></pre>
<p>5. Search project build trees recently configured in a CMake GUI. This can be skipped if NO_CMAKE_BUILDS_PATH is passed. It is intended for the case when a user is building multiple dependent projects one after another.<br><p>6. Search paths stored in the CMake user package registry. This can be skipped if NO_CMAKE_PACKAGE_REGISTRY is passed. Paths are stored in the registry when CMake configures a project that invokes export(PACKAGE &lt;name&gt;). See the export(PACKAGE) command documentation for more details.<br><p>7. Search cmake variables defined in the Platform files for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is passed.<br><pre> CMAKE_SYSTEM_PREFIX_PATH<br> CMAKE_SYSTEM_FRAMEWORK_PATH<br> CMAKE_SYSTEM_APPBUNDLE_PATH<br></pre>
<p>8. Search paths specified by the PATHS option. These are typically hard-coded guesses.<br><p>On Darwin or systems supporting OS X Frameworks, the cmake variable CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:<br><pre> "FIRST" - Try to find frameworks before standard<br> libraries or headers. This is the default on Darwin.<br> "LAST" - Try to find frameworks after standard<br> libraries or headers.<br> "ONLY" - Only try to find frameworks.<br> "NEVER" - Never try to find frameworks.<br></pre>
<p>On Darwin or systems supporting OS X Application Bundles, the cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:<br><pre> "FIRST" - Try to find application bundles before standard<br> programs. This is the default on Darwin.<br> "LAST" - Try to find application bundles after standard<br> programs.<br> "ONLY" - Only try to find application bundles.<br> "NEVER" - Never try to find application bundles.<br></pre>
<p>The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. By default it is empty. It is especially useful when cross-compiling to point to the root directory of the target environment and CMake will search there too. By default at first the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be searched. The default behavior can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_PACKAGE. This behavior can be manually overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as described above. If NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted directories will be searched.<br><p>The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:<br><pre> find_package(&lt;package&gt; PATHS paths... NO_DEFAULT_PATH)<br> find_package(&lt;package&gt;)<br></pre>
<p>Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.<br><p>See the cmake_policy() command documentation for discussion of the NO_POLICY_SCOPE option.
</li>
<li>
<a name="command:find_path"><b><code>find_path</code></b></a>: Find the directory containing a file.<br>
<pre> find_path(&lt;VAR&gt; name1 [path1 path2 ...])<br></pre>
<p>This is the short-hand signature for the command that is sufficient in many cases. It is the same as find_path(&lt;VAR&gt; name1 [PATHS path1 path2 ...])<br><pre> find_path(<br> &lt;VAR&gt;<br> name | NAMES name1 [name2 ...]<br> [HINTS path1 [path2 ... ENV var]]<br> [PATHS path1 [path2 ... ENV var]]<br> [PATH_SUFFIXES suffix1 [suffix2 ...]]<br> [DOC "cache documentation string"]<br> [NO_DEFAULT_PATH]<br> [NO_CMAKE_ENVIRONMENT_PATH]<br> [NO_CMAKE_PATH]<br> [NO_SYSTEM_ENVIRONMENT_PATH]<br> [NO_CMAKE_SYSTEM_PATH]<br> [CMAKE_FIND_ROOT_PATH_BOTH |<br> ONLY_CMAKE_FIND_ROOT_PATH |<br> NO_CMAKE_FIND_ROOT_PATH]<br> )<br></pre>
<p>This command is used to find a directory containing the named file. A cache entry named by &lt;VAR&gt; is created to store the result of this command. If the file in a directory is found the result is stored in the variable and the search will not be repeated unless the variable is cleared. If nothing is found, the result will be &lt;VAR&gt;-NOTFOUND, and the search will be attempted again the next time find_path is invoked with the same variable. The name of the file in a directory that is searched for is specified by the names listed after the NAMES argument. Additional search locations can be specified after the PATHS argument. If ENV var is found in the HINTS or PATHS section the environment variable var will be read and converted from a system environment variable to a cmake style list of paths. For example ENV PATH would be a way to list the system path variable. The argument after DOC will be used for the documentation string in the cache. PATH_SUFFIXES specifies additional subdirectories to check below each search path.<br><p>If NO_DEFAULT_PATH is specified, then no additional paths are added to the search. If NO_DEFAULT_PATH is not specified, the search process is as follows:<br><p>1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.<br><pre> &lt;prefix&gt;/include for each &lt;prefix&gt; in CMAKE_PREFIX_PATH<br> CMAKE_INCLUDE_PATH<br> CMAKE_FRAMEWORK_PATH<br></pre>
<p>2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.<br><pre> &lt;prefix&gt;/include for each &lt;prefix&gt; in CMAKE_PREFIX_PATH<br> CMAKE_INCLUDE_PATH<br> CMAKE_FRAMEWORK_PATH<br></pre>
<p>3. Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.<br><p>4. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.<br><pre> PATH<br> INCLUDE<br></pre>
<p>5. Search cmake variables defined in the Platform files for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is passed.<br><pre> &lt;prefix&gt;/include for each &lt;prefix&gt; in CMAKE_SYSTEM_PREFIX_PATH<br> CMAKE_SYSTEM_INCLUDE_PATH<br> CMAKE_SYSTEM_FRAMEWORK_PATH<br></pre>
<p>6. Search the paths specified by the PATHS option or in the short-hand version of the command. These are typically hard-coded guesses.<br><p>On Darwin or systems supporting OS X Frameworks, the cmake variable CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:<br><pre> "FIRST" - Try to find frameworks before standard<br> libraries or headers. This is the default on Darwin.<br> "LAST" - Try to find frameworks after standard<br> libraries or headers.<br> "ONLY" - Only try to find frameworks.<br> "NEVER" - Never try to find frameworks.<br></pre>
<p>On Darwin or systems supporting OS X Application Bundles, the cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:<br><pre> "FIRST" - Try to find application bundles before standard<br> programs. This is the default on Darwin.<br> "LAST" - Try to find application bundles after standard<br> programs.<br> "ONLY" - Only try to find application bundles.<br> "NEVER" - Never try to find application bundles.<br></pre>
<p>The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. By default it is empty. It is especially useful when cross-compiling to point to the root directory of the target environment and CMake will search there too. By default at first the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be searched. The default behavior can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE. This behavior can be manually overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as described above. If NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted directories will be searched.<br><p>The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:<br><pre> find_path(&lt;VAR&gt; NAMES name PATHS paths... NO_DEFAULT_PATH)<br> find_path(&lt;VAR&gt; NAMES name)<br></pre>
<p>Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.<br><p>When searching for frameworks, if the file is specified as A/b.h, then the framework search will look for A.framework/Headers/b.h. If that is found the path will be set to the path to the framework. CMake will convert this to the correct -F option to include the file.
</li>
<li>
<a name="command:find_program"><b><code>find_program</code></b></a>: Find an executable program.<br>
<pre> find_program(&lt;VAR&gt; name1 [path1 path2 ...])<br></pre>
<p>This is the short-hand signature for the command that is sufficient in many cases. It is the same as find_program(&lt;VAR&gt; name1 [PATHS path1 path2 ...])<br><pre> find_program(<br> &lt;VAR&gt;<br> name | NAMES name1 [name2 ...]<br> [HINTS path1 [path2 ... ENV var]]<br> [PATHS path1 [path2 ... ENV var]]<br> [PATH_SUFFIXES suffix1 [suffix2 ...]]<br> [DOC "cache documentation string"]<br> [NO_DEFAULT_PATH]<br> [NO_CMAKE_ENVIRONMENT_PATH]<br> [NO_CMAKE_PATH]<br> [NO_SYSTEM_ENVIRONMENT_PATH]<br> [NO_CMAKE_SYSTEM_PATH]<br> [CMAKE_FIND_ROOT_PATH_BOTH |<br> ONLY_CMAKE_FIND_ROOT_PATH |<br> NO_CMAKE_FIND_ROOT_PATH]<br> )<br></pre>
<p>This command is used to find a program. A cache entry named by &lt;VAR&gt; is created to store the result of this command. If the program is found the result is stored in the variable and the search will not be repeated unless the variable is cleared. If nothing is found, the result will be &lt;VAR&gt;-NOTFOUND, and the search will be attempted again the next time find_program is invoked with the same variable. The name of the program that is searched for is specified by the names listed after the NAMES argument. Additional search locations can be specified after the PATHS argument. If ENV var is found in the HINTS or PATHS section the environment variable var will be read and converted from a system environment variable to a cmake style list of paths. For example ENV PATH would be a way to list the system path variable. The argument after DOC will be used for the documentation string in the cache. PATH_SUFFIXES specifies additional subdirectories to check below each search path.<br><p>If NO_DEFAULT_PATH is specified, then no additional paths are added to the search. If NO_DEFAULT_PATH is not specified, the search process is as follows:<br><p>1. Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed.<br><pre> &lt;prefix&gt;/[s]bin for each &lt;prefix&gt; in CMAKE_PREFIX_PATH<br> CMAKE_PROGRAM_PATH<br> CMAKE_APPBUNDLE_PATH<br></pre>
<p>2. Search paths specified in cmake-specific environment variables. These are intended to be set in the user's shell configuration. This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.<br><pre> &lt;prefix&gt;/[s]bin for each &lt;prefix&gt; in CMAKE_PREFIX_PATH<br> CMAKE_PROGRAM_PATH<br> CMAKE_APPBUNDLE_PATH<br></pre>
<p>3. Search the paths specified by the HINTS option. These should be paths computed by system introspection, such as a hint provided by the location of another item already found. Hard-coded guesses should be specified with the PATHS option.<br><p>4. Search the standard system environment variables. This can be skipped if NO_SYSTEM_ENVIRONMENT_PATH is an argument.<br><pre> PATH<br> <br></pre>
<p>5. Search cmake variables defined in the Platform files for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH is passed.<br><pre> &lt;prefix&gt;/[s]bin for each &lt;prefix&gt; in CMAKE_SYSTEM_PREFIX_PATH<br> CMAKE_SYSTEM_PROGRAM_PATH<br> CMAKE_SYSTEM_APPBUNDLE_PATH<br></pre>
<p>6. Search the paths specified by the PATHS option or in the short-hand version of the command. These are typically hard-coded guesses.<br><p>On Darwin or systems supporting OS X Frameworks, the cmake variable CMAKE_FIND_FRAMEWORK can be set to empty or one of the following:<br><pre> "FIRST" - Try to find frameworks before standard<br> libraries or headers. This is the default on Darwin.<br> "LAST" - Try to find frameworks after standard<br> libraries or headers.<br> "ONLY" - Only try to find frameworks.<br> "NEVER" - Never try to find frameworks.<br></pre>
<p>On Darwin or systems supporting OS X Application Bundles, the cmake variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:<br><pre> "FIRST" - Try to find application bundles before standard<br> programs. This is the default on Darwin.<br> "LAST" - Try to find application bundles after standard<br> programs.<br> "ONLY" - Only try to find application bundles.<br> "NEVER" - Never try to find application bundles.<br></pre>
<p>The CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. By default it is empty. It is especially useful when cross-compiling to point to the root directory of the target environment and CMake will search there too. By default at first the directories listed in CMAKE_FIND_ROOT_PATH and then the non-rooted directories will be searched. The default behavior can be adjusted by setting CMAKE_FIND_ROOT_PATH_MODE_PROGRAM. This behavior can be manually overridden on a per-call basis. By using CMAKE_FIND_ROOT_PATH_BOTH the search order will be as described above. If NO_CMAKE_FIND_ROOT_PATH is used then CMAKE_FIND_ROOT_PATH will not be used. If ONLY_CMAKE_FIND_ROOT_PATH is used then only the re-rooted directories will be searched.<br><p>The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:<br><pre> find_program(&lt;VAR&gt; NAMES name PATHS paths... NO_DEFAULT_PATH)<br> find_program(&lt;VAR&gt; NAMES name)<br></pre>
<p>Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
</li>
<li>
<a name="command:fltk_wrap_ui"><b><code>fltk_wrap_ui</code></b></a>: Create FLTK user interfaces Wrappers.<br>
<pre> fltk_wrap_ui(resultingLibraryName source1<br> source2 ... sourceN )<br></pre>
<p>Produce .h and .cxx files for all the .fl and .fld files listed. The resulting .h and .cxx files will be added to a variable named resultingLibraryName_FLTK_UI_SRCS which should be added to your library.
</li>
<li>
<a name="command:foreach"><b><code>foreach</code></b></a>: Evaluate a group of commands for each value in a list.<br>
<pre> foreach(loop_var arg1 arg2 ...)<br> COMMAND1(ARGS ...)<br> COMMAND2(ARGS ...)<br> ...<br> endforeach(loop_var)<br></pre>
<p>All commands between foreach and the matching endforeach are recorded without being invoked. Once the endforeach is evaluated, the recorded list of commands is invoked once for each argument listed in the original foreach command. Before each iteration of the loop "${loop_var}" will be set as a variable with the current value in the list.<br><pre> foreach(loop_var RANGE total)<br> foreach(loop_var RANGE start stop [step])<br></pre>
<p>Foreach can also iterate over a generated range of numbers. There are three types of this iteration:<br><p>* When specifying single number, the range will have elements 0 to "total".<br><p>* When specifying two numbers, the range will have elements from the first number to the second number.<br><p>* The third optional number is the increment used to iterate from the first number to the second number.<br><pre> foreach(loop_var IN [LISTS [list1 [...]]]<br> [ITEMS [item1 [...]]])<br></pre>
<p>Iterates over a precise list of items. The LISTS option names list-valued variables to be traversed, including empty elements (an empty string is a zero-length list). The ITEMS option ends argument parsing and includes all arguments following it in the iteration.
</li>
<li>
<a name="command:function"><b><code>function</code></b></a>: Start recording a function for later invocation as a command.<br>
<pre> function(&lt;name&gt; [arg1 [arg2 [arg3 ...]]])<br> COMMAND1(ARGS ...)<br> COMMAND2(ARGS ...)<br> ...<br> endfunction(&lt;name&gt;)<br></pre>
<p>Define a function named &lt;name&gt; that takes arguments named arg1 arg2 arg3 (...). Commands listed after function, but before the matching endfunction, are not invoked until the function is invoked. When it is invoked, the commands recorded in the function are first modified by replacing formal parameters (${arg1}) with the arguments passed, and then invoked as normal commands. In addition to referencing the formal parameters you can reference the variable ARGC which will be set to the number of arguments passed into the function as well as ARGV0 ARGV1 ARGV2 ... which will have the actual values of the arguments passed in. This facilitates creating functions with optional arguments. Additionally ARGV holds the list of all arguments given to the function and ARGN holds the list of argument past the last expected argument.<br><p>See the cmake_policy() command documentation for the behavior of policies inside functions.
</li>
<li>
<a name="command:get_cmake_property"><b><code>get_cmake_property</code></b></a>: Get a property of the CMake instance.<br>
<pre> get_cmake_property(VAR property)<br></pre>
<p>Get a property from the CMake instance. The value of the property is stored in the variable VAR. If the property is not found, CMake will report an error. Some supported properties include: VARIABLES, CACHE_VARIABLES, COMMANDS, MACROS, and COMPONENTS.
</li>
<li>
<a name="command:get_directory_property"><b><code>get_directory_property</code></b></a>: Get a property of DIRECTORY scope.<br>
<pre> get_directory_property(&lt;variable&gt; [DIRECTORY &lt;dir&gt;] &lt;prop-name&gt;)<br></pre>
<p>Store a property of directory scope in the named variable. If the property is not defined the empty-string is returned. The DIRECTORY argument specifies another directory from which to retrieve the property value. The specified directory must have already been traversed by CMake.<br><pre> get_directory_property(&lt;variable&gt; [DIRECTORY &lt;dir&gt;]<br> DEFINITION &lt;var-name&gt;)<br></pre>
<p>Get a variable definition from a directory. This form is useful to get a variable definition from another directory.
</li>
<li>
<a name="command:get_filename_component"><b><code>get_filename_component</code></b></a>: Get a specific component of a full filename.<br>
<pre> get_filename_component(VarName FileName<br> PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH<br> [CACHE])<br></pre>
<p>Set VarName to be the path (PATH), file name (NAME), file extension (EXT), file name without extension (NAME_WE) of FileName, the full path (ABSOLUTE), or the full path with all symlinks resolved (REALPATH). Note that the path is converted to Unix slashes format and has no trailing slashes. The longest file extension is always considered. If the optional CACHE argument is specified, the result variable is added to the cache.<br><pre> get_filename_component(VarName FileName<br> PROGRAM [PROGRAM_ARGS ArgVar]<br> [CACHE])<br></pre>
<p>The program in FileName will be found in the system search path or left as a full path. If PROGRAM_ARGS is present with PROGRAM, then any command-line arguments present in the FileName string are split from the program name and stored in ArgVar. This is used to separate a program name from its arguments in a command line string.
</li>
<li>
<a name="command:get_property"><b><code>get_property</code></b></a>: Get a property.<br>
<pre> get_property(&lt;variable&gt;<br> &lt;GLOBAL |<br> DIRECTORY [dir] |<br> TARGET &lt;target&gt; |<br> SOURCE &lt;source&gt; |<br> TEST &lt;test&gt; |<br> CACHE &lt;entry&gt; |<br> VARIABLE&gt;<br> PROPERTY &lt;name&gt;<br> [SET | DEFINED | BRIEF_DOCS | FULL_DOCS])<br></pre>
<p>Get one property from one object in a scope. The first argument specifies the variable in which to store the result. The second argument determines the scope from which to get the property. It must be one of the following:<br><p>GLOBAL scope is unique and does not accept a name.<br><p>DIRECTORY scope defaults to the current directory but another directory (already processed by CMake) may be named by full or relative path.<br><p>TARGET scope must name one existing target.<br><p>SOURCE scope must name one source file.<br><p>TEST scope must name one existing test.<br><p>CACHE scope must name one cache entry.<br><p>VARIABLE scope is unique and does not accept a name.<br><p>The required PROPERTY option is immediately followed by the name of the property to get. If the property is not set an empty value is returned. If the SET option is given the variable is set to a boolean value indicating whether the property has been set. If the DEFINED option is given the variable is set to a boolean value indicating whether the property has been defined such as with define_property. If BRIEF_DOCS or FULL_DOCS is given then the variable is set to a string containing documentation for the requested property. If documentation is requested for a property that has not been defined NOTFOUND is returned.
</li>
<li>
<a name="command:get_source_file_property"><b><code>get_source_file_property</code></b></a>: Get a property for a source file.<br>
<pre> get_source_file_property(VAR file property)<br></pre>
<p>Get a property from a source file. The value of the property is stored in the variable VAR. If the property is not found, VAR will be set to "NOTFOUND". Use set_source_files_properties to set property values. Source file properties usually control how the file is built. One property that is always there is LOCATION
</li>
<li>
<a name="command:get_target_property"><b><code>get_target_property</code></b></a>: Get a property from a target.<br>
<pre> get_target_property(VAR target property)<br></pre>
<p>Get a property from a target. The value of the property is stored in the variable VAR. If the property is not found, VAR will be set to "NOTFOUND". Use set_target_properties to set property values. Properties are usually used to control how a target is built, but some query the target instead. This command can get properties for any target so far created. The targets do not need to be in the current CMakeLists.txt file.
</li>
<li>
<a name="command:get_test_property"><b><code>get_test_property</code></b></a>: Get a property of the test.<br>
<pre> get_test_property(test VAR property)<br></pre>
<p>Get a property from the Test. The value of the property is stored in the variable VAR. If the property is not found, CMake will report an error. For a list of standard properties you can type cmake --help-property-list
</li>
<li>
<a name="command:if"><b><code>if</code></b></a>: Conditionally execute a group of commands.<br>
<pre> if(expression)<br> # then section.<br> COMMAND1(ARGS ...)<br> COMMAND2(ARGS ...)<br> ...<br> elseif(expression2)<br> # elseif section.<br> COMMAND1(ARGS ...)<br> COMMAND2(ARGS ...)<br> ...<br> else(expression)<br> # else section.<br> COMMAND1(ARGS ...)<br> COMMAND2(ARGS ...)<br> ...<br> endif(expression)<br></pre>
<p>Evaluates the given expression. If the result is true, the commands in the THEN section are invoked. Otherwise, the commands in the else section are invoked. The elseif and else sections are optional. You may have multiple elseif clauses. Note that the expression in the else and endif clause is optional. Long expressions can be used and there is a traditional order of precedence. Parenthetical expressions are evaluated first followed by unary operators such as EXISTS, COMMAND, and DEFINED. Then any EQUAL, LESS, GREATER, STRLESS, STRGREATER, STREQUAL, MATCHES will be evaluated. Then NOT operators and finally AND, OR operators will be evaluated. Possible expressions are:<br><pre> if(&lt;constant&gt;)<br></pre>
<p>True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number. False if the constant is 0, OFF, NO, FALSE, N, IGNORE, "", or ends in the suffix '-NOTFOUND'. Named boolean constants are case-insensitive.<br><pre> if(&lt;variable&gt;)<br></pre>
<p>True if the variable's value is not a false constant.<br><pre> if(NOT &lt;expression&gt;)<br></pre>
<p>True if the expression is not true.<br><pre> if(&lt;expr1&gt; AND &lt;expr2&gt;)<br></pre>
<p>True if both expressions would be considered true individually.<br><pre> if(&lt;expr1&gt; OR &lt;expr2&gt;)<br></pre>
<p>True if either expression would be considered true individually.<br><pre> if(COMMAND command-name)<br></pre>
<p>True if the given name is a command, macro or function that can be invoked.<br><pre> if(POLICY policy-id)<br></pre>
<p>True if the given name is an existing policy (of the form CMP&lt;NNNN&gt;).<br><pre> if(TARGET target-name)<br></pre>
<p>True if the given name is an existing target, built or imported.<br><pre> if(EXISTS file-name)<br> if(EXISTS directory-name)<br></pre>
<p>True if the named file or directory exists. Behavior is well-defined only for full paths.<br><pre> if(file1 IS_NEWER_THAN file2)<br></pre>
<p>True if file1 is newer than file2 or if one of the two files doesn't exist. Behavior is well-defined only for full paths.<br><pre> if(IS_DIRECTORY directory-name)<br></pre>
<p>True if the given name is a directory. Behavior is well-defined only for full paths.<br><pre> if(IS_ABSOLUTE path)<br></pre>
<p>True if the given path is an absolute path.<br><pre> if(variable MATCHES regex)<br> if(string MATCHES regex)<br></pre>
<p>True if the given string or variable's value matches the given regular expression.<br><pre> if(variable LESS number)<br> if(string LESS number)<br> if(variable GREATER number)<br> if(string GREATER number)<br> if(variable EQUAL number)<br> if(string EQUAL number)<br></pre>
<p>True if the given string or variable's value is a valid number and the inequality or equality is true.<br><pre> if(variable STRLESS string)<br> if(string STRLESS string)<br> if(variable STRGREATER string)<br> if(string STRGREATER string)<br> if(variable STREQUAL string)<br> if(string STREQUAL string)<br></pre>
<p>True if the given string or variable's value is lexicographically less (or greater, or equal) than the string or variable on the right.<br><pre> if(version1 VERSION_LESS version2)<br> if(version1 VERSION_EQUAL version2)<br> if(version1 VERSION_GREATER version2)<br></pre>
<p>Component-wise integer version number comparison (version format is major[.minor[.patch[.tweak]]]).<br><pre> if(DEFINED variable)<br></pre>
<p>True if the given variable is defined. It does not matter if the variable is true or false just if it has been set.<br><pre> if((expression) AND (expression OR (expression)))<br></pre>
<p>The expressions inside the parenthesis are evaluated first and then the remaining expression is evaluated as in the previous examples. Where there are nested parenthesis the innermost are evaluated as part of evaluating the expression that contains them.<br><p>The if statement was written fairly early in CMake's history and it has some convenience features that are worth covering. The if statement reduces operations until there is a single remaining value, at that point if the case insensitive value is: ON, 1, YES, TRUE, Y it returns true, if it is OFF, 0, NO, FALSE, N, NOTFOUND, *-NOTFOUND, IGNORE it will return false. <br><p>This is fairly reasonable. The convenience feature that sometimes throws new authors is how CMake handles values that do not match the true or false list. Those values are treated as variables and are dereferenced even though they do not have the required ${} syntax. This means that if you write<br><pre> if (boobah)<br></pre>
<p>CMake will treat it as if you wrote <br><pre> if (${boobah})<br></pre>
<p>likewise if you write <br><pre> if (fubar AND sol)<br></pre>
<p>CMake will conveniently treat it as <br><pre> if ("${fubar}" AND "${sol}")<br></pre>
<p>The later is really the correct way to write it, but the former will work as well. Only some operations in the if statement have this special handling of arguments. The specific details follow: <br><p>1) The left hand argument to MATCHES is first checked to see if it is a defined variable, if so the variable's value is used, otherwise the original value is used. <br><p>2) If the left hand argument to MATCHES is missing it returns false without error <br><p>3) Both left and right hand arguments to LESS GREATER EQUAL are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used. <br><p>4) Both left and right hand arguments to STRLESS STREQUAL STRGREATER are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used. <br><p>5) Both left and right hand argumemnts to VERSION_LESS VERSION_EQUAL VERSION_GREATER are independently tested to see if they are defined variables, if so their defined values are used otherwise the original value is used. <br><p>6) The right hand argument to NOT is tested to see if it is a boolean constant, if so the value is used, otherwise it is assumed to be a variable and it is dereferenced. <br><p>7) The left and right hand arguments to AND OR are independently tested to see if they are boolean constants, if so they are used as such, otherwise they are assumed to be variables and are dereferenced. <br>
</li>
<li>
<a name="command:include"><b><code>include</code></b></a>: Read CMake listfile code from the given file.<br>
<pre> include(&lt;file|module&gt; [OPTIONAL] [RESULT_VARIABLE &lt;VAR&gt;]<br> [NO_POLICY_SCOPE])<br></pre>
<p>Reads CMake listfile code from the given file. Commands in the file are processed immediately as if they were written in place of the include command. If OPTIONAL is present, then no error is raised if the file does not exist. If RESULT_VARIABLE is given the variable will be set to the full filename which has been included or NOTFOUND if it failed.<br><p>If a module is specified instead of a file, the file with name &lt;modulename&gt;.cmake is searched in the CMAKE_MODULE_PATH.<br><p>See the cmake_policy() command documentation for discussion of the NO_POLICY_SCOPE option.
</li>
<li>
<a name="command:include_directories"><b><code>include_directories</code></b></a>: Add include directories to the build.<br>
<pre> include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)<br></pre>
<p>Add the given directories to those searched by the compiler for include files. By default the directories are appended onto the current list of directories. This default behavior can be changed by setting CMAKE_include_directories_BEFORE to ON. By using BEFORE or AFTER you can select between appending and prepending, independent from the default. If the SYSTEM option is given the compiler will be told that the directories are meant as system include directories on some platforms.
</li>
<li>
<a name="command:include_external_msproject"><b><code>include_external_msproject</code></b></a>: Include an external Microsoft project file in a workspace.<br>
<pre> include_external_msproject(projectname location<br> dep1 dep2 ...)<br></pre>
<p>Includes an external Microsoft project in the generated workspace file. Currently does nothing on UNIX. This will create a target named INCLUDE_EXTERNAL_MSPROJECT_[projectname]. This can be used in the add_dependencies command to make things depend on the external project.
</li>
<li>
<a name="command:include_regular_expression"><b><code>include_regular_expression</code></b></a>: Set the regular expression used for dependency checking.<br>
<pre> include_regular_expression(regex_match [regex_complain])<br></pre>
<p>Set the regular expressions used in dependency checking. Only files matching regex_match will be traced as dependencies. Only files matching regex_complain will generate warnings if they cannot be found (standard header paths are not searched). The defaults are:<br><pre> regex_match = "^.*$" (match everything)<br> regex_complain = "^$" (match empty string only)</pre>
</li>
<li>
<a name="command:install"><b><code>install</code></b></a>: Specify rules to run at install time.<br>
<p>This command generates installation rules for a project. Rules specified by calls to this command within a source directory are executed in order during installation. The order across directories is not defined.<br><p>There are multiple signatures for this command. Some of them define installation properties for files and targets. Properties common to multiple signatures are covered here but they are valid only for signatures that specify them.<br><p>DESTINATION arguments specify the directory on disk to which a file will be installed. If a full path (with a leading slash or drive letter) is given it is used directly. If a relative path is given it is interpreted relative to the value of CMAKE_INSTALL_PREFIX.<br><p>PERMISSIONS arguments specify permissions for installed files. Valid permissions are OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, GROUP_READ, GROUP_WRITE, GROUP_EXECUTE, WORLD_READ, WORLD_WRITE, WORLD_EXECUTE, SETUID, and SETGID. Permissions that do not make sense on certain platforms are ignored on those platforms.<br><p>The CONFIGURATIONS argument specifies a list of build configurations for which the install rule applies (Debug, Release, etc.).<br><p>The COMPONENT argument specifies an installation component name with which the install rule is associated, such as "runtime" or "development". During component-specific installation only install rules associated with the given component name will be executed. During a full installation all components are installed.<br><p>The RENAME argument specifies a name for an installed file that may be different from the original file. Renaming is allowed only when a single file is installed by the command.<br><p>The OPTIONAL argument specifies that it is not an error if the file to be installed does not exist. <br><p>The TARGETS signature:<br><pre> install(TARGETS targets... [EXPORT &lt;export-name&gt;]<br> [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|<br> PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]<br> [DESTINATION &lt;dir&gt;]<br> [PERMISSIONS permissions...]<br> [CONFIGURATIONS [Debug|Release|...]]<br> [COMPONENT &lt;component&gt;]<br> [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]<br> ] [...])<br></pre>
<p>The TARGETS form specifies rules for installing targets from a project. There are five kinds of target files that may be installed: ARCHIVE, LIBRARY, RUNTIME, FRAMEWORK, and BUNDLE. Executables are treated as RUNTIME targets, except that those marked with the MACOSX_BUNDLE property are treated as BUNDLE targets on OS X. Static libraries are always treated as ARCHIVE targets. Module libraries are always treated as LIBRARY targets. For non-DLL platforms shared libraries are treated as LIBRARY targets, except that those marked with the FRAMEWORK property are treated as FRAMEWORK targets on OS X. For DLL platforms the DLL part of a shared library is treated as a RUNTIME target and the corresponding import library is treated as an ARCHIVE target. All Windows-based systems including Cygwin are DLL platforms. The ARCHIVE, LIBRARY, RUNTIME, and FRAMEWORK arguments change the type of target to which the subsequent properties apply. If none is given the installation properties apply to all target types. If only one is given then only targets of that type will be installed (which can be used to install just a DLL or just an import library).<br><p>The PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE arguments cause subsequent properties to be applied to installing a FRAMEWORK shared library target's associated files on non-Apple platforms. Rules defined by these arguments are ignored on Apple platforms because the associated files are installed into the appropriate locations inside the framework folder. See documentation of the PRIVATE_HEADER, PUBLIC_HEADER, and RESOURCE target properties for details.<br><p>Either NAMELINK_ONLY or NAMELINK_SKIP may be specified as a LIBRARY option. On some platforms a versioned shared library has a symbolic link such as<br><pre> lib&lt;name&gt;.so -&gt; lib&lt;name&gt;.so.1<br></pre>
<p>where "lib&lt;name&gt;.so.1" is the soname of the library and "lib&lt;name&gt;.so" is a "namelink" allowing linkers to find the library when given "-l&lt;name&gt;". The NAMELINK_ONLY option causes installation of only the namelink when a library target is installed. The NAMELINK_SKIP option causes installation of library files other than the namelink when a library target is installed. When neither option is given both portions are installed. On platforms where versioned shared libraries do not have namelinks or when a library is not versioned the NAMELINK_SKIP option installs the library and the NAMELINK_ONLY option installs nothing. See the VERSION and SOVERSION target properties for details on creating versioned shared libraries.<br><p>One or more groups of properties may be specified in a single call to the TARGETS form of this command. A target may be installed more than once to different locations. Consider hypothetical targets "myExe", "mySharedLib", and "myStaticLib". The code<br><pre> install(TARGETS myExe mySharedLib myStaticLib<br> RUNTIME DESTINATION bin<br> LIBRARY DESTINATION lib<br> ARCHIVE DESTINATION lib/static)<br> install(TARGETS mySharedLib DESTINATION /some/full/path)<br></pre>
<p>will install myExe to &lt;prefix&gt;/bin and myStaticLib to &lt;prefix&gt;/lib/static. On non-DLL platforms mySharedLib will be installed to &lt;prefix&gt;/lib and /some/full/path. On DLL platforms the mySharedLib DLL will be installed to &lt;prefix&gt;/bin and /some/full/path and its import library will be installed to &lt;prefix&gt;/lib/static and /some/full/path. On non-DLL platforms mySharedLib will be installed to &lt;prefix&gt;/lib and /some/full/path.<br><p>The EXPORT option associates the installed target files with an export called &lt;export-name&gt;. It must appear before any RUNTIME, LIBRARY, or ARCHIVE options. See documentation of the install(EXPORT ...) signature below for details.<br><p>Installing a target with EXCLUDE_FROM_ALL set to true has undefined behavior.<br><p>The FILES signature:<br><pre> install(FILES files... DESTINATION &lt;dir&gt;<br> [PERMISSIONS permissions...]<br> [CONFIGURATIONS [Debug|Release|...]]<br> [COMPONENT &lt;component&gt;]<br> [RENAME &lt;name&gt;] [OPTIONAL])<br></pre>
<p>The FILES form specifies rules for installing files for a project. File names given as relative paths are interpreted with respect to the current source directory. Files installed by this form are by default given permissions OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ if no PERMISSIONS argument is given.<br><p>The PROGRAMS signature:<br><pre> install(PROGRAMS files... DESTINATION &lt;dir&gt;<br> [PERMISSIONS permissions...]<br> [CONFIGURATIONS [Debug|Release|...]]<br> [COMPONENT &lt;component&gt;]<br> [RENAME &lt;name&gt;] [OPTIONAL])<br></pre>
<p>The PROGRAMS form is identical to the FILES form except that the default permissions for the installed file also include OWNER_EXECUTE, GROUP_EXECUTE, and WORLD_EXECUTE. This form is intended to install programs that are not targets, such as shell scripts. Use the TARGETS form to install targets built within the project.<br><p>The DIRECTORY signature:<br><pre> install(DIRECTORY dirs... DESTINATION &lt;dir&gt;<br> [FILE_PERMISSIONS permissions...]<br> [DIRECTORY_PERMISSIONS permissions...]<br> [USE_SOURCE_PERMISSIONS] [OPTIONAL]<br> [CONFIGURATIONS [Debug|Release|...]]<br> [COMPONENT &lt;component&gt;] [FILES_MATCHING]<br> [[PATTERN &lt;pattern&gt; | REGEX &lt;regex&gt;]<br> [EXCLUDE] [PERMISSIONS permissions...]] [...])<br></pre>
<p>The DIRECTORY form installs contents of one or more directories to a given destination. The directory structure is copied verbatim to the destination. The last component of each directory name is appended to the destination directory but a trailing slash may be used to avoid this because it leaves the last component empty. Directory names given as relative paths are interpreted with respect to the current source directory. If no input directory names are given the destination directory will be created but nothing will be installed into it. The FILE_PERMISSIONS and DIRECTORY_PERMISSIONS options specify permissions given to files and directories in the destination. If USE_SOURCE_PERMISSIONS is specified and FILE_PERMISSIONS is not, file permissions will be copied from the source directory structure. If no permissions are specified files will be given the default permissions specified in the FILES form of the command, and the directories will be given the default permissions specified in the PROGRAMS form of the command.<br><p>Installation of directories may be controlled with fine granularity using the PATTERN or REGEX options. These "match" options specify a globbing pattern or regular expression to match directories or files encountered within input directories. They may be used to apply certain options (see below) to a subset of the files and directories encountered. The full path to each input file or directory (with forward slashes) is matched against the expression. A PATTERN will match only complete file names: the portion of the full path matching the pattern must occur at the end of the file name and be preceded by a slash. A REGEX will match any portion of the full path but it may use '/' and '$' to simulate the PATTERN behavior. By default all files and directories are installed whether or not they are matched. The FILES_MATCHING option may be given before the first match option to disable installation of files (but not directories) not matched by any expression. For example, the code<br><pre> install(DIRECTORY src/ DESTINATION include/myproj<br> FILES_MATCHING PATTERN "*.h")<br></pre>
<p>will extract and install header files from a source tree.<br><p>Some options may follow a PATTERN or REGEX expression and are applied only to files or directories matching them. The EXCLUDE option will skip the matched file or directory. The PERMISSIONS option overrides the permissions setting for the matched file or directory. For example the code<br><pre> install(DIRECTORY icons scripts/ DESTINATION share/myproj<br> PATTERN "CVS" EXCLUDE<br> PATTERN "scripts/*"<br> PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ<br> GROUP_EXECUTE GROUP_READ)<br></pre>
<p>will install the icons directory to share/myproj/icons and the scripts directory to share/myproj. The icons will get default file permissions, the scripts will be given specific permissions, and any CVS directories will be excluded.<br><p>The SCRIPT and CODE signature:<br><pre> install([[SCRIPT &lt;file&gt;] [CODE &lt;code&gt;]] [...])<br></pre>
<p>The SCRIPT form will invoke the given CMake script files during installation. If the script file name is a relative path it will be interpreted with respect to the current source directory. The CODE form will invoke the given CMake code during installation. Code is specified as a single argument inside a double-quoted string. For example, the code<br><pre> install(CODE "MESSAGE(\"Sample install message.\")")<br></pre>
<p>will print a message during installation.<br><p>The EXPORT signature:<br><pre> install(EXPORT &lt;export-name&gt; DESTINATION &lt;dir&gt;<br> [NAMESPACE &lt;namespace&gt;] [FILE &lt;name&gt;.cmake]<br> [PERMISSIONS permissions...]<br> [CONFIGURATIONS [Debug|Release|...]]<br> [COMPONENT &lt;component&gt;])<br></pre>
<p>The EXPORT form generates and installs a CMake file containing code to import targets from the installation tree into another project. Target installations are associated with the export &lt;export-name&gt; using the EXPORT option of the install(TARGETS ...) signature documented above. The NAMESPACE option will prepend &lt;namespace&gt; to the target names as they are written to the import file. By default the generated file will be called &lt;export-name&gt;.cmake but the FILE option may be used to specify a different name. The value given to the FILE option must be a file name with the ".cmake" extension. If a CONFIGURATIONS option is given then the file will only be installed when one of the named configurations is installed. Additionally, the generated import file will reference only the matching target configurations. If a COMPONENT option is specified that does not match that given to the targets associated with &lt;export-name&gt; the behavior is undefined. If a library target is included in the export but a target to which it links is not included the behavior is unspecified.<br><p>The EXPORT form is useful to help outside projects use targets built and installed by the current project. For example, the code<br><pre> install(TARGETS myexe EXPORT myproj DESTINATION bin)<br> install(EXPORT myproj NAMESPACE mp_ DESTINATION lib/myproj)<br></pre>
<p>will install the executable myexe to &lt;prefix&gt;/bin and code to import it in the file "&lt;prefix&gt;/lib/myproj/myproj.cmake". An outside project may load this file with the include command and reference the myexe executable from the installation tree using the imported target name mp_myexe as if the target were built in its own tree.<br><p>NOTE: This command supercedes the INSTALL_TARGETS command and the target properties PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT. It also replaces the FILES forms of the INSTALL_FILES and INSTALL_PROGRAMS commands. The processing order of these install rules relative to those generated by INSTALL_TARGETS, INSTALL_FILES, and INSTALL_PROGRAMS commands is not defined.<br>
</li>
<li>
<a name="command:link_directories"><b><code>link_directories</code></b></a>: Specify directories in which the linker will look for libraries.<br>
<pre> link_directories(directory1 directory2 ...)<br></pre>
<p>Specify the paths in which the linker should search for libraries. The command will apply only to targets created after it is called. For historical reasons, relative paths given to this command are passed to the linker unchanged (unlike many CMake commands which interpret them relative to the current source directory).
</li>
<li>
<a name="command:list"><b><code>list</code></b></a>: List operations.<br>
<pre> list(LENGTH &lt;list&gt; &lt;output variable&gt;)<br> list(GET &lt;list&gt; &lt;element index&gt; [&lt;element index&gt; ...]<br> &lt;output variable&gt;)<br> list(APPEND &lt;list&gt; &lt;element&gt; [&lt;element&gt; ...])<br> list(FIND &lt;list&gt; &lt;value&gt; &lt;output variable&gt;)<br> list(INSERT &lt;list&gt; &lt;element_index&gt; &lt;element&gt; [&lt;element&gt; ...])<br> list(REMOVE_ITEM &lt;list&gt; &lt;value&gt; [&lt;value&gt; ...])<br> list(REMOVE_AT &lt;list&gt; &lt;index&gt; [&lt;index&gt; ...])<br> list(REMOVE_DUPLICATES &lt;list&gt;)<br> list(REVERSE &lt;list&gt;)<br> list(SORT &lt;list&gt;)<br></pre>
<p>LENGTH will return a given list's length.<br><p>GET will return list of elements specified by indices from the list.<br><p>APPEND will append elements to the list.<br><p>FIND will return the index of the element specified in the list or -1 if it wasn't found.<br><p>INSERT will insert elements to the list to the specified location.<br><p>REMOVE_AT and REMOVE_ITEM will remove items from the list. The difference is that REMOVE_ITEM will remove the given items, while REMOVE_AT will remove the items at the given indices.<br><p>REMOVE_DUPLICATES will remove duplicated items in the list.<br><p>REVERSE reverses the contents of the list in-place.<br><p>SORT sorts the list in-place alphabetically.<br><p>NOTES: A list in cmake is a ; separated group of strings. To create a list the set command can be used. For example, set(var a b c d e) creates a list with a;b;c;d;e, and set(var "a b c d e") creates a string or a list with one item in it.<br><p>When specifying index values, if &lt;element index&gt; is 0 or greater, it is indexed from the beginning of the list, with 0 representing the first list element. If &lt;element index&gt; is -1 or lesser, it is indexed from the end of the list, with -1 representing the last list element. Be careful when counting with negative indices: they do not start from 0. -0 is equivalent to 0, the first list element.<br>
</li>
<li>
<a name="command:load_cache"><b><code>load_cache</code></b></a>: Load in the values from another project's CMake cache.<br>
<pre> load_cache(pathToCacheFile READ_WITH_PREFIX<br> prefix entry1...)<br></pre>
<p>Read the cache and store the requested entries in variables with their name prefixed with the given prefix. This only reads the values, and does not create entries in the local project's cache.<br><pre> load_cache(pathToCacheFile [EXCLUDE entry1...]<br> [INCLUDE_INTERNALS entry1...])<br></pre>
<p>Load in the values from another cache and store them in the local project's cache as internal entries. This is useful for a project that depends on another project built in a different tree. EXCLUDE option can be used to provide a list of entries to be excluded. INCLUDE_INTERNALS can be used to provide a list of internal entries to be included. Normally, no internal entries are brought in. Use of this form of the command is strongly discouraged, but it is provided for backward compatibility.
</li>
<li>
<a name="command:load_command"><b><code>load_command</code></b></a>: Load a command into a running CMake.<br>
<pre> load_command(COMMAND_NAME &lt;loc1&gt; [loc2 ...])<br></pre>
<p>The given locations are searched for a library whose name is cmCOMMAND_NAME. If found, it is loaded as a module and the command is added to the set of available CMake commands. Usually, TRY_COMPILE is used before this command to compile the module. If the command is successfully loaded a variable named<br><pre> CMAKE_LOADED_COMMAND_&lt;COMMAND_NAME&gt;<br></pre>
<p>will be set to the full path of the module that was loaded. Otherwise the variable will not be set.
</li>
<li>
<a name="command:macro"><b><code>macro</code></b></a>: Start recording a macro for later invocation as a command.<br>
<pre> macro(&lt;name&gt; [arg1 [arg2 [arg3 ...]]])<br> COMMAND1(ARGS ...)<br> COMMAND2(ARGS ...)<br> ...<br> endmacro(&lt;name&gt;)<br></pre>
<p>Define a macro named &lt;name&gt; that takes arguments named arg1 arg2 arg3 (...). Commands listed after macro, but before the matching endmacro, are not invoked until the macro is invoked. When it is invoked, the commands recorded in the macro are first modified by replacing formal parameters (${arg1}) with the arguments passed, and then invoked as normal commands. In addition to referencing the formal parameters you can reference the values ${ARGC} which will be set to the number of arguments passed into the function as well as ${ARGV0} ${ARGV1} ${ARGV2} ... which will have the actual values of the arguments passed in. This facilitates creating macros with optional arguments. Additionally ${ARGV} holds the list of all arguments given to the macro and ${ARGN} holds the list of argument past the last expected argument. Note that the parameters to a macro and values such as ARGN are not variables in the usual CMake sense. They are string replacements much like the c preprocessor would do with a macro. If you want true CMake variables you should look at the function command.<br><p>See the cmake_policy() command documentation for the behavior of policies inside macros.
</li>
<li>
<a name="command:mark_as_advanced"><b><code>mark_as_advanced</code></b></a>: Mark cmake cached variables as advanced.<br>
<pre> mark_as_advanced([CLEAR|FORCE] VAR VAR2 VAR...)<br></pre>
<p>Mark the named cached variables as advanced. An advanced variable will not be displayed in any of the cmake GUIs unless the show advanced option is on. If CLEAR is the first argument advanced variables are changed back to unadvanced. If FORCE is the first argument, then the variable is made advanced. If neither FORCE nor CLEAR is specified, new values will be marked as advanced, but if the variable already has an advanced/non-advanced state, it will not be changed.<br><p>It does nothing in script mode.
</li>
<li>
<a name="command:math"><b><code>math</code></b></a>: Mathematical expressions.<br>
<pre> math(EXPR &lt;output variable&gt; &lt;math expression&gt;)<br></pre>
<p>EXPR evaluates mathematical expression and return result in the output variable. Example mathematical expression is '5 * ( 10 + 13 )'. Supported operators are + - * / % | &amp; ^ ~ &lt;&lt; &gt;&gt; * / %. They have the same meaning as they do in c code.
</li>
<li>
<a name="command:message"><b><code>message</code></b></a>: Display a message to the user.<br>
<pre> message([STATUS|WARNING|AUTHOR_WARNING|FATAL_ERROR|SEND_ERROR]<br> "message to display" ...)<br></pre>
<p>The optional keyword determines the type of message:<br><pre> (none) = Important information<br> STATUS = Incidental information<br> WARNING = CMake Warning, continue processing<br> AUTHOR_WARNING = CMake Warning (dev), continue processing<br> SEND_ERROR = CMake Error, continue but skip generation<br> FATAL_ERROR = CMake Error, stop all processing<br></pre>
<p>The CMake command-line tool displays STATUS messages on stdout and all other message types on stderr. The CMake GUI displays all messages in its log area. The interactive dialogs (ccmake and CMakeSetup) show STATUS messages one at a time on a status line and other messages in interactive pop-up boxes.<br><p>CMake Warning and Error message text displays using a simple markup language. Non-indented text is formatted in line-wrapped paragraphs delimited by newlines. Indented text is considered pre-formatted.
</li>
<li>
<a name="command:option"><b><code>option</code></b></a>: Provides an option that the user can optionally select.<br>
<pre> option(&lt;option_variable&gt; "help string describing option"<br> [initial value])<br></pre>
<p>Provide an option for the user to select as ON or OFF. If no initial value is provided, OFF is used.
</li>
<li>
<a name="command:output_required_files"><b><code>output_required_files</code></b></a>: Output a list of required source files for a specified source file.<br>
<pre> output_required_files(srcfile outputfile)<br></pre>
<p>Outputs a list of all the source files that are required by the specified srcfile. This list is written into outputfile. This is similar to writing out the dependencies for srcfile except that it jumps from .h files into .cxx, .c and .cpp files if possible.
</li>
<li>
<a name="command:project"><b><code>project</code></b></a>: Set a name for the entire project.<br>
<pre> project(&lt;projectname&gt; [languageName1 languageName2 ... ] )<br></pre>
<p>Sets the name of the project. Additionally this sets the variables &lt;projectName&gt;_BINARY_DIR and &lt;projectName&gt;_SOURCE_DIR to the respective values.<br><p>Optionally you can specify which languages your project supports. Example languages are CXX (i.e. C++), C, Fortran, etc. By default C and CXX are enabled. E.g. if you do not have a C++ compiler, you can disable the check for it by explicitely listing the languages you want to support, e.g. C. By using the special language "NONE" all checks for any language can be disabled.
</li>
<li>
<a name="command:qt_wrap_cpp"><b><code>qt_wrap_cpp</code></b></a>: Create Qt Wrappers.<br>
<pre> qt_wrap_cpp(resultingLibraryName DestName<br> SourceLists ...)<br></pre>
<p>Produce moc files for all the .h files listed in the SourceLists. The moc files will be added to the library using the DestName source list.
</li>
<li>
<a name="command:qt_wrap_ui"><b><code>qt_wrap_ui</code></b></a>: Create Qt user interfaces Wrappers.<br>
<pre> qt_wrap_ui(resultingLibraryName HeadersDestName<br> SourcesDestName SourceLists ...)<br></pre>
<p>Produce .h and .cxx files for all the .ui files listed in the SourceLists. The .h files will be added to the library using the HeadersDestNamesource list. The .cxx files will be added to the library using the SourcesDestNamesource list.
</li>
<li>
<a name="command:remove_definitions"><b><code>remove_definitions</code></b></a>: Removes -D define flags added by add_definitions.<br>
<pre> remove_definitions(-DFOO -DBAR ...)<br></pre>
<p>Removes flags (added by add_definitions) from the compiler command line for sources in the current directory and below.
</li>
<li>
<a name="command:return"><b><code>return</code></b></a>: Return from a file, directory or function.<br>
<pre> return()<br></pre>
<p>Returns from a file, directory or function. When this command is encountered in an included file (via include() or find_package()), it causes processing of the current file to stop and control is returned to the including file. If it is encountered in a file which is not included by another file, e.g. a CMakeLists.txt, control is returned to the parent directory if there is one. If return is called in a function, control is returned to the caller of the function. Note that a macro is not a function and does not handle return like a function does.
</li>
<li>
<a name="command:separate_arguments"><b><code>separate_arguments</code></b></a>: Parse space-separated arguments into a semicolon-separated list.<br>
<pre> separate_arguments(&lt;var&gt; &lt;UNIX|WINDOWS&gt;_COMMAND "&lt;args&gt;")<br></pre>
<p>Parses a unix- or windows-style command-line string "&lt;args&gt;" and stores a semicolon-separated list of the arguments in &lt;var&gt;. The entire command line must be given in one "&lt;args&gt;" argument.<br><p>The UNIX_COMMAND mode separates arguments by unquoted whitespace. It recognizes both single-quote and double-quote pairs. A backslash escapes the next literal character (\" is "); there are no special escapes (\n is just n).<br><p>The WINDOWS_COMMAND mode parses a windows command-line using the same syntax the runtime library uses to construct argv at startup. It separates arguments by whitespace that is not double-quoted. Backslashes are literal unless they precede double-quotes. See the MSDN article "Parsing C Command-Line Arguments" for details.<br><pre> separate_arguments(VARIABLE)<br></pre>
<p>Convert the value of VARIABLE to a semi-colon separated list. All spaces are replaced with ';'. This helps with generating command lines.
</li>
<li>
<a name="command:set"><b><code>set</code></b></a>: Set a CMAKE variable to a given value.<br>
<pre> set(&lt;variable&gt; &lt;value&gt;<br> [[CACHE &lt;type&gt; &lt;docstring&gt; [FORCE]] | PARENT_SCOPE])<br></pre>
<p>Within CMake sets &lt;variable&gt; to the value &lt;value&gt;. &lt;value&gt; is expanded before &lt;variable&gt; is set to it. If CACHE is present, then the &lt;variable&gt; is put in the cache. &lt;type&gt; and &lt;docstring&gt; are then required. &lt;type&gt; is used by the CMake GUI to choose a widget with which the user sets a value. The value for &lt;type&gt; may be one of<br><pre> FILEPATH = File chooser dialog.<br> PATH = Directory chooser dialog.<br> STRING = Arbitrary string.<br> BOOL = Boolean ON/OFF checkbox.<br> INTERNAL = No GUI entry (used for persistent variables).<br></pre>
<p>If &lt;type&gt; is INTERNAL, then the &lt;value&gt; is always written into the cache, replacing any values existing in the cache. If it is not a cache variable, then this always writes into the current makefile. The FORCE option will overwrite the cache value removing any changes by the user.<br><p>If PARENT_SCOPE is present, the variable will be set in the scope above the current scope. Each new directory or function creates a new scope. This command will set the value of a variable into the parent directory or calling function (whichever is applicable to the case at hand).<br><p>If &lt;value&gt; is not specified then the variable is removed instead of set. See also: the unset() command.<br><pre> set(&lt;variable&gt; &lt;value1&gt; ... &lt;valueN&gt;)<br></pre>
<p>In this case &lt;variable&gt; is set to a semicolon separated list of values.<br><p>&lt;variable&gt; can be an environment variable such as:<br><pre> set( ENV{PATH} /home/martink )<br></pre>
<p>in which case the environment variable will be set.
</li>
<li>
<a name="command:set_directory_properties"><b><code>set_directory_properties</code></b></a>: Set a property of the directory.<br>
<pre> set_directory_properties(PROPERTIES prop1 value1 prop2 value2)<br></pre>
<p>Set a property for the current directory and subdirectories. If the property is not found, CMake will report an error. The properties include: INCLUDE_DIRECTORIES, LINK_DIRECTORIES, INCLUDE_REGULAR_EXPRESSION, and ADDITIONAL_MAKE_CLEAN_FILES. ADDITIONAL_MAKE_CLEAN_FILES is a list of files that will be cleaned as a part of "make clean" stage.
</li>
<li>
<a name="command:set_property"><b><code>set_property</code></b></a>: Set a named property in a given scope.<br>
<pre> set_property(&lt;GLOBAL |<br> DIRECTORY [dir] |<br> TARGET [target1 [target2 ...]] |<br> SOURCE [src1 [src2 ...]] |<br> TEST [test1 [test2 ...]] |<br> CACHE [entry1 [entry2 ...]]&gt;<br> [APPEND]<br> PROPERTY &lt;name&gt; [value1 [value2 ...]])<br></pre>
<p>Set one property on zero or more objects of a scope. The first argument determines the scope in which the property is set. It must be one of the following:<br><p>GLOBAL scope is unique and does not accept a name.<br><p>DIRECTORY scope defaults to the current directory but another directory (already processed by CMake) may be named by full or relative path.<br><p>TARGET scope may name zero or more existing targets.<br><p>SOURCE scope may name zero or more source files.<br><p>TEST scope may name zero or more existing tests.<br><p>CACHE scope must name zero or more cache existing entries.<br><p>The required PROPERTY option is immediately followed by the name of the property to set. Remaining arguments are used to compose the property value in the form of a semicolon-separated list. If the APPEND option is given the list is appended to any existing property value.
</li>
<li>
<a name="command:set_source_files_properties"><b><code>set_source_files_properties</code></b></a>: Source files can have properties that affect how they are built.<br>
<pre> set_source_files_properties(file1 file2 ...<br> PROPERTIES prop1 value1<br> prop2 value2 ...)<br></pre>
<p>Set properties on a file. The syntax for the command is to list all the files you want to change, and then provide the values you want to set next. You can make up your own properties as well. The following are used by CMake. The ABSTRACT flag (boolean) is used by some class wrapping commands. If WRAP_EXCLUDE (boolean) is true then many wrapping commands will ignore this file. If GENERATED (boolean) is true then it is not an error if this source file does not exist when it is added to a target. Obviously, it must be created (presumably by a custom command) before the target is built. If the HEADER_FILE_ONLY (boolean) property is true then the file is not compiled. This is useful if you want to add extra non build files to an IDE. OBJECT_DEPENDS (string) adds dependencies to the object file. COMPILE_FLAGS (string) is passed to the compiler as additional command line arguments when the source file is compiled. LANGUAGE (string) CXX|C will change the default compiler used to compile the source file. The languages used need to be enabled in the PROJECT command. If SYMBOLIC (boolean) is set to true the build system will be informed that the source file is not actually created on disk but instead used as a symbolic name for a build rule.
</li>
<li>
<a name="command:set_target_properties"><b><code>set_target_properties</code></b></a>: Targets can have properties that affect how they are built.<br>
<pre> set_target_properties(target1 target2 ...<br> PROPERTIES prop1 value1<br> prop2 value2 ...)<br></pre>
<p>Set properties on a target. The syntax for the command is to list all the files you want to change, and then provide the values you want to set next. You can use any prop value pair you want and extract it later with the GET_TARGET_PROPERTY command.<br><p>Properties that affect the name of a target's output file are as follows. The PREFIX and SUFFIX properties override the default target name prefix (such as "lib") and suffix (such as ".so"). IMPORT_PREFIX and IMPORT_SUFFIX are the equivalent properties for the import library corresponding to a DLL (for SHARED library targets). OUTPUT_NAME sets the real name of a target when it is built and can be used to help create two targets of the same name even though CMake requires unique logical target names. There is also a &lt;CONFIG&gt;_OUTPUT_NAME that can set the output name on a per-configuration basis. &lt;CONFIG&gt;_POSTFIX sets a postfix for the real name of the target when it is built under the configuration named by &lt;CONFIG&gt; (in upper-case, such as "DEBUG_POSTFIX"). The value of this property is initialized when the target is created to the value of the variable CMAKE_&lt;CONFIG&gt;_POSTFIX (except for executable targets because earlier CMake versions which did not use this variable for executables).<br><p>The LINK_FLAGS property can be used to add extra flags to the link step of a target. LINK_FLAGS_&lt;CONFIG&gt; will add to the configuration &lt;CONFIG&gt;, for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO. DEFINE_SYMBOL sets the name of the preprocessor symbol defined when compiling sources in a shared library. If not set here then it is set to target_EXPORTS by default (with some substitutions if the target is not a valid C identifier). This is useful for headers to know whether they are being included from inside their library our outside to properly setup dllexport/dllimport decorations. The COMPILE_FLAGS property sets additional compiler flags used to build sources within the target. It may also be used to pass additional preprocessor definitions.<br><p>The LINKER_LANGUAGE property is used to change the tool used to link an executable or shared library. The default is set the language to match the files in the library. CXX and C are common values for this property.<br><p>For shared libraries VERSION and SOVERSION can be used to specify the build version and api version respectively. When building or installing appropriate symlinks are created if the platform supports symlinks and the linker supports so-names. If only one of both is specified the missing is assumed to have the same version number. For executables VERSION can be used to specify the build version. When building or installing appropriate symlinks are created if the platform supports symlinks. For shared libraries and executables on Windows the VERSION attribute is parsed to extract a "major.minor" version number. These numbers are used as the image version of the binary. <br><p>There are a few properties used to specify RPATH rules. INSTALL_RPATH is a semicolon-separated list specifying the rpath to use in installed targets (for platforms that support it). INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true will append directories in the linker search path and outside the project to the INSTALL_RPATH. SKIP_BUILD_RPATH is a boolean specifying whether to skip automatic generation of an rpath allowing the target to run from the build tree. BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link the target in the build tree with the INSTALL_RPATH. This takes precedence over SKIP_BUILD_RPATH and avoids the need for relinking before installation. INSTALL_NAME_DIR is a string specifying the directory portion of the "install_name" field of shared libraries on Mac OSX to use in the installed targets. When the target is created the values of the variables CMAKE_INSTALL_RPATH, CMAKE_INSTALL_RPATH_USE_LINK_PATH, CMAKE_SKIP_BUILD_RPATH, CMAKE_BUILD_WITH_INSTALL_RPATH, and CMAKE_INSTALL_NAME_DIR are used to initialize these properties.<br><p>PROJECT_LABEL can be used to change the name of the target in an IDE like visual studio. VS_KEYWORD can be set to change the visual studio keyword, for example QT integration works better if this is set to Qt4VSv1.0.<br><p>VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER can be set to add support for source control bindings in a Visual Studio project file.<br><p>The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the old way to specify CMake scripts to run before and after installing a target. They are used only when the old INSTALL_TARGETS command is used to install the target. Use the INSTALL command instead.<br><p>The EXCLUDE_FROM_DEFAULT_BUILD property is used by the visual studio generators. If it is set to 1 the target will not be part of the default build when you select "Build Solution".
</li>
<li>
<a name="command:set_tests_properties"><b><code>set_tests_properties</code></b></a>: Set a property of the tests.<br>
<pre> set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)<br></pre>
<p>Set a property for the tests. If the property is not found, CMake will report an error. The properties include:<br><p>WILL_FAIL: If set to true, this will invert the pass/fail flag of the test.<br><p>PASS_REGULAR_EXPRESSION: If set, the test output will be checked against the specified regular expressions and at least one of the regular expressions has to match, otherwise the test will fail.<br><pre> Example: PASS_REGULAR_EXPRESSION "TestPassed;All ok"<br></pre>
<p>FAIL_REGULAR_EXPRESSION: If set, if the output will match to one of specified regular expressions, the test will fail.<br><pre> Example: PASS_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed"<br></pre>
<p>Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect a list of regular expressions.<br><p>PROCESSORS: Denotes the number of processors that this test will require. This is typically used for MPI tests, and should be used in conjunction with the ctest_test PARALLEL_LEVEL option.<br><p>COST: Set this to a floating point value. Tests in a test set will be run in descending order of cost.<br><p>RUN_SERIAL: If set to true, this test will not run in parallel with any other tests. This should be used in conjunction with the ctest_test PARALLEL_LEVEL option.<br>
</li>
<li>
<a name="command:site_name"><b><code>site_name</code></b></a>: Set the given variable to the name of the computer.<br>
<pre> site_name(variable)<br></pre>
</li>
<li>
<a name="command:source_group"><b><code>source_group</code></b></a>: Define a grouping for sources in the makefile.<br>
<pre> source_group(name [REGULAR_EXPRESSION regex] [FILES src1 src2 ...])<br></pre>
<p>Defines a group into which sources will be placed in project files. This is mainly used to setup file tabs in Visual Studio. Any file whose name is listed or matches the regular expression will be placed in this group. If a file matches multiple groups, the LAST group that explicitly lists the file will be favored, if any. If no group explicitly lists the file, the LAST group whose regular expression matches the file will be favored.<br><p>The name of the group may contain backslashes to specify subgroups:<br><pre> source_group(outer\\inner ...)<br></pre>
<p>For backwards compatibility, this command is also supports the format:<br><pre> source_group(name regex)</pre>
</li>
<li>
<a name="command:string"><b><code>string</code></b></a>: String operations.<br>
<pre> string(REGEX MATCH &lt;regular_expression&gt;<br> &lt;output variable&gt; &lt;input&gt; [&lt;input&gt;...])<br> string(REGEX MATCHALL &lt;regular_expression&gt;<br> &lt;output variable&gt; &lt;input&gt; [&lt;input&gt;...])<br> string(REGEX REPLACE &lt;regular_expression&gt;<br> &lt;replace_expression&gt; &lt;output variable&gt;<br> &lt;input&gt; [&lt;input&gt;...])<br> string(REPLACE &lt;match_string&gt;<br> &lt;replace_string&gt; &lt;output variable&gt;<br> &lt;input&gt; [&lt;input&gt;...])<br> string(COMPARE EQUAL &lt;string1&gt; &lt;string2&gt; &lt;output variable&gt;)<br> string(COMPARE NOTEQUAL &lt;string1&gt; &lt;string2&gt; &lt;output variable&gt;)<br> string(COMPARE LESS &lt;string1&gt; &lt;string2&gt; &lt;output variable&gt;)<br> string(COMPARE GREATER &lt;string1&gt; &lt;string2&gt; &lt;output variable&gt;)<br> string(ASCII &lt;number&gt; [&lt;number&gt; ...] &lt;output variable&gt;)<br> string(CONFIGURE &lt;string1&gt; &lt;output variable&gt;<br> [@ONLY] [ESCAPE_QUOTES])<br> string(TOUPPER &lt;string1&gt; &lt;output variable&gt;)<br> string(TOLOWER &lt;string1&gt; &lt;output variable&gt;)<br> string(LENGTH &lt;string&gt; &lt;output variable&gt;)<br> string(SUBSTRING &lt;string&gt; &lt;begin&gt; &lt;length&gt; &lt;output variable&gt;)<br> string(STRIP &lt;string&gt; &lt;output variable&gt;)<br> string(RANDOM [LENGTH &lt;length&gt;] [ALPHABET &lt;alphabet&gt;]<br> [RANDOM_SEED &lt;seed&gt;] &lt;output variable&gt;)<br></pre>
<p>REGEX MATCH will match the regular expression once and store the match in the output variable.<br><p>REGEX MATCHALL will match the regular expression as many times as possible and store the matches in the output variable as a list.<br><p>REGEX REPLACE will match the regular expression as many times as possible and substitute the replacement expression for the match in the output. The replace expression may refer to paren-delimited subexpressions of the match using \1, \2, ..., \9. Note that two backslashes (\\1) are required in CMake code to get a backslash through argument parsing.<br><p>REPLACE will replace all occurrences of match_string in the input with replace_string and store the result in the output.<br><p>COMPARE EQUAL/NOTEQUAL/LESS/GREATER will compare the strings and store true or false in the output variable.<br><p>ASCII will convert all numbers into corresponding ASCII characters.<br><p>CONFIGURE will transform a string like CONFIGURE_FILE transforms a file.<br><p>TOUPPER/TOLOWER will convert string to upper/lower characters.<br><p>LENGTH will return a given string's length.<br><p>SUBSTRING will return a substring of a given string.<br><p>STRIP will return a substring of a given string with leading and trailing spaces removed.<br><p>RANDOM will return a random string of given length consisting of characters from the given alphabet. Default length is 5 characters and default alphabet is all numbers and upper and lower case letters. If an integer RANDOM_SEED is given, its value will be used to seed the random number generator.<br><p>The following characters have special meaning in regular expressions:<br><pre> ^ Matches at beginning of a line<br> $ Matches at end of a line<br> . Matches any single character<br> [ ] Matches any character(s) inside the brackets<br> [^ ] Matches any character(s) not inside the brackets<br> - Matches any character in range on either side of a dash<br> * Matches preceding pattern zero or more times<br> + Matches preceding pattern one or more times<br> ? Matches preceding pattern zero or once only<br> | Matches a pattern on either side of the |<br> () Saves a matched subexpression, which can be referenced <br> in the REGEX REPLACE operation. Additionally it is saved<br> by all regular expression-related commands, including <br> e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).</pre>
</li>
<li>
<a name="command:target_link_libraries"><b><code>target_link_libraries</code></b></a>: Link a target to given libraries.<br>
<pre> target_link_libraries(&lt;target&gt; [item1 [item2 [...]]]<br> [[debug|optimized|general] &lt;item&gt;] ...)<br></pre>
<p>Specify libraries or flags to use when linking a given target. If a library name matches that of another target in the project a dependency will automatically be added in the build system to make sure the library being linked is up-to-date before the target links. Item names starting with '-', but not '-l' or '-framework', are treated as linker flags.<br><p>A "debug", "optimized", or "general" keyword indicates that the library immediately following it is to be used only for the corresponding build configuration. The "debug" keyword corresponds to the Debug configuration (or to configurations named in the DEBUG_CONFIGURATIONS global property if it is set). The "optimized" keyword corresponds to all other configurations. The "general" keyword corresponds to all configurations, and is purely optional (assumed if omitted). Higher granularity may be achieved for per-configuration rules by creating and linking to IMPORTED library targets. See the IMPORTED mode of the add_library command for more information. <br><p>Library dependencies are transitive by default. When this target is linked into another target then the libraries linked to this target will appear on the link line for the other target too. See the LINK_INTERFACE_LIBRARIES target property to override the set of transitive link dependencies for a target.<br><pre> target_link_libraries(&lt;target&gt; LINK_INTERFACE_LIBRARIES<br> [[debug|optimized|general] &lt;lib&gt;] ...)<br></pre>
<p>The LINK_INTERFACE_LIBRARIES mode appends the libraries to the LINK_INTERFACE_LIBRARIES and its per-configuration equivalent target properties instead of using them for linking. Libraries specified as "debug" are appended to the the LINK_INTERFACE_LIBRARIES_DEBUG property (or to the properties corresponding to configurations listed in the DEBUG_CONFIGURATIONS global property if it is set). Libraries specified as "optimized" are appended to the the LINK_INTERFACE_LIBRARIES property. Libraries specified as "general" (or without any keyword) are treated as if specified for both "debug" and "optimized".<br><p>The library dependency graph is normally acyclic (a DAG), but in the case of mutually-dependent STATIC libraries CMake allows the graph to contain cycles (strongly connected components). When another target links to one of the libraries CMake repeats the entire connected component. For example, the code<br><pre> add_library(A STATIC a.c)<br> add_library(B STATIC b.c)<br> target_link_libraries(A B)<br> target_link_libraries(B A)<br> add_executable(main main.c)<br> target_link_libraries(main A)<br></pre>
<p>links 'main' to 'A B A B'. (While one repetition is usually sufficient, pathological object file and symbol arrangements can require more. One may handle such cases by manually repeating the component in the last target_link_libraries call. However, if two archives are really so interdependent they should probably be combined into a single archive.)
</li>
<li>
<a name="command:try_compile"><b><code>try_compile</code></b></a>: Try compiling some code.<br>
<pre> try_compile(RESULT_VAR bindir srcdir<br> projectName &lt;targetname&gt; [CMAKE_FLAGS &lt;Flags&gt;]<br> [OUTPUT_VARIABLE var])<br></pre>
<p>Try compiling a program. In this form, srcdir should contain a complete CMake project with a CMakeLists.txt file and all sources. The bindir and srcdir will not be deleted after this command is run. If &lt;target name&gt; is specified then build just that target otherwise the all or ALL_BUILD target is built.<br><pre> try_compile(RESULT_VAR bindir srcfile<br> [CMAKE_FLAGS &lt;Flags&gt;]<br> [COMPILE_DEFINITIONS &lt;flags&gt; ...]<br> [OUTPUT_VARIABLE var]<br> [COPY_FILE &lt;filename&gt; )<br></pre>
<p>Try compiling a srcfile. In this case, the user need only supply a source file. CMake will create the appropriate CMakeLists.txt file to build the source. If COPY_FILE is used, the compiled file will be copied to the given file.<br><p>In this version all files in bindir/CMakeFiles/CMakeTmp, will be cleaned automatically, for debugging a --debug-trycompile can be passed to cmake to avoid the clean. Some extra flags that can be included are, INCLUDE_DIRECTORIES, LINK_DIRECTORIES, and LINK_LIBRARIES. COMPILE_DEFINITIONS are -Ddefinition that will be passed to the compile line. try_compile creates a CMakeList.txt file on the fly that looks like this:<br><pre> add_definitions( &lt;expanded COMPILE_DEFINITIONS from calling cmake&gt;)<br> include_directories(${INCLUDE_DIRECTORIES})<br> link_directories(${LINK_DIRECTORIES})<br> add_executable(cmTryCompileExec sources)<br> target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES})<br></pre>
<p>In both versions of the command, if OUTPUT_VARIABLE is specified, then the output from the build process is stored in the given variable. Return the success or failure in RESULT_VAR. CMAKE_FLAGS can be used to pass -DVAR:TYPE=VALUE flags to the cmake that is run during the build.
</li>
<li>
<a name="command:try_run"><b><code>try_run</code></b></a>: Try compiling and then running some code.<br>
<pre> try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR<br> bindir srcfile [CMAKE_FLAGS &lt;Flags&gt;]<br> [COMPILE_DEFINITIONS &lt;flags&gt;]<br> [COMPILE_OUTPUT_VARIABLE comp]<br> [RUN_OUTPUT_VARIABLE run]<br> [OUTPUT_VARIABLE var]<br> [ARGS &lt;arg1&gt; &lt;arg2&gt;...])<br></pre>
<p>Try compiling a srcfile. Return TRUE or FALSE for success or failure in COMPILE_RESULT_VAR. Then if the compile succeeded, run the executable and return its exit code in RUN_RESULT_VAR. If the executable was built, but failed to run, then RUN_RESULT_VAR will be set to FAILED_TO_RUN. COMPILE_OUTPUT_VARIABLE specifies the variable where the output from the compile step goes. RUN_OUTPUT_VARIABLE specifies the variable where the output from the running executable goes.<br><p>For compatibility reasons OUTPUT_VARIABLE is still supported, which gives you the output from the compile and run step combined.<br><p>Cross compiling issues<br><p>When cross compiling, the executable compiled in the first step usually cannot be run on the build host. try_run() checks the CMAKE_CROSSCOMPILING variable to detect whether CMake is in crosscompiling mode. If that's the case, it will still try to compile the executable, but it will not try to run the executable. Instead it will create cache variables which must be filled by the user or by presetting them in some CMake script file to the values the executable would have produced if it would have been run on its actual target platform. These variables are RUN_RESULT_VAR (explanation see above) and if RUN_OUTPUT_VARIABLE (or OUTPUT_VARIABLE) was used, an additional cache variable RUN_RESULT_VAR__COMPILE_RESULT_VAR__TRYRUN_OUTPUT.This is intended to hold stdout and stderr from the executable.<br><p>In order to make cross compiling your project easier, use try_run only if really required. If you use try_run, use RUN_OUTPUT_VARIABLE (or OUTPUT_VARIABLE) only if really required. Using them will require that when crosscompiling, the cache variables will have to be set manually to the output of the executable. You can also "guard" the calls to try_run with if(CMAKE_CROSSCOMPILING) and provide an easy-to-preset alternative for this case.<br>
</li>
<li>
<a name="command:unset"><b><code>unset</code></b></a>: Unset a variable, cache variable, or environment variable.<br>
<pre> unset(&lt;variable&gt; [CACHE])<br></pre>
<p>Removes the specified variable causing it to become undefined. If CACHE is present then the variable is removed from the cache instead of the current scope.<br><p>&lt;variable&gt; can be an environment variable such as:<br><pre> unset(ENV{LD_LIBRARY_PATH})<br></pre>
<p>in which case the variable will be removed from the current environment.
</li>
<li>
<a name="command:variable_watch"><b><code>variable_watch</code></b></a>: Watch the CMake variable for change.<br>
<pre> variable_watch(&lt;variable name&gt; [&lt;command to execute&gt;])<br></pre>
<p>If the specified variable changes, the message will be printed about the variable being changed. If the command is specified, the command will be executed. The command will receive the following arguments: COMMAND(&lt;variable&gt; &lt;access&gt; &lt;value&gt; &lt;current list file&gt; &lt;stack&gt;)
</li>
<li>
<a name="command:while"><b><code>while</code></b></a>: Evaluate a group of commands while a condition is true<br>
<pre> while(condition)<br> COMMAND1(ARGS ...)<br> COMMAND2(ARGS ...)<br> ...<br> endwhile(condition)<br></pre>
<p>All commands between while and the matching endwhile are recorded without being invoked. Once the endwhile is evaluated, the recorded list of commands is invoked as long as the condition is true. The condition is evaluated using the same logic as the if command.
</li>
</ul>
<h2><a name="section_Copyright"/>Copyright</h2>
<ul>
</ul>
<p>Copyright 2000-2009 Kitware, Inc., Insight Software Consortium. All rights reserved.
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
<p>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
<p>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
<p>Neither the names of Kitware, Inc., the Insight Software Consortium, nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission.
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<h2><a name="section_See Also"/>See Also</h2>
<ul>
<li><a href="#see:HomePage"><b><code>Home Page</code></b></a></li> <li><a href="#see:FrequentlyAskedQuestions"><b><code>Frequently Asked Questions</code></b></a></li> <li><a href="#see:OnlineDocumentation"><b><code>Online Documentation</code></b></a></li> <li><a href="#see:MailingList"><b><code>Mailing List</code></b></a></li></ul>
<p>The following resources are available to get help using CMake:
<ul>
<li>
<a name="see:HomePage"><b><code>Home Page</code></b></a>: <a href="http://www.cmake.org">http://www.cmake.org</a><br>
<p>The primary starting point for learning about CMake.
</li>
<li>
<a name="see:FrequentlyAskedQuestions"><b><code>Frequently Asked Questions</code></b></a>: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<p>A Wiki is provided containing answers to frequently asked questions.
</li>
<li>
<a name="see:OnlineDocumentation"><b><code>Online Documentation</code></b></a>: <a href="http://www.cmake.org/HTML/Documentation.html">http://www.cmake.org/HTML/Documentation.html</a><br>
<p>Links to available documentation may be found on this web page.
</li>
<li>
<a name="see:MailingList"><b><code>Mailing List</code></b></a>: <a href="http://www.cmake.org/HTML/MailingLists.html">http://www.cmake.org/HTML/MailingLists.html</a><br>
<p>For help and discussion about using cmake, a mailing list is provided at cmake@cmake.org. The list is member-post-only but one may sign up on the CMake web page. Please first read the full documentation at <a href="http://www.cmake.org">http://www.cmake.org</a> before posting questions to the list.
</li>
</ul>
<p>Summary of helpful links:<br><pre> Home: <a href="http://www.cmake.org">http://www.cmake.org</a><br> Docs: <a href="http://www.cmake.org/HTML/Documentation.html">http://www.cmake.org/HTML/Documentation.html</a><br> Mail: <a href="http://www.cmake.org/HTML/MailingLists.html">http://www.cmake.org/HTML/MailingLists.html</a><br> FAQ: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><br></pre>
</body></html>