133 lines
17 KiB
HTML
133 lines
17 KiB
HTML
<html><head><title>cmake-compatcommands - 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_Compatibility Commands"<b>Compatibility 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-compatcommands - Reference of CMake compatibility commands.
|
|
<h2><a name="section_Compatibility Commands"/>Compatibility Commands</h2>
|
|
<ul>
|
|
<li><a href="#command:build_name"><b><code>build_name</code></b></a></li> <li><a href="#command:exec_program"><b><code>exec_program</code></b></a></li> <li><a href="#command:export_library_dependencies"><b><code>export_library_dependencies</code></b></a></li> <li><a href="#command:install_files"><b><code>install_files</code></b></a></li> <li><a href="#command:install_programs"><b><code>install_programs</code></b></a></li> <li><a href="#command:install_targets"><b><code>install_targets</code></b></a></li> <li><a href="#command:link_libraries"><b><code>link_libraries</code></b></a></li> <li><a href="#command:make_directory"><b><code>make_directory</code></b></a></li> <li><a href="#command:remove"><b><code>remove</code></b></a></li> <li><a href="#command:subdir_depends"><b><code>subdir_depends</code></b></a></li> <li><a href="#command:subdirs"><b><code>subdirs</code></b></a></li> <li><a href="#command:use_mangled_mesa"><b><code>use_mangled_mesa</code></b></a></li> <li><a href="#command:utility_source"><b><code>utility_source</code></b></a></li> <li><a href="#command:variable_requires"><b><code>variable_requires</code></b></a></li> <li><a href="#command:write_file"><b><code>write_file</code></b></a></li></ul>
|
|
<pre> CMake Compatibility Listfile Commands - Obsolete commands supported by CMake for compatibility.</pre>
|
|
|
|
<p>This is the documentation for now obsolete listfile commands from previous CMake versions, which are still supported for compatibility reasons. You should instead use the newer, faster and shinier new commands. ;-)
|
|
<ul>
|
|
<li>
|
|
<a name="command:build_name"><b><code>build_name</code></b></a>: Deprecated. Use ${CMAKE_SYSTEM} and ${CMAKE_CXX_COMPILER} instead.<br>
|
|
<pre> build_name(variable)<br></pre>
|
|
<p>Sets the specified variable to a string representing the platform and compiler settings. These values are now available through the CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables.
|
|
</li>
|
|
<li>
|
|
<a name="command:exec_program"><b><code>exec_program</code></b></a>: Deprecated. Use the execute_process() command instead.<br>
|
|
<p>Run an executable program during the processing of the CMakeList.txt file.<br><pre> exec_program(Executable [directory in which to run]<br> [ARGS <arguments to executable>]<br> [OUTPUT_VARIABLE <var>]<br> [RETURN_VALUE <var>])<br></pre>
|
|
<p>The executable is run in the optionally specified directory. The executable can include arguments if it is double quoted, but it is better to use the optional ARGS argument to specify arguments to the program. This is because cmake will then be able to escape spaces in the executable path. An optional argument OUTPUT_VARIABLE specifies a variable in which to store the output. To capture the return value of the execution, provide a RETURN_VALUE. If OUTPUT_VARIABLE is specified, then no output will go to the stdout/stderr of the console running cmake.<br>
|
|
</li>
|
|
<li>
|
|
<a name="command:export_library_dependencies"><b><code>export_library_dependencies</code></b></a>: Deprecated. Use INSTALL(EXPORT) or EXPORT command.<br>
|
|
<p>This command generates an old-style library dependencies file. Projects requiring CMake 2.6 or later should not use the command. Use instead the install(EXPORT) command to help export targets from an installation tree and the export() command to export targets from a build tree.<br><p>The old-style library dependencies file does not take into account per-configuration names of libraries or the LINK_INTERFACE_LIBRARIES target property.<br><pre> export_library_dependencies(<file> [APPEND])<br></pre>
|
|
<p>Create a file named <file> that can be included into a CMake listfile with the INCLUDE command. The file will contain a number of SET commands that will set all the variables needed for library dependency information. This should be the last command in the top level CMakeLists.txt file of the project. If the APPEND option is specified, the SET commands will be appended to the given file instead of replacing it.
|
|
</li>
|
|
<li>
|
|
<a name="command:install_files"><b><code>install_files</code></b></a>: Deprecated. Use the install(FILES ) command instead.<br>
|
|
<p>This command has been superceded by the install command. It is provided for compatibility with older CMake code. The FILES form is directly replaced by the FILES form of the install command. The regexp form can be expressed more clearly using the GLOB form of the file command.<br><pre> install_files(<dir> extension file file ...)<br></pre>
|
|
<p>Create rules to install the listed files with the given extension into the given directory. Only files existing in the current source tree or its corresponding location in the binary tree may be listed. If a file specified already has an extension, that extension will be removed first. This is useful for providing lists of source files such as foo.cxx when you want the corresponding foo.h to be installed. A typical extension is '.h'.<br><pre> install_files(<dir> regexp)<br></pre>
|
|
<p>Any files in the current source directory that match the regular expression will be installed.<br><pre> install_files(<dir> FILES file file ...)<br></pre>
|
|
<p>Any files listed after the FILES keyword will be installed explicitly from the names given. Full paths are allowed in this form.<br><p>The directory <dir> is relative to the installation prefix, which is stored in the variable CMAKE_INSTALL_PREFIX.
|
|
</li>
|
|
<li>
|
|
<a name="command:install_programs"><b><code>install_programs</code></b></a>: Deprecated. Use the install(PROGRAMS ) command instead.<br>
|
|
<p>This command has been superceded by the install command. It is provided for compatibility with older CMake code. The FILES form is directly replaced by the PROGRAMS form of the INSTALL command. The regexp form can be expressed more clearly using the GLOB form of the FILE command.<br><pre> install_programs(<dir> file1 file2 [file3 ...])<br> install_programs(<dir> FILES file1 [file2 ...])<br></pre>
|
|
<p>Create rules to install the listed programs into the given directory. Use the FILES argument to guarantee that the file list version of the command will be used even when there is only one argument.<br><pre> install_programs(<dir> regexp)<br></pre>
|
|
<p>In the second form any program in the current source directory that matches the regular expression will be installed.<br><p>This command is intended to install programs that are not built by cmake, such as shell scripts. See the TARGETS form of the INSTALL command to create installation rules for targets built by cmake.<br><p>The directory <dir> is relative to the installation prefix, which is stored in the variable CMAKE_INSTALL_PREFIX.
|
|
</li>
|
|
<li>
|
|
<a name="command:install_targets"><b><code>install_targets</code></b></a>: Deprecated. Use the install(TARGETS ) command instead.<br>
|
|
<p>This command has been superceded by the install command. It is provided for compatibility with older CMake code.<br><pre> install_targets(<dir> [RUNTIME_DIRECTORY dir] target target)<br></pre>
|
|
<p>Create rules to install the listed targets into the given directory. The directory <dir> is relative to the installation prefix, which is stored in the variable CMAKE_INSTALL_PREFIX. If RUNTIME_DIRECTORY is specified, then on systems with special runtime files (Windows DLL), the files will be copied to that directory.
|
|
</li>
|
|
<li>
|
|
<a name="command:link_libraries"><b><code>link_libraries</code></b></a>: Deprecated. Use the target_link_libraries() command instead.<br>
|
|
<p>Link libraries to all targets added later.<br><pre> link_libraries(library1 <debug | optimized> library2 ...)<br></pre>
|
|
<p>Specify a list of libraries to be linked into any following targets (typically added with the add_executable or add_library calls). This command is passed down to all subdirectories. The debug and optimized strings may be used to indicate that the next library listed is to be used only for that specific type of build.
|
|
</li>
|
|
<li>
|
|
<a name="command:make_directory"><b><code>make_directory</code></b></a>: Deprecated. Use the file(MAKE_DIRECTORY ) command instead.<br>
|
|
<pre> make_directory(directory)<br></pre>
|
|
<p>Creates the specified directory. Full paths should be given. Any parent directories that do not exist will also be created. Use with care.
|
|
</li>
|
|
<li>
|
|
<a name="command:remove"><b><code>remove</code></b></a>: Deprecated. Use the list(REMOVE_ITEM ) command instead.<br>
|
|
<pre> remove(VAR VALUE VALUE ...)<br></pre>
|
|
<p>Removes VALUE from the variable VAR. This is typically used to remove entries from a vector (e.g. semicolon separated list). VALUE is expanded.
|
|
</li>
|
|
<li>
|
|
<a name="command:subdir_depends"><b><code>subdir_depends</code></b></a>: Deprecated. Does nothing.<br>
|
|
<pre> subdir_depends(subdir dep1 dep2 ...)<br></pre>
|
|
<p>Does not do anything. This command used to help projects order parallel builds correctly. This functionality is now automatic.
|
|
</li>
|
|
<li>
|
|
<a name="command:subdirs"><b><code>subdirs</code></b></a>: Deprecated. Use the add_subdirectory() command instead.<br>
|
|
<p>Add a list of subdirectories to the build.<br><pre> subdirs(dir1 dir2 ...[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...]<br> [PREORDER] )<br></pre>
|
|
<p>Add a list of subdirectories to the build. The add_subdirectory command should be used instead of subdirs although subdirs will still work. This will cause any CMakeLists.txt files in the sub directories to be processed by CMake. Any directories after the PREORDER flag are traversed first by makefile builds, the PREORDER flag has no effect on IDE projects. Any directories after the EXCLUDE_FROM_ALL marker will not be included in the top level makefile or project file. This is useful for having CMake create makefiles or projects for a set of examples in a project. You would want CMake to generate makefiles or project files for all the examples at the same time, but you would not want them to show up in the top level project or be built each time make is run from the top.
|
|
</li>
|
|
<li>
|
|
<a name="command:use_mangled_mesa"><b><code>use_mangled_mesa</code></b></a>: Copy mesa headers for use in combination with system GL.<br>
|
|
<pre> use_mangled_mesa(PATH_TO_MESA OUTPUT_DIRECTORY)<br></pre>
|
|
<p>The path to mesa includes, should contain gl_mangle.h. The mesa headers are copied to the specified output directory. This allows mangled mesa headers to override other GL headers by being added to the include directory path earlier.
|
|
</li>
|
|
<li>
|
|
<a name="command:utility_source"><b><code>utility_source</code></b></a>: Specify the source tree of a third-party utility.<br>
|
|
<pre> utility_source(cache_entry executable_name<br> path_to_source [file1 file2 ...])<br></pre>
|
|
<p>When a third-party utility's source is included in the distribution, this command specifies its location and name. The cache entry will not be set unless the path_to_source and all listed files exist. It is assumed that the source tree of the utility will have been built before it is needed.<br><p>When cross compiling CMake will print a warning if a utility_source() command is executed, because in many cases it is used to build an executable which is executed later on. This doesn't work when cross compiling, since the executable can run only on their target platform. So in this case the cache entry has to be adjusted manually so it points to an executable which is runnable on the build host.
|
|
</li>
|
|
<li>
|
|
<a name="command:variable_requires"><b><code>variable_requires</code></b></a>: Deprecated. Use the if() command instead.<br>
|
|
<p>Assert satisfaction of an option's required variables.<br><pre> variable_requires(TEST_VARIABLE RESULT_VARIABLE<br> REQUIRED_VARIABLE1<br> REQUIRED_VARIABLE2 ...)<br></pre>
|
|
<p>The first argument (TEST_VARIABLE) is the name of the variable to be tested, if that variable is false nothing else is done. If TEST_VARIABLE is true, then the next argument (RESULT_VARIABLE) is a variable that is set to true if all the required variables are set. The rest of the arguments are variables that must be true or not set to NOTFOUND to avoid an error. If any are not true, an error is reported.
|
|
</li>
|
|
<li>
|
|
<a name="command:write_file"><b><code>write_file</code></b></a>: Deprecated. Use the file(WRITE ) command instead.<br>
|
|
<pre> write_file(filename "message to write"... [APPEND])<br></pre>
|
|
<p>The first argument is the file name, the rest of the arguments are messages to write. If the argument APPEND is specified, then the message will be appended.<br><p>NOTE 1: file(WRITE ... and file(APPEND ... do exactly the same as this one but add some more functionality.<br><p>NOTE 2: When using write_file the produced file cannot be used as an input to CMake (CONFIGURE_FILE, source file ...) because it will lead to an infinite loop. Use configure_file if you want to generate input files to CMake.
|
|
</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>
|