1CMAKE(1)                             CMake                            CMAKE(1)
2
3
4

NAME

6       cmake - CMake Command-Line Reference
7

SYNOPSIS

9          Generate a Project Buildsystem
10           cmake [<options>] <path-to-source>
11           cmake [<options>] <path-to-existing-build>
12           cmake [<options>] -S <path-to-source> -B <path-to-build>
13
14          Build a Project
15           cmake --build <dir> [<options>] [-- <build-tool-options>]
16
17          Install a Project
18           cmake --install <dir> [<options>]
19
20          Open a Project
21           cmake --open <dir>
22
23          Run a Script
24           cmake [{-D <var>=<value>}...] -P <cmake-script-file>
25
26          Run a Command-Line Tool
27           cmake -E <command> [<options>]
28
29          Run the Find-Package Tool
30           cmake --find-package [<options>]
31
32          View Help
33           cmake --help[-<topic>]
34

DESCRIPTION

36       The  cmake  executable is the command-line interface of the cross-plat‐
37       form buildsystem generator CMake.  The  above  Synopsis  lists  various
38       actions the tool can perform as described in sections below.
39
40       To build a software project with CMake, Generate a Project Buildsystem.
41       Optionally use cmake to Build a Project, Install a Project or just  run
42       the  corresponding  build tool (e.g. make) directly.  cmake can also be
43       used to View Help.
44
45       The other actions are meant for  use  by  software  developers  writing
46       scripts in the CMake language to support their builds.
47
48       For  graphical  user interfaces that may be used in place of cmake, see
49       ccmake and cmake-gui.  For command-line interfaces to the CMake testing
50       and packaging facilities, see ctest and cpack.
51
52       For  more  information on CMake at large, see also the links at the end
53       of this manual.
54

INTRODUCTION TO CMAKE BUILDSYSTEMS

56       A buildsystem describes  how  to  build  a  project’s  executables  and
57       libraries  from  its  source  code  using  a build tool to automate the
58       process.  For example, a buildsystem may be a Makefile for use  with  a
59       command-line  make tool or a project file for an Integrated Development
60       Environment  (IDE).   In  order  to  avoid  maintaining  multiple  such
61       buildsystems,  a  project  may specify its buildsystem abstractly using
62       files written in the CMake language.  From these files CMake  generates
63       a  preferred buildsystem locally for each user through a backend called
64       a generator.
65
66       To generate a buildsystem with CMake, the following must be selected:
67
68       Source Tree
69              The top-level directory containing source files provided by  the
70              project.   The  project specifies its buildsystem using files as
71              described in  the  cmake-language(7)  manual,  starting  with  a
72              top-level  file named CMakeLists.txt.  These files specify build
73              targets   and   their   dependencies   as   described   in   the
74              cmake-buildsystem(7) manual.
75
76       Build Tree
77              The  top-level  directory  in  which buildsystem files and build
78              output artifacts (e.g. executables  and  libraries)  are  to  be
79              stored.   CMake will write a CMakeCache.txt file to identify the
80              directory as a build tree and store persistent information  such
81              as buildsystem configuration options.
82
83              To  maintain  a  pristine  source tree, perform an out-of-source
84              build by using a separate dedicated build  tree.   An  in-source
85              build in which the build tree is placed in the same directory as
86              the source tree is also supported, but discouraged.
87
88       Generator
89              This chooses the kind  of  buildsystem  to  generate.   See  the
90              cmake-generators(7)  manual for documentation of all generators.
91              Run cmake --help to see a list of generators available  locally.
92              Optionally  use  the  -G option below to specify a generator, or
93              simply accept the default CMake chooses for  the  current  plat‐
94              form.
95
96              When  using  one of the Command-Line Build Tool Generators CMake
97              expects that the environment needed by the compiler toolchain is
98              already  configured  in  the  shell.   When using one of the IDE
99              Build Tool Generators, no particular environment is needed.
100

GENERATE A PROJECT BUILDSYSTEM

