1cmakecompat(1) General Commands Manual cmakecompat(1)
2
3
4
6 cmakecompat - Reference of CMake compatibility commands.
7
8
10 CMake Compatibility Listfile Commands - Obsolete commands supported by CMake for compatibility.
11
12
13 This is the documentation for now obsolete listfile commands from pre‐
14 vious CMake versions, which are still supported for compatibility rea‐
15 sons. You should instead use the newer, faster and shinier new com‐
16 mands. ;-)
17
18
19 build_name
20 Deprecated. Use ${CMAKE_SYSTEM} and ${CMAKE_CXX_COMPILER}
21 instead.
22
23 build_name(variable)
24
25 Sets the specified variable to a string representing the plat‐
26 form and compiler settings. These values are now available
27 through the CMAKE_SYSTEM and CMAKE_CXX_COMPILER variables.
28
29
30 exec_program
31 Deprecated. Use the execute_process() command instead.
32
33 Run an executable program during the processing of the CMake‐
34 List.txt file.
35
36
37 exec_program(Executable [directory in which to run]
38 [ARGS <arguments to executable>]
39 [OUTPUT_VARIABLE <var>]
40 [RETURN_VALUE <var>])
41
42 The executable is run in the optionally specified directory.
43 The executable can include arguments if it is double quoted, but
44 it is better to use the optional ARGS argument to specify argu‐
45 ments to the program. This is because cmake will then be able
46 to escape spaces in the executable path. An optional argument
47 OUTPUT_VARIABLE specifies a variable in which to store the out‐
48 put. To capture the return value of the execution, provide a
49 RETURN_VALUE. If OUTPUT_VARIABLE is specified, then no output
50 will go to the stdout/stderr of the console running cmake.
51
52
53
54 export_library_dependencies
55 Deprecated. Use INSTALL(EXPORT) or EXPORT command.
56
57 This command generates an old-style library dependencies file.
58 Projects requiring CMake 2.6 or later should not use the com‐
59 mand. Use instead the install(EXPORT) command to help export
60 targets from an installation tree and the export() command to
61 export targets from a build tree.
62
63
64 The old-style library dependencies file does not take into
65 account per-configuration names of libraries or the LINK_INTER‐
66 FACE_LIBRARIES target property.
67
68
69 export_library_dependencies(<file> [APPEND])
70
71 Create a file named <file> that can be included into a CMake
72 listfile with the INCLUDE command. The file will contain a num‐
73 ber of SET commands that will set all the variables needed for
74 library dependency information. This should be the last command
75 in the top level CMakeLists.txt file of the project. If the
76 APPEND option is specified, the SET commands will be appended to
77 the given file instead of replacing it.
78
79
80 install_files
81 Deprecated. Use the install(FILES ) command instead.
82
83 This command has been superceded by the install command. It is
84 provided for compatibility with older CMake code. The FILES
85 form is directly replaced by the FILES form of the install com‐
86 mand. The regexp form can be expressed more clearly using the
87 GLOB form of the file command.
88
89
90 install_files(<dir> extension file file ...)
91
92 Create rules to install the listed files with the given exten‐
93 sion into the given directory. Only files existing in the cur‐
94 rent source tree or its corresponding location in the binary
95 tree may be listed. If a file specified already has an exten‐
96 sion, that extension will be removed first. This is useful for
97 providing lists of source files such as foo.cxx when you want
98 the corresponding foo.h to be installed. A typical extension is
99 '.h'.
100
101
102 install_files(<dir> regexp)
103
104 Any files in the current source directory that match the regular
105 expression will be installed.
106
107
108 install_files(<dir> FILES file file ...)
109
110 Any files listed after the FILES keyword will be installed
111 explicitly from the names given. Full paths are allowed in this
112 form.
113
114
115 The directory <dir> is relative to the installation prefix,
116 which is stored in the variable CMAKE_INSTALL_PREFIX.
117
118
119 install_programs
120 Deprecated. Use the install(PROGRAMS ) command instead.
121
122 This command has been superceded by the install command. It is
123 provided for compatibility with older CMake code. The FILES
124 form is directly replaced by the PROGRAMS form of the INSTALL
125 command. The regexp form can be expressed more clearly using
126 the GLOB form of the FILE command.
127
128
129 install_programs(<dir> file1 file2 [file3 ...])
130 install_programs(<dir> FILES file1 [file2 ...])
131
132 Create rules to install the listed programs into the given
133 directory. Use the FILES argument to guarantee that the file
134 list version of the command will be used even when there is only
135 one argument.
136
137
138 install_programs(<dir> regexp)
139
140 In the second form any program in the current source directory
141 that matches the regular expression will be installed.
142
143
144 This command is intended to install programs that are not built
145 by cmake, such as shell scripts. See the TARGETS form of the
146 INSTALL command to create installation rules for targets built
147 by cmake.
148
149
150 The directory <dir> is relative to the installation prefix,
151 which is stored in the variable CMAKE_INSTALL_PREFIX.
152
153
154 install_targets
155 Deprecated. Use the install(TARGETS ) command instead.
156
157 This command has been superceded by the install command. It is
158 provided for compatibility with older CMake code.
159
160
161 install_targets(<dir> [RUNTIME_DIRECTORY dir] target target)
162
163 Create rules to install the listed targets into the given direc‐
164 tory. The directory <dir> is relative to the installation pre‐
165 fix, which is stored in the variable CMAKE_INSTALL_PREFIX. If
166 RUNTIME_DIRECTORY is specified, then on systems with special
167 runtime files (Windows DLL), the files will be copied to that
168 directory.
169
170
171 link_libraries
172 Deprecated. Use the target_link_libraries() command instead.
173
174 Link libraries to all targets added later.
175
176
177 link_libraries(library1 <debug | optimized> library2 ...)
178
179 Specify a list of libraries to be linked into any following tar‐
180 gets (typically added with the add_executable or add_library
181 calls). This command is passed down to all subdirectories. The
182 debug and optimized strings may be used to indicate that the
183 next library listed is to be used only for that specific type of
184 build.
185
186
187 make_directory
188 Deprecated. Use the file(MAKE_DIRECTORY ) command instead.
189
190 make_directory(directory)
191
192 Creates the specified directory. Full paths should be given.
193 Any parent directories that do not exist will also be created.
194 Use with care.
195
196
197 remove Deprecated. Use the list(REMOVE_ITEM ) command instead.
198
199 remove(VAR VALUE VALUE ...)
200
201 Removes VALUE from the variable VAR. This is typically used to
202 remove entries from a vector (e.g. semicolon separated list).
203 VALUE is expanded.
204
205
206 subdir_depends
207 Deprecated. Does nothing.
208
209 subdir_depends(subdir dep1 dep2 ...)
210
211 Does not do anything. This command used to help projects order
212 parallel builds correctly. This functionality is now automatic.
213
214
215 subdirs
216 Deprecated. Use the add_subdirectory() command instead.
217
218 Add a list of subdirectories to the build.
219
220
221 subdirs(dir1 dir2 ...[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...]
222 [PREORDER] )
223
224 Add a list of subdirectories to the build. The add_subdirectory
225 command should be used instead of subdirs although subdirs will
226 still work. This will cause any CMakeLists.txt files in the sub
227 directories to be processed by CMake. Any directories after the
228 PREORDER flag are traversed first by makefile builds, the PRE‐
229 ORDER flag has no effect on IDE projects. Any directories after
230 the EXCLUDE_FROM_ALL marker will not be included in the top
231 level makefile or project file. This is useful for having CMake
232 create makefiles or projects for a set of examples in a project.
233 You would want CMake to generate makefiles or project files for
234 all the examples at the same time, but you would not want them
235 to show up in the top level project or be built each time make
236 is run from the top.
237
238
239 use_mangled_mesa
240 Copy mesa headers for use in combination with system GL.
241
242 use_mangled_mesa(PATH_TO_MESA OUTPUT_DIRECTORY)
243
244 The path to mesa includes, should contain gl_mangle.h. The mesa
245 headers are copied to the specified output directory. This
246 allows mangled mesa headers to override other GL headers by
247 being added to the include directory path earlier.
248
249
250 utility_source
251 Specify the source tree of a third-party utility.
252
253 utility_source(cache_entry executable_name
254 path_to_source [file1 file2 ...])
255
256 When a third-party utility's source is included in the distribu‐
257 tion, this command specifies its location and name. The cache
258 entry will not be set unless the path_to_source and all listed
259 files exist. It is assumed that the source tree of the utility
260 will have been built before it is needed.
261
262
263 When cross compiling CMake will print a warning if a util‐
264 ity_source() command is executed, because in many cases it is
265 used to build an executable which is executed later on. This
266 doesn't work when cross compiling, since the executable can run
267 only on their target platform. So in this case the cache entry
268 has to be adjusted manually so it points to an executable which
269 is runnable on the build host.
270
271
272 variable_requires
273 Deprecated. Use the if() command instead.
274
275 Assert satisfaction of an option's required variables.
276
277
278 variable_requires(TEST_VARIABLE RESULT_VARIABLE
279 REQUIRED_VARIABLE1
280 REQUIRED_VARIABLE2 ...)
281
282 The first argument (TEST_VARIABLE) is the name of the variable
283 to be tested, if that variable is false nothing else is done. If
284 TEST_VARIABLE is true, then the next argument (RESULT_VARIABLE)
285 is a variable that is set to true if all the required variables
286 are set. The rest of the arguments are variables that must be
287 true or not set to NOTFOUND to avoid an error. If any are not
288 true, an error is reported.
289
290
291 write_file
292 Deprecated. Use the file(WRITE ) command instead.
293
294 write_file(filename "message to write"... [APPEND])
295
296 The first argument is the file name, the rest of the arguments
297 are messages to write. If the argument APPEND is specified, then
298 the message will be appended.
299
300
301 NOTE 1: file(WRITE ... and file(APPEND ... do exactly the same
302 as this one but add some more functionality.
303
304
305 NOTE 2: When using write_file the produced file cannot be used
306 as an input to CMake (CONFIGURE_FILE, source file ...) because
307 it will lead to an infinite loop. Use configure_file if you want
308 to generate input files to CMake.
309
310
312 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium. All
313 rights reserved.
314
315
316 Redistribution and use in source and binary forms, with or without mod‐
317 ification, are permitted provided that the following conditions are
318 met:
319
320
321 Redistributions of source code must retain the above copyright notice,
322 this list of conditions and the following disclaimer.
323
324
325 Redistributions in binary form must reproduce the above copyright
326 notice, this list of conditions and the following disclaimer in the
327 documentation and/or other materials provided with the distribution.
328
329
330 Neither the names of Kitware, Inc., the Insight Software Consortium,
331 nor the names of their contributors may be used to endorse or promote
332 products derived from this software without specific prior written per‐
333 mission.
334
335
336 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
337 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
338 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC‐
339 ULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
340 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
341 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
342 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
343 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
344 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
345 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
346 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
347
348
350 The following resources are available to get help using CMake:
351
352
353 Home Page
354 http://www.cmake.org
355
356 The primary starting point for learning about CMake.
357
358
359 Frequently Asked Questions
360 http://www.cmake.org/Wiki/CMake_FAQ
361
362 A Wiki is provided containing answers to frequently asked ques‐
363 tions.
364
365
366 Online Documentation
367 http://www.cmake.org/HTML/Documentation.html
368
369 Links to available documentation may be found on this web page.
370
371
372 Mailing List
373 http://www.cmake.org/HTML/MailingLists.html
374
375 For help and discussion about using cmake, a mailing list is
376 provided at cmake@cmake.org. The list is member-post-only but
377 one may sign up on the CMake web page. Please first read the
378 full documentation at http://www.cmake.org before posting ques‐
379 tions to the list.
380
381
382 Summary of helpful links:
383
384
385 Home: http://www.cmake.org
386 Docs: http://www.cmake.org/HTML/Documentation.html
387 Mail: http://www.cmake.org/HTML/MailingLists.html
388 FAQ: http://www.cmake.org/Wiki/CMake_FAQ
389
390
391
392
393cmake 2.8.4 March 31, 2011 cmakecompat(1)