OPTIONS_BUILD.txt 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. ``-S <path-to-source>``
  2. Path to root directory of the CMake project to build.
  3. ``-B <path-to-build>``
  4. Path to directory which CMake will use as the root of build directory.
  5. If the directory doesn't already exist CMake will make it.
  6. ``-C <initial-cache>``
  7. Pre-load a script to populate the cache.
  8. When CMake is first run in an empty build tree, it creates a
  9. ``CMakeCache.txt`` file and populates it with customizable settings for
  10. the project. This option may be used to specify a file from which
  11. to load cache entries before the first pass through the project's
  12. CMake listfiles. The loaded entries take priority over the
  13. project's default values. The given file should be a CMake script
  14. containing :command:`set` commands that use the ``CACHE`` option, not a
  15. cache-format file.
  16. References to :variable:`CMAKE_SOURCE_DIR` and :variable:`CMAKE_BINARY_DIR`
  17. within the script evaluate to the top-level source and build tree.
  18. ``-D <var>:<type>=<value>, -D <var>=<value>``
  19. Create or update a CMake ``CACHE`` entry.
  20. When CMake is first run in an empty build tree, it creates a
  21. ``CMakeCache.txt`` file and populates it with customizable settings for
  22. the project. This option may be used to specify a setting that
  23. takes priority over the project's default value. The option may be
  24. repeated for as many ``CACHE`` entries as desired.
  25. If the ``:<type>`` portion is given it must be one of the types
  26. specified by the :command:`set` command documentation for its
  27. ``CACHE`` signature.
  28. If the ``:<type>`` portion is omitted the entry will be created
  29. with no type if it does not exist with a type already. If a
  30. command in the project sets the type to ``PATH`` or ``FILEPATH``
  31. then the ``<value>`` will be converted to an absolute path.
  32. This option may also be given as a single argument:
  33. ``-D<var>:<type>=<value>`` or ``-D<var>=<value>``.
  34. ``-U <globbing_expr>``
  35. Remove matching entries from CMake ``CACHE``.
  36. This option may be used to remove one or more variables from the
  37. ``CMakeCache.txt`` file, globbing expressions using ``*`` and ``?`` are
  38. supported. The option may be repeated for as many ``CACHE`` entries as
  39. desired.
  40. Use with care, you can make your ``CMakeCache.txt`` non-working.
  41. ``-G <generator-name>``
  42. Specify a build system generator.
  43. CMake may support multiple native build systems on certain
  44. platforms. A generator is responsible for generating a particular
  45. build system. Possible generator names are specified in the
  46. :manual:`cmake-generators(7)` manual.
  47. If not specified, CMake checks the :envvar:`CMAKE_GENERATOR` environment
  48. variable and otherwise falls back to a builtin default selection.
  49. ``-T <toolset-spec>``
  50. Toolset specification for the generator, if supported.
  51. Some CMake generators support a toolset specification to tell
  52. the native build system how to choose a compiler. See the
  53. :variable:`CMAKE_GENERATOR_TOOLSET` variable for details.
  54. ``-A <platform-name>``
  55. Specify platform name if supported by generator.
  56. Some CMake generators support a platform name to be given to the
  57. native build system to choose a compiler or SDK. See the
  58. :variable:`CMAKE_GENERATOR_PLATFORM` variable for details.
  59. ``--toolchain <path-to-file>``
  60. Specify the cross compiling toolchain file, equivalent to setting
  61. :variable:`CMAKE_TOOLCHAIN_FILE` variable.
  62. ``--install-prefix <directory>``
  63. Specify the installation directory, used by the
  64. :variable:`CMAKE_INSTALL_PREFIX` variable. Must be an absolute path.
  65. ``-Wno-dev``
  66. Suppress developer warnings.
  67. Suppress warnings that are meant for the author of the
  68. ``CMakeLists.txt`` files. By default this will also turn off
  69. deprecation warnings.
  70. ``-Wdev``
  71. Enable developer warnings.
  72. Enable warnings that are meant for the author of the ``CMakeLists.txt``
  73. files. By default this will also turn on deprecation warnings.
  74. ``-Werror=dev``
  75. Make developer warnings errors.
  76. Make warnings that are meant for the author of the ``CMakeLists.txt`` files
  77. errors. By default this will also turn on deprecated warnings as errors.
  78. ``-Wno-error=dev``
  79. Make developer warnings not errors.
  80. Make warnings that are meant for the author of the ``CMakeLists.txt`` files not
  81. errors. By default this will also turn off deprecated warnings as errors.
  82. ``-Wdeprecated``
  83. Enable deprecated functionality warnings.
  84. Enable warnings for usage of deprecated functionality, that are meant
  85. for the author of the ``CMakeLists.txt`` files.
  86. ``-Wno-deprecated``
  87. Suppress deprecated functionality warnings.
  88. Suppress warnings for usage of deprecated functionality, that are meant
  89. for the author of the ``CMakeLists.txt`` files.
  90. ``-Werror=deprecated``
  91. Make deprecated macro and function warnings errors.
  92. Make warnings for usage of deprecated macros and functions, that are meant
  93. for the author of the ``CMakeLists.txt`` files, errors.
  94. ``-Wno-error=deprecated``
  95. Make deprecated macro and function warnings not errors.
  96. Make warnings for usage of deprecated macros and functions, that are meant
  97. for the author of the ``CMakeLists.txt`` files, not errors.