102       Run CMake with one of the following command signatures to  specify  the
103       source and build trees and generate a buildsystem:
104
105       cmake [<options>] <path-to-source>
106              Uses  the  current  working  directory  as  the  build tree, and
107              <path-to-source> as the source tree.  The specified path may  be
108              absolute  or  relative  to  the  current working directory.  The
109              source tree must contain a CMakeLists.txt file and must not con‐
110              tain  a  CMakeCache.txt  file  because  the latter identifies an
111              existing build tree.  For example:
112
113                 $ mkdir build ; cd build
114                 $ cmake ../src
115
116       cmake [<options>] <path-to-existing-build>
117              Uses <path-to-existing-build> as the build tree, and  loads  the
118              path to the source tree from its CMakeCache.txt file, which must
119              have already been generated by a previous  run  of  CMake.   The
120              specified  path may be absolute or relative to the current work‐
121              ing directory.  For example:
122
123                 $ cd build
124                 $ cmake .
125
126       cmake [<options>] -S <path-to-source> -B <path-to-build>
127              Uses <path-to-build> as the build tree and  <path-to-source>  as
128              the  source  tree.  The specified paths may be absolute or rela‐
129              tive to the current working directory.   The  source  tree  must
130              contain  a  CMakeLists.txt file.  The build tree will be created
131              automatically if it does not already exist.  For example:
132
133                 $ cmake -S src -B build
134
135       In all cases the <options> may be zero or more of the Options below.
136
137       After generating a buildsystem one may  use  the  corresponding  native
138       build  tool  to  build  the project.  For example, after using the Unix
139       Makefiles generator one may run make directly:
140
141              $ make
142              $ make install
143
144       Alternatively, one may use cmake to Build a  Project  by  automatically
145       choosing and invoking the appropriate native build tool.
146
147   Options
148       -S <path-to-source>
149              Path to root directory of the CMake project to build.
150
151       -B <path-to-build>
152              Path  to  directory  which  CMake  will use as the root of build
153              directory.
154
155              If the directory doesn’t already exist CMake will make it.
156
157       -C <initial-cache>
158              Pre-load a script to populate the cache.
159
160              When CMake is first run in an empty build  tree,  it  creates  a
161              CMakeCache.txt  file and populates it with customizable settings
162              for the project.  This option may be used to specify a file from
163              which  to  load  cache entries before the first pass through the
164              project’s CMake listfiles.  The  loaded  entries  take  priority
165              over  the  project’s default values.  The given file should be a
166              CMake script  containing  set()  commands  that  use  the  CACHE
167              option, not a cache-format file.
168
169              References  to  CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR within the
170              script evaluate to the top-level source and build tree.
171
172       -D <var>:<type>=<value>, -D <var>=<value>
173              Create or update a CMake CACHE entry.
174
175              When CMake is first run in an empty build  tree,  it  creates  a
176              CMakeCache.txt  file and populates it with customizable settings
177              for the project.  This option may be used to specify  a  setting
178              that  takes  priority  over  the  project’s  default value.  The
179              option may be repeated for as many CACHE entries as desired.
180
181              If the :<type> portion is given it must  be  one  of  the  types
182              specified  by the set() command documentation for its CACHE sig‐
183              nature.  If the :<type> portion is omitted  the  entry  will  be
184              created  with  no type if it does not exist with a type already.
185              If a command in the project sets the type to  PATH  or  FILEPATH
186              then the <value> will be converted to an absolute path.
187
188              This   option   may   also   be  given  as  a  single  argument:
189              -D<var>:<type>=<value> or -D<var>=<value>.
190
191       -U <globbing_expr>
192              Remove matching entries from CMake CACHE.
193
194              This option may be used to remove one or more variables from the
195              CMakeCache.txt file, globbing expressions using * and ? are sup‐
196              ported.  The option may be repeated for as many CACHE entries as
197              desired.
198
199              Use with care, you can make your CMakeCache.txt non-working.
200
201       -G <generator-name>
202              Specify a build system generator.
203
204              CMake may support multiple native build systems on certain plat‐
205              forms.  A generator is responsible for generating  a  particular
206              build  system.   Possible  generator  names are specified in the
207              cmake-generators(7) manual.
208
209              If not specified, CMake checks the  CMAKE_GENERATOR  environment
210              variable  and  otherwise  falls back to a builtin default selec‐
211              tion.
212
213       -T <toolset-spec>
214              Toolset specification for the generator, if supported.
215
216              Some CMake generators support a toolset  specification  to  tell
217              the  native  build  system  how  to  choose a compiler.  See the
218              CMAKE_GENERATOR_TOOLSET variable for details.
219
220       -A <platform-name>
221              Specify platform name if supported by generator.
222
223              Some CMake generators support a platform name to be given to the
224              native  build  system  to  choose  a  compiler  or SDK.  See the
225              CMAKE_GENERATOR_PLATFORM variable for details.
226
227       -Wno-dev
228              Suppress developer warnings.
229
230              Suppress warnings that are meant for the author  of  the  CMake‐
231              Lists.txt  files. By default this will also turn off deprecation
232              warnings.
233
234       -Wdev  Enable developer warnings.
235
236              Enable warnings that are meant for  the  author  of  the  CMake‐
237              Lists.txt  files.  By default this will also turn on deprecation
238              warnings.
239
240       -Werror=dev
241              Make developer warnings errors.
242
243              Make warnings that are  meant  for  the  author  of  the  CMake‐
244              Lists.txt files errors. By default this will also turn on depre‐
245              cated warnings as errors.
246
247       -Wno-error=dev
248              Make developer warnings not errors.
249
250              Make warnings that are  meant  for  the  author  of  the  CMake‐
251              Lists.txt  files  not errors. By default this will also turn off
252              deprecated warnings as errors.
253
254       -Wdeprecated
255              Enable deprecated functionality warnings.
256
257              Enable warnings for usage of deprecated functionality, that  are
258              meant for the author of the CMakeLists.txt files.
259
260       -Wno-deprecated
261              Suppress deprecated functionality warnings.
262
263              Suppress  warnings  for  usage of deprecated functionality, that
264              are meant for the author of the CMakeLists.txt files.
265
266       -Werror=deprecated
267              Make deprecated macro and function warnings errors.
268
269              Make warnings for usage of deprecated macros and functions, that
270              are meant for the author of the CMakeLists.txt files, errors.
271
272       -Wno-error=deprecated
273              Make deprecated macro and function warnings not errors.
274
275              Make warnings for usage of deprecated macros and functions, that
276              are meant for  the  author  of  the  CMakeLists.txt  files,  not
277              errors.
278
279       -L[A][H]
280              List non-advanced cached variables.
281
282              List  CACHE  variables will run CMake and list all the variables
283              from the  CMake  CACHE  that  are  not  marked  as  INTERNAL  or
284              ADVANCED.  This will effectively display current CMake settings,
285              which can then be changed with -D option.  Changing some of  the
286              variables  may  result in more variables being created.  If A is
287              specified, then it will display also advanced variables.   If  H
288              is specified, it will also display help for each variable.
289
290       -N     View mode only.
291
292              Only load the cache.  Do not actually run configure and generate
293              steps.
294
295       --graphviz=[file]
296              Generate graphviz of dependencies, see CMakeGraphVizOptions  for
297              more.
298
299              Generate a graphviz input file that will contain all the library
300              and executable dependencies in the project.  See the  documenta‐
301              tion for CMakeGraphVizOptions for more details.
302
303       --system-information [file]
304              Dump information about this system.
305
306              Dump  a  wide range of information about the current system.  If
307              run from the top of a binary tree for a CMake  project  it  will
308              dump additional information such as the cache, log files etc.
309
310       --log-level=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>
311              Set the log level.
312
313              The message() command will only output messages of the specified
314              log level or higher.  The default log level is STATUS.
315
316              To make a log level persist between CMake runs,  set  CMAKE_MES‐
317              SAGE_LOG_LEVEL as a cache variable instead.  If both the command
318              line option and the variable are given, the command line  option
319              takes precedence.
320
321              For  backward compatibility reasons, --loglevel is also accepted
322              as a synonym for this option.
323
324       --log-context
325              Enable the message() command outputting context attached to each
326              message.
327
328              This  option  turns on showing context for the current CMake run
329              only.  To make showing the context persistent for all subsequent
330              CMake  runs,  set CMAKE_MESSAGE_CONTEXT_SHOW as a cache variable
331              instead.  When this command line  option  is  given,  CMAKE_MES‐
332              SAGE_CONTEXT_SHOW is ignored.
333
334       --debug-trycompile
335              Do  not delete the try_compile() build tree.  Only useful on one
336              try_compile() at a time.
337
338              Do not delete the files and  directories  created  for  try_com‐
339              pile()  calls.  This is useful in debugging failed try_compiles.
340              It may however change the results of  the  try-compiles  as  old
341              junk  from  a previous try-compile may cause a different test to
342              either pass or fail incorrectly.  This option is best  used  for
343              one try-compile at a time, and only when debugging.
344
345       --debug-output
346              Put cmake in a debug mode.
347
348              Print  extra  information during the cmake run like stack traces
349              with message(SEND_ERROR) calls.
350
351       --debug-find
352              Put cmake find commands in a debug mode.
353
354              Print extra find call information during the cmake run to  stan‐
355              dard error. Output is designed for human consumption and not for
356              parsing.  See also the CMAKE_FIND_DEBUG_MODE variable for debug‐
357              ging a more local part of the project.
358
359       --trace
360              Put cmake in trace mode.
361
362              Print a trace of all calls made and from where.
363
364       --trace-expand
365              Put cmake in trace mode.
366
367              Like --trace, but with variables expanded.
368
369       --trace-format=<format>
370              Put cmake in trace mode and sets the trace output format.
371
372              <format> can be one of the following values.
373
374                 human  Prints  each  trace  line  in a human-readable format.
375                        This is the default format.
376
377                 json-v1
378                        Prints each line as a  separate  JSON  document.  Each
379                        document is separated by a newline ( \n ). It is guar‐
380                        anteed that no  newline  characters  will  be  present
381                        inside a JSON document.
382
383                        JSON trace format:
384
385                            {
386                              "file": "/full/path/to/the/CMake/file.txt",
387                              "line": 0,
388                              "cmd": "add_executable",
389                              "args": ["foo", "bar"],
390                              "time": 1579512535.9687231,
391                              "frame": 2
392                            }
393
394                        The members are:
395
396                        file   The  full  path  to the CMake source file where
397                               the function was called.
398
399                        line   The line in file of the function call.
400
401                        cmd    The name of the function that was called.
402
403                        args   A string list of all function parameters.
404
405                        time   Timestamp (seconds since epoch) of the function
406                               call.
407
408                        frame  Stack  frame  depth  of  the  function that was
409                               called.
410
411                        Additionally, the first JSON document  outputted  con‐
412                        tains  the version key for the current major and minor
413                        version of the
414
415                        JSON trace format:
416
417                            {
418                              "version": {
419                                "major": 1,
420                                "minor": 0
421                              }
422                            }
423
424                        The members are:
425
426                        version
427                               Indicates the version of the JSON  format.  The
428                               version  has  a major and minor components fol‐
429                               lowing semantic version conventions.
430
431       --trace-source=<file>
432              Put cmake in trace mode, but output only lines  of  a  specified
433              file.
434
435              Multiple options are allowed.
436
437       --trace-redirect=<file>
438              Put  cmake  in  trace  mode  and redirect trace output to a file
439              instead of stderr.
440
441       --warn-uninitialized
442              Warn about uninitialized values.
443
444              Print a warning when an uninitialized variable is used.
445
446       --warn-unused-vars
447              Warn about unused variables.
448
449              Find variables that are declared or set, but not used.
450
451       --no-warn-unused-cli
452              Don’t warn about command line options.
453
454              Don’t find variables that are declared on the command line,  but
455              not used.
456
457       --check-system-vars
458              Find problems with variable usage in system files.
459
460              Normally,  unused  and  uninitialized variables are searched for
461              only in CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR.  This flag  tells
462              CMake to warn about other files as well.
463

BUILD A PROJECT

465       CMake  provides  a command-line signature to build an already-generated
466       project binary tree:
467
468          cmake --build <dir> [<options>] [-- <build-tool-options>]
469
470       This abstracts a native build tool’s command-line  interface  with  the
471       following options:
472
473       --build <dir>
474              Project binary directory to be built.  This is required and must
475              be first.
476
477       --parallel [<jobs>], -j [<jobs>]
478              The maximum number of concurrent processes to use when building.
479              If  <jobs>  is omitted the native build tool’s default number is
480              used.
481
482              The CMAKE_BUILD_PARALLEL_LEVEL  environment  variable,  if  set,
483              specifies  a  default  parallel  level  when  this option is not
484              given.
485
486              Some native build tools always build in parallel.   The  use  of
487              <jobs> value of 1 can be used to limit to a single job.
488
489       --target <tgt>..., -t <tgt>...
490              Build <tgt> instead of the default target.  Multiple targets may
491              be given, separated by spaces.
492
493       --config <cfg>
494              For multi-configuration tools, choose configuration <cfg>.
495
496       --clean-first
497              Build target clean first,  then  build.   (To  clean  only,  use
498              --target clean.)
499
500       --use-stderr
501              Ignored.  Behavior is default in CMake >= 3.0.
502
503       --verbose, -v
504              Enable  verbose output - if supported - including the build com‐
505              mands to be executed.
506
507              This option can be omitted if VERBOSE  environment  variable  or
508              CMAKE_VERBOSE_MAKEFILE cached variable is set.
509
510       --     Pass remaining options to the native tool.
511
512       Run cmake --build with no options for quick help.
513

INSTALL A PROJECT

515       CMake provides a command-line signature to install an already-generated
516       project binary tree:
517
518          cmake --install <dir> [<options>]
519
520       This may be used after building a project to run  installation  without
521       using the generated build system or the native build tool.  The options
522       are:
523
524       --install <dir>
525              Project binary directory to install. This is required  and  must
526              be first.
527
528       --config <cfg>
529              For multi-configuration generators, choose configuration <cfg>.
530
531       --component <comp>
532              Component-based install. Only install component <comp>.
533
534       --prefix <prefix>
535              Override the installation prefix, CMAKE_INSTALL_PREFIX.
536
537       --strip
538              Strip before installing.
539
540       -v, --verbose
541              Enable verbose output.
542
543              This  option  can  be omitted if VERBOSE environment variable is
544              set.
545
546       Run cmake --install with no options for quick help.
547

OPEN A PROJECT

549          cmake --open <dir>
550
551       Open the generated project in the associated application.  This is only
552       supported by some generators.
553

RUN A SCRIPT

555          cmake [{-D <var>=<value>}...] -P <cmake-script-file>
556
557       Process the given cmake file as a script written in the CMake language.
558       No configure or generate step is performed and the cache is  not  modi‐
559       fied.   If variables are defined using -D, this must be done before the
560       -P argument.
561

