cmake.1.rst 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. cmake(1)
  2. ********
  3. Synopsis
  4. ========
  5. ::
  6. cmake [options] <path-to-source>
  7. cmake [options] <path-to-existing-build>
  8. Description
  9. ===========
  10. The "cmake" executable is the CMake command-line interface. It may be
  11. used to configure projects in scripts. Project configuration settings
  12. may be specified on the command line with the -D option. The -i
  13. option will cause cmake to interactively prompt for such settings.
  14. CMake is a cross-platform build system generator. Projects specify
  15. their build process with platform-independent CMake listfiles included
  16. in each directory of a source tree with the name CMakeLists.txt.
  17. Users build a project by using CMake to generate a build system for a
  18. native tool on their platform.
  19. .. include:: OPTIONS_BUILD.txt
  20. * ``-E``: CMake command mode.
  21. For true platform independence, CMake provides a list of commands
  22. that can be used on all systems. Run with -E help for the usage
  23. information. Commands available are: chdir, compare_files, copy,
  24. copy_directory, copy_if_different, echo, echo_append, environment,
  25. make_directory, md5sum, remove, remove_directory, rename, tar, time,
  26. touch, touch_nocreate. In addition, some platform specific commands
  27. are available. On Windows: delete_regv, write_regv. On
  28. UNIX: create_symlink.
  29. * ``-L[A][H]``: List non-advanced cached variables.
  30. List cache variables will run CMake and list all the variables from
  31. the CMake cache that are not marked as INTERNAL or ADVANCED. This
  32. will effectively display current CMake settings, which can then be
  33. changed with -D option. Changing some of the variables may result
  34. in more variables being created. If A is specified, then it will
  35. display also advanced variables. If H is specified, it will also
  36. display help for each variable.
  37. * ``--build <dir>``: Build a CMake-generated project binary tree.
  38. This abstracts a native build tool's command-line interface with the
  39. following options:
  40. ::
  41. <dir> = Project binary directory to be built.
  42. --target <tgt> = Build <tgt> instead of default targets.
  43. --config <cfg> = For multi-configuration tools, choose <cfg>.
  44. --clean-first = Build target 'clean' first, then build.
  45. (To clean only, use --target 'clean'.)
  46. --use-stderr = Ignored. Behavior is default in CMake >= 3.0.
  47. -- = Pass remaining options to the native tool.
  48. Run cmake --build with no options for quick help.
  49. * ``-N``: View mode only.
  50. Only load the cache. Do not actually run configure and generate
  51. steps.
  52. * ``-P <file>``: Process script mode.
  53. Process the given cmake file as a script written in the CMake
  54. language. No configure or generate step is performed and the cache
  55. is not modified. If variables are defined using -D, this must be
  56. done before the -P argument.
  57. * ``--find-package``: Run in pkg-config like mode.
  58. Search a package using find_package() and print the resulting flags
  59. to stdout. This can be used to use cmake instead of pkg-config to
  60. find installed libraries in plain Makefile-based projects or in
  61. autoconf-based projects (via share/aclocal/cmake.m4).
  62. * ``--graphviz=[file]``: Generate graphviz of dependencies, see CMakeGraphVizOptions.cmake for more.
  63. Generate a graphviz input file that will contain all the library and
  64. executable dependencies in the project. See the documentation for
  65. CMakeGraphVizOptions.cmake for more details.
  66. * ``--system-information [file]``: Dump information about this system.
  67. Dump a wide range of information about the current system. If run
  68. from the top of a binary tree for a CMake project it will dump
  69. additional information such as the cache, log files etc.
  70. * ``--debug-trycompile``: Do not delete the try_compile build tree. Only useful on one try_compile at a time.
  71. Do not delete the files and directories created for try_compile
  72. calls. This is useful in debugging failed try_compiles. It may
  73. however change the results of the try-compiles as old junk from a
  74. previous try-compile may cause a different test to either pass or
  75. fail incorrectly. This option is best used for one try-compile at a
  76. time, and only when debugging.
  77. * ``--debug-output``: Put cmake in a debug mode.
  78. Print extra stuff during the cmake run like stack traces with
  79. message(send_error ) calls.
  80. * ``--trace``: Put cmake in trace mode.
  81. Print a trace of all calls made and from where with
  82. message(send_error ) calls.
  83. * ``--warn-uninitialized``: Warn about uninitialized values.
  84. Print a warning when an uninitialized variable is used.
  85. * ``--warn-unused-vars``: Warn about unused variables.
  86. Find variables that are declared or set, but not used.
  87. * ``--no-warn-unused-cli``: Don't warn about command line options.
  88. Don't find variables that are declared on the command line, but not
  89. used.
  90. * ``--check-system-vars``: Find problems with variable usage in system files.
  91. Normally, unused and uninitialized variables are searched for only
  92. in CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. This flag tells CMake to
  93. warn about other files as well.
  94. .. include:: OPTIONS_HELP.txt
  95. See Also
  96. ========
  97. .. include:: LINKS.txt