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