RUN A COMMAND-LINE TOOL

563       CMake provides builtin command-line tools through the signature
564
565          cmake -E <command> [<options>]
566
567       Run cmake -E or cmake -E help for a  summary  of  commands.   Available
568       commands are:
569
570       capabilities
571              Report  cmake  capabilities in JSON format. The output is a JSON
572              object with the following keys:
573
574              version
575                     A JSON object with version information. Keys are:
576
577                     string The full version  string  as  displayed  by  cmake
578                            --version.
579
580                     major  The major version number in integer form.
581
582                     minor  The minor version number in integer form.
583
584                     patch  The patch level in integer form.
585
586                     suffix The cmake version suffix string.
587
588                     isDirty
589                            A  bool  that  is set if the cmake build is from a
590                            dirty tree.
591
592              generators
593                     A list available generators. Each  generator  is  a  JSON
594                     object with the following keys:
595
596                     name   A string containing the name of the generator.
597
598                     toolsetSupport
599                            true  if the generator supports toolsets and false
600                            otherwise.
601
602                     platformSupport
603                            true if the generator supports platforms and false
604                            otherwise.
605
606                     extraGenerators
607                            A  list  of  strings with all the extra generators
608                            compatible with the generator.
609
610              fileApi
611                     Optional   member    that    is    present    when    the
612                     cmake-file-api(7)  is  available.   The  value  is a JSON
613                     object with one member:
614
615                     requests
616                            A JSON array containing  zero  or  more  supported
617                            file-api  requests.  Each request is a JSON object
618                            with members:
619
620                            kind   Specifies one  of  the  supported  file-api
621                                   object kinds.
622
623                            version
624                                   A JSON array whose elements are each a JSON
625                                   object containing major and  minor  members
626                                   specifying   non-negative  integer  version
627                                   components.
628
629              serverMode
630                     true if cmake supports server-mode and false otherwise.
631
632       chdir <dir> <cmd> [<arg>...]
633              Change the current working directory and run a command.
634
635       compare_files [--ignore-eol] <file1> <file2>
636              Check if <file1> is same as <file2>. If files are the same, then
637              returns 0, if not it returns 1.  The --ignore-eol option implies
638              line-wise comparison and ignores LF/CRLF differences.
639
640       copy <file>... <destination>
641              Copy files to <destination> (either file or directory).  If mul‐
642              tiple  files  are specified, the <destination> must be directory
643              and it must exist. Wildcards are not supported.  copy does  fol‐
644              low  symlinks.  That  means  it  does not copy symlinks, but the
645              files or directories it point to.
646
647       copy_directory <dir>... <destination>
648              Copy content of <dir>... directories to <destination> directory.
649              If  <destination>  directory  does not exist it will be created.
650              copy_directory does follow symlinks.
651
652       copy_if_different <file>... <destination>
653              Copy files to <destination> (either file or directory)  if  they
654              have  changed.   If  multiple files are specified, the <destina‐
655              tion> must be directory and it  must  exist.   copy_if_different
656              does follow symlinks.
657
658       create_symlink <old> <new>
659              Create a symbolic link <new> naming <old>.
660
661              NOTE:
662                 Path  to  where  <new>  symbolic  link will be created has to
663                 exist beforehand.
664
665       echo [<string>...]
666              Displays arguments as text.
667
668       echo_append [<string>...]
669              Displays arguments as text but no new line.
670
671       env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...
672              Run command in a modified environment.
673
674       environment
675              Display the current environment variables.
676
677       false  Do nothing, with an exit code of 1.
678
679       make_directory <dir>...
680              Create <dir> directories.  If necessary, create parent  directo‐
681              ries  too.   If  a  directory already exists it will be silently
682              ignored.
683
684       md5sum <file>...
685              Create MD5 checksum of files in md5sum compatible format:
686
687                 351abe79cd3800b38cdfb25d45015a15  file1.txt
688                 052f86c15bbde68af55c7f7b340ab639  file2.txt
689
690       sha1sum <file>...
691              Create SHA1 checksum of files in sha1sum compatible format:
692
693                 4bb7932a29e6f73c97bb9272f2bdc393122f86e0  file1.txt
694                 1df4c8f318665f9a5f2ed38f55adadb7ef9f559c  file2.txt
695
696       sha224sum <file>...
697              Create SHA224 checksum of files in sha224sum compatible format:
698
699                 b9b9346bc8437bbda630b0b7ddfc5ea9ca157546dbbf4c613192f930  file1.txt
700                 6dfbe55f4d2edc5fe5c9197bca51ceaaf824e48eba0cc453088aee24  file2.txt
701
702       sha256sum <file>...
703              Create SHA256 checksum of files in sha256sum compatible format:
704
705                 76713b23615d31680afeb0e9efe94d47d3d4229191198bb46d7485f9cb191acc  file1.txt
706                 15b682ead6c12dedb1baf91231e1e89cfc7974b3787c1e2e01b986bffadae0ea  file2.txt
707
708       sha384sum <file>...
709              Create SHA384 checksum of files in sha384sum compatible format:
710
711                 acc049fedc091a22f5f2ce39a43b9057fd93c910e9afd76a6411a28a8f2b8a12c73d7129e292f94fc0329c309df49434  file1.txt
712                 668ddeb108710d271ee21c0f3acbd6a7517e2b78f9181c6a2ff3b8943af92b0195dcb7cce48aa3e17893173c0a39e23d  file2.txt
713
714       sha512sum <file>...
715              Create SHA512 checksum of files in sha512sum compatible format:
716
717                 2a78d7a6c5328cfb1467c63beac8ff21794213901eaadafd48e7800289afbc08e5fb3e86aa31116c945ee3d7bf2a6194489ec6101051083d1108defc8e1dba89  file1.txt
718                 7a0b54896fe5e70cca6dd643ad6f672614b189bf26f8153061c4d219474b05dad08c4e729af9f4b009f1a1a280cb625454bf587c690f4617c27e3aebdf3b7a2d  file2.txt
719
720       remove [-f] <file>...
721              Deprecated since version 3.17.
722
723
724              Remove the file(s). The planned behaviour was that if any of the
725              listed  files  already  do  not  exist,  the  command  returns a
726              non-zero exit code, but no message  is  logged.  The  -f  option
727              changes  the  behavior to return a zero exit code (i.e. success)
728              in such situations instead.  remove does  not  follow  symlinks.
729              That means it remove only symlinks and not files it point to.
730
731              The implementation was buggy and always returned 0. It cannot be
732              fixed without breaking backwards compatibility. Use rm instead.
733
734       remove_directory <dir>...
735              Deprecated since version 3.17.
736
737
738              Remove <dir> directories and their contents. If a directory does
739              not exist it will be silently ignored.  If <dir> is a symlink to
740              a directory, just the symlink will be removed.  Use rm instead.
741
742       rename <oldname> <newname>
743              Rename a file or directory (on one volume).  If  file  with  the
744              <newname>   name  already  exists,  then  it  will  be  silently
745              replaced.
746
747       rm [-rRf] <file> <dir>...
748              Remove the files <file> or directories dir.  Use  -r  or  -R  to
749              remove  directories  and  their contents recursively.  If any of
750              the listed files/directories do not exist, the command returns a
751              non-zero  exit  code,  but  no  message is logged. The -f option
752              changes the behavior to return a zero exit code  (i.e.  success)
753              in such situations instead.
754
755       server Launch cmake-server(7) mode.
756
757       sleep <number>...
758              Sleep for given number of seconds.
759
760       tar [cxt][vf][zjJ] file.tar [<options>] [--] [<pathname>...]
761              Create or extract a tar or zip archive.  Options are:
762
763              c      Create  a new archive containing the specified files.  If
764                     used, the <pathname>... argument is mandatory.
765
766              x      Extract to disk  from  the  archive.   The  <pathname>...
767                     argument  could be used to extract only selected files or
768                     directories.  When extracting selected files or  directo‐
769                     ries,  you  must  provide their exact names including the
770                     path, as printed by list (-t).
771
772              t      List archive contents.  The <pathname>... argument  could
773                     be used to list only selected files or directories.
774
775              v      Produce verbose output.
776
777              z      Compress the resulting archive with gzip.
778
779              j      Compress the resulting archive with bzip2.
780
781              J      Compress the resulting archive with XZ.
782
783              --zstd Compress the resulting archive with Zstandard.
784
785              --files-from=<file>
786                     Read file names from the given file, one per line.  Blank
787                     lines are ignored.  Lines may not start in -  except  for
788                     --add-file=<name> to add files whose names start in -.
789
790              --format=<format>
791                     Specify  the  format  of the archive to be created.  Sup‐
792                     ported formats are: 7zip, gnutar, pax,  paxr  (restricted
793                     pax, default), and zip.
794
795              --mtime=<date>
796                     Specify modification time recorded in tarball entries.
797
798              --     Stop  interpreting  options and treat all remaining argu‐
799                     ments as file names, even if they start with -.
800
801       time <command> [<args>...]
802              Run command and display elapsed time.
803
804       touch <file>...
805              Creates <file> if file do not exist.  If <file>  exists,  it  is
806              changing <file> access and modification times.
807
808       touch_nocreate <file>...
809              Touch  a file if it exists but do not create it.  If a file does
810              not exist it will be silently ignored.
811
812       true   Do nothing, with an exit code of 0.
813
814   Windows-specific Command-Line Tools
815       The following cmake -E commands are available only on Windows:
816
817       delete_regv <key>
818              Delete Windows registry value.
819
820       env_vs8_wince <sdkname>
821              Displays a batch file which sets the environment  for  the  pro‐
822              vided Windows CE SDK installed in VS2005.
823
824       env_vs9_wince <sdkname>
825              Displays  a  batch  file which sets the environment for the pro‐
826              vided Windows CE SDK installed in VS2008.
827
828       write_regv <key> <value>
829              Write Windows registry value.
830

