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 output_required_files
198 Deprecated. Approximate C preprocessor dependency scanning.
199
200 This command exists only because ancient CMake versions provided
201 it. CMake handles preprocessor dependency scanning automati‐
202 cally using a more advanced scanner.
203
204
205 output_required_files(srcfile outputfile)
206
207 Outputs a list of all the source files that are required by the
208 specified srcfile. This list is written into outputfile. This is
209 similar to writing out the dependencies for srcfile except that
210 it jumps from .h files into .cxx, .c and .cpp files if possible.
211
212
213 remove Deprecated. Use the list(REMOVE_ITEM ) command instead.
214
215 remove(VAR VALUE VALUE ...)
216
217 Removes VALUE from the variable VAR. This is typically used to
218 remove entries from a vector (e.g. semicolon separated list).
219 VALUE is expanded.
220
221
222 subdir_depends
223 Deprecated. Does nothing.
224
225 subdir_depends(subdir dep1 dep2 ...)
226
227 Does not do anything. This command used to help projects order
228 parallel builds correctly. This functionality is now automatic.
229
230
231 subdirs
232 Deprecated. Use the add_subdirectory() command instead.
233
234 Add a list of subdirectories to the build.
235
236
237 subdirs(dir1 dir2 ...[EXCLUDE_FROM_ALL exclude_dir1 exclude_dir2 ...]
238 [PREORDER] )
239
240 Add a list of subdirectories to the build. The add_subdirectory
241 command should be used instead of subdirs although subdirs will
242 still work. This will cause any CMakeLists.txt files in the sub
243 directories to be processed by CMake. Any directories after the
244 PREORDER flag are traversed first by makefile builds, the PRE‐
245 ORDER flag has no effect on IDE projects. Any directories after
246 the EXCLUDE_FROM_ALL marker will not be included in the top
247 level makefile or project file. This is useful for having CMake
248 create makefiles or projects for a set of examples in a project.
249 You would want CMake to generate makefiles or project files for
250 all the examples at the same time, but you would not want them
251 to show up in the top level project or be built each time make
252 is run from the top.
253
254
255 use_mangled_mesa
256 Copy mesa headers for use in combination with system GL.
257
258 use_mangled_mesa(PATH_TO_MESA OUTPUT_DIRECTORY)
259
260 The path to mesa includes, should contain gl_mangle.h. The mesa
261 headers are copied to the specified output directory. This
262 allows mangled mesa headers to override other GL headers by
263 being added to the include directory path earlier.
264
265
266 utility_source
267 Specify the source tree of a third-party utility.
268
269 utility_source(cache_entry executable_name
270 path_to_source [file1 file2 ...])
271
272 When a third-party utility's source is included in the distribu‐
273 tion, this command specifies its location and name. The cache
274 entry will not be set unless the path_to_source and all listed
275 files exist. It is assumed that the source tree of the utility
276 will have been built before it is needed.
277
278
279 When cross compiling CMake will print a warning if a util‐
280 ity_source() command is executed, because in many cases it is
281 used to build an executable which is executed later on. This
282 doesn't work when cross compiling, since the executable can run
283 only on their target platform. So in this case the cache entry
284 has to be adjusted manually so it points to an executable which
285 is runnable on the build host.
286
287
288 variable_requires
289 Deprecated. Use the if() command instead.
290
291 Assert satisfaction of an option's required variables.
292
293
294 variable_requires(TEST_VARIABLE RESULT_VARIABLE
295 REQUIRED_VARIABLE1
296 REQUIRED_VARIABLE2 ...)
297
298 The first argument (TEST_VARIABLE) is the name of the variable
299 to be tested, if that variable is false nothing else is done. If
300 TEST_VARIABLE is true, then the next argument (RESULT_VARIABLE)
301 is a variable that is set to true if all the required variables
302 are set. The rest of the arguments are variables that must be
303 true or not set to NOTFOUND to avoid an error. If any are not
304 true, an error is reported.
305
306
307 write_file
308 Deprecated. Use the file(WRITE ) command instead.
309
310 write_file(filename "message to write"... [APPEND])
311
312 The first argument is the file name, the rest of the arguments
313 are messages to write. If the argument APPEND is specified, then
314 the message will be appended.
315
316
317 NOTE 1: file(WRITE ... and file(APPEND ... do exactly the same
318 as this one but add some more functionality.
319
320
321 NOTE 2: When using write_file the produced file cannot be used
322 as an input to CMake (CONFIGURE_FILE, source file ...) because
323 it will lead to an infinite loop. Use configure_file if you want
324 to generate input files to CMake.
325
326
328 Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. All
329 rights reserved.
330
331
332 Redistribution and use in source and binary forms, with or without mod‐
333 ification, are permitted provided that the following conditions are
334 met:
335
336
337 Redistributions of source code must retain the above copyright notice,
338 this list of conditions and the following disclaimer.
339
340
341 Redistributions in binary form must reproduce the above copyright
342 notice, this list of conditions and the following disclaimer in the
343 documentation and/or other materials provided with the distribution.
344
345
346 Neither the names of Kitware, Inc., the Insight Software Consortium,
347 nor the names of their contributors may be used to endorse or promote
348 products derived from this software without specific prior written per‐
349 mission.
350
351
352 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
353 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
354 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTIC‐
355 ULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
356 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
357 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
358 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
359 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
360 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
361 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
362 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
363
364
366 The following resources are available to get help using CMake:
367
368
369 Home Page
370 http://www.cmake.org
371
372 The primary starting point for learning about CMake.
373
374
375 Frequently Asked Questions
376 http://www.cmake.org/Wiki/CMake_FAQ
377
378 A Wiki is provided containing answers to frequently asked ques‐
379 tions.
380
381
382 Online Documentation
383 http://www.cmake.org/HTML/Documentation.html
384
385 Links to available documentation may be found on this web page.
386
387
388 Mailing List
389 http://www.cmake.org/HTML/MailingLists.html
390
391 For help and discussion about using cmake, a mailing list is
392 provided at cmake@cmake.org. The list is member-post-only but
393 one may sign up on the CMake web page. Please first read the
394 full documentation at http://www.cmake.org before posting ques‐
395 tions to the list.
396
397
398
399
400cmake 2.8.12.2 October 15, 2014 cmakecompat(1)