RUN THE FIND-PACKAGE TOOL

832       CMake provides a pkg-config like helper for Makefile-based projects:
833
834          cmake --find-package [<options>]
835
836       It searches a package using find_package()  and  prints  the  resulting
837       flags  to  stdout.   This  can  be  used  instead of pkg-config to find
838       installed libraries  in  plain  Makefile-based  projects  or  in  auto‐
839       conf-based projects (via share/aclocal/cmake.m4).
840
841       NOTE:
842          This  mode  is not well-supported due to some technical limitations.
843          It is kept for compatibility but should not be used in new projects.
844

VIEW HELP

846       To print selected pages from the CMake documentation, use
847
848          cmake --help[-<topic>]
849
850       with one of the following options:
851
852       --help,-help,-usage,-h,-H,/?
853              Print usage information and exit.
854
855              Usage  describes  the  basic  command  line  interface  and  its
856              options.
857
858       --version,-version,/V [<f>]
859              Show program name/version banner and exit.
860
861              If  a  file  is  specified, the version is written into it.  The
862              help is printed to a named <f>ile if given.
863
864       --help-full [<f>]
865              Print all help manuals and exit.
866
867              All manuals are printed in a human-readable  text  format.   The
868              help is printed to a named <f>ile if given.
869
870       --help-manual <man> [<f>]
871              Print one help manual and exit.
872
873              The specified manual is printed in a human-readable text format.
874              The help is printed to a named <f>ile if given.
875
876       --help-manual-list [<f>]
877              List help manuals available and exit.
878
879              The list contains all manuals for which help may be obtained  by
880              using  the  --help-manual option followed by a manual name.  The
881              help is printed to a named <f>ile if given.
882
883       --help-command <cmd> [<f>]
884              Print help for one command and exit.
885
886              The cmake-commands(7) manual entry for <cmd>  is  printed  in  a
887              human-readable  text  format.   The  help  is printed to a named
888              <f>ile if given.
889
890       --help-command-list [<f>]
891              List commands with help available and exit.
892
893              The list contains all commands for which help may be obtained by
894              using the --help-command option followed by a command name.  The
895              help is printed to a named <f>ile if given.
896
897       --help-commands [<f>]
898              Print cmake-commands manual and exit.
899
900              The cmake-commands(7) manual is printed in a human-readable text
901              format.  The help is printed to a named <f>ile if given.
902
903       --help-module <mod> [<f>]
904              Print help for one module and exit.
905
906              The  cmake-modules(7)  manual  entry  for  <mod> is printed in a
907              human-readable text format.  The help  is  printed  to  a  named
908              <f>ile if given.
909
910       --help-module-list [<f>]
911              List modules with help available and exit.
912
913              The  list contains all modules for which help may be obtained by
914              using the --help-module option followed by a module  name.   The
915              help is printed to a named <f>ile if given.
916
917       --help-modules [<f>]
918              Print cmake-modules manual and exit.
919
920              The  cmake-modules(7) manual is printed in a human-readable text
921              format.  The help is printed to a named <f>ile if given.
922
923       --help-policy <cmp> [<f>]
924              Print help for one policy and exit.
925
926              The cmake-policies(7) manual entry for <cmp>  is  printed  in  a
927              human-readable  text  format.   The  help  is printed to a named
928              <f>ile if given.
929
930       --help-policy-list [<f>]
931              List policies with help available and exit.
932
933              The list contains all policies for which help may be obtained by
934              using  the  --help-policy option followed by a policy name.  The
935              help is printed to a named <f>ile if given.
936
937       --help-policies [<f>]
938              Print cmake-policies manual and exit.
939
940              The cmake-policies(7) manual is printed in a human-readable text
941              format.  The help is printed to a named <f>ile if given.
942
943       --help-property <prop> [<f>]
944              Print help for one property and exit.
945
946              The cmake-properties(7) manual entries for <prop> are printed in
947              a human-readable text format.  The help is printed  to  a  named
948              <f>ile if given.
949
950       --help-property-list [<f>]
951              List properties with help available and exit.
952
953              The  list contains all properties for which help may be obtained
954              by using the --help-property option followed by a property name.
955              The help is printed to a named <f>ile if given.
956
957       --help-properties [<f>]
958              Print cmake-properties manual and exit.
959
960              The  cmake-properties(7)  manual  is printed in a human-readable
961              text format.  The help is printed to a named <f>ile if given.
962
963       --help-variable <var> [<f>]
964              Print help for one variable and exit.
965
966              The cmake-variables(7) manual entry for <var> is  printed  in  a
967              human-readable  text  format.   The  help  is printed to a named
968              <f>ile if given.
969
970       --help-variable-list [<f>]
971              List variables with help available and exit.
972
973              The list contains all variables for which help may  be  obtained
974              by using the --help-variable option followed by a variable name.
975              The help is printed to a named <f>ile if given.
976
977       --help-variables [<f>]
978              Print cmake-variables manual and exit.
979
980              The cmake-variables(7) manual is  printed  in  a  human-readable
981              text format.  The help is printed to a named <f>ile if given.
982

SEE ALSO

984       The following resources are available to get help using CMake:
985
986       Home Page
987              https://cmake.org
988
989              The primary starting point for learning about CMake.
990
991       Online Documentation and Community Resources
992              https://cmake.org/documentation
993
994              Links  to available documentation and community resources may be
995              found on this web page.
996
997       Discourse Forum
998              https://discourse.cmake.org
999
1000              The Discourse Forum hosts discussion and questions about CMake.
1001
1003       2000-2020 Kitware, Inc. and Contributors
1004
1005
1006
1007
10083.17.2                           Apr 28, 2020                         CMAKE(1)
Impressum