diff --git a/docs/examples/run-example.py b/docs/examples/run-example.py index ea0f05e..5c169cf 100755 --- a/docs/examples/run-example.py +++ b/docs/examples/run-example.py @@ -61,7 +61,7 @@ else: commands = [ 'rm -rf _builds', - 'cmake -H{} -B_builds'.format(relative_example_dir) + 'cmake -S{} -B_builds'.format(relative_example_dir) ] doc_file.write('.. code-block:: none\n') diff --git a/docs/first-step/generate-native-tool/cli-make.rst b/docs/first-step/generate-native-tool/cli-make.rst index 294cb76..e391c3f 100644 --- a/docs/first-step/generate-native-tool/cli-make.rst +++ b/docs/first-step/generate-native-tool/cli-make.rst @@ -13,7 +13,7 @@ to the directory with sources: [cgold-example]> ls CMakeLists.txt foo.cpp -Generate Makefile using CMake. Use :ref:`-H. <-H>` :ref:`-B_builds <-B>` for +Generate Makefile using CMake. Use :ref:`-S. <-S>` :ref:`-B_builds <-B>` for specifying paths and ``-G "Unix Makefiles"`` for the generator (note that ``Unix Makefiles`` is usually the default generator so ``-G`` probably not needed at all): @@ -21,7 +21,7 @@ needed at all): .. code-block:: none :emphasize-lines: 1, 18 - [cgold-example]> cmake -H. -B_builds -G "Unix Makefiles" + [cgold-example]> cmake -S. -B_builds -G "Unix Makefiles" -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc diff --git a/docs/first-step/generate-native-tool/cli-visual-studio.rst b/docs/first-step/generate-native-tool/cli-visual-studio.rst index be6a95c..9c96be0 100644 --- a/docs/first-step/generate-native-tool/cli-visual-studio.rst +++ b/docs/first-step/generate-native-tool/cli-visual-studio.rst @@ -16,13 +16,13 @@ Run ``cmd.exe`` and go to the directory with sources: ... foo.cpp Generate Visual Studio solution using CMake. Use -:ref:`-H. <-H>` :ref:`-B_builds <-B>` for specifying paths +:ref:`-S. <-S>` :ref:`-B_builds <-B>` for specifying paths and ``-G "Visual Studio 14 2015 Win64"`` for the generator: .. code-block:: none :emphasize-lines: 1, 16 - [cgold-example]> cmake -H. -B_builds -G "Visual Studio 14 2015 Win64" + [cgold-example]> cmake -S. -B_builds -G "Visual Studio 14 2015 Win64" -- The C compiler identification is MSVC 19.0.23918.0 -- The CXX compiler identification is MSVC 19.0.23918.0 -- Check for working C compiler using: Visual Studio 14 2015 Win64 diff --git a/docs/first-step/generate-native-tool/cli-xcode.rst b/docs/first-step/generate-native-tool/cli-xcode.rst index e2d4877..5fddfd6 100644 --- a/docs/first-step/generate-native-tool/cli-xcode.rst +++ b/docs/first-step/generate-native-tool/cli-xcode.rst @@ -13,13 +13,13 @@ Open terminal and go to the directory with sources: CMakeLists.txt foo.cpp Generate Xcode project using CMake. Use -:ref:`-H. <-H>` :ref:`-B_builds <-B>` for specifying paths +:ref:`-S. <-S>` :ref:`-B_builds <-B>` for specifying paths and ``-GXcode`` for the generator: .. code-block:: none :emphasize-lines: 1, 18 - [cgold-example]> cmake -H. -B_builds -GXcode + [cgold-example]> cmake -S. -B_builds -GXcode -- The C compiler identification is AppleClang 7.3.0.7030031 -- The CXX compiler identification is AppleClang 7.3.0.7030031 -- Check for working C compiler: /.../Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang diff --git a/docs/glossary/-B.rst b/docs/glossary/-B.rst index fc0fcfc..73f2740 100644 --- a/docs/glossary/-B.rst +++ b/docs/glossary/-B.rst @@ -8,7 +8,7 @@ Add ``-B`` to set the path to directory where CMake will store generated files. There must be no spaces between ``-B`` and -````. Always must be used with :ref:`-H <-H>` option. +````. Always must be used with :ref:`-S <-S>` option. Path to this directory will be saved in `CMAKE_BINARY_DIR `__ @@ -18,7 +18,7 @@ variable. Starting with CMake 3.13, ``-B`` is an officially supported flag, can handle spaces correctly and can be used independently of the :ref:`-S <-S>` - or :ref:`-H <-H>` options. + or :ref:`-S <-S>` options. .. code-block:: none @@ -28,4 +28,4 @@ variable. * :ref:`Binary tree ` * :ref:`-S <-S>` - * :ref:`-H <-H>` + * :ref:`-S <-S>` diff --git a/docs/glossary/-H.rst b/docs/glossary/-H.rst index 3a43aa7..5bb1429 100644 --- a/docs/glossary/-H.rst +++ b/docs/glossary/-H.rst @@ -5,25 +5,25 @@ PowerShell -.. _-H: +.. _-S: --H +-S -- .. note:: Has been replaced in 3.13 with the official source directory flag of :ref:`-S <-S>`. -Add ``-H`` to set directory with ``CMakeLists.txt``. +Add ``-S`` to set directory with ``CMakeLists.txt``. This internal option is not documented but -`widely used by community `__. -There must be no spaces between ``-H`` and ```` +`widely used by community `__. +There must be no spaces between ``-S`` and ```` (otherwise option will be interpreted as synonym to ``--help``). Always must be used with :ref:`-B <-B>` option. Example: .. code-block:: none - cmake -H. -B_builds + cmake -S. -B_builds Use current directory as a source tree (i.e. start with ``./CMakeLists.txt``) and put generated files to the ``./_builds`` folder. @@ -34,12 +34,12 @@ variable. .. warning:: - PowerShell will modify arguments and put the space between ``-H`` and ``.``. + PowerShell will modify arguments and put the space between ``-S`` and ``.``. You can protect argument by quoting it: .. code-block:: none - cmake '-H.' -B_builds + cmake '-S.' -B_builds .. seealso:: @@ -49,4 +49,4 @@ variable. .. admonition:: CMake mailing list - * `Document -H/-B `__ + * `Document -S/-B `__ diff --git a/docs/glossary/-S.rst b/docs/glossary/-S.rst index 0d59ce4..a2000e6 100644 --- a/docs/glossary/-S.rst +++ b/docs/glossary/-S.rst @@ -11,7 +11,7 @@ -- Add ``-S `` to set directory with ``CMakeLists.txt``. -This option was added in CMake 3.13 and replaces the the undocumented and internal variable ``-H``. This option can be used independently of ``-B``. +This option was added in CMake 3.13 and replaces the the undocumented and internal variable ``-S``. This option can be used independently of ``-B``. .. code-block:: none diff --git a/docs/glossary/multi-config.rst b/docs/glossary/multi-config.rst index 58743d0..f790c5b 100644 --- a/docs/glossary/multi-config.rst +++ b/docs/glossary/multi-config.rst @@ -19,7 +19,7 @@ variant: .. code-block:: none - > cmake -H. -B_builds -DCMAKE_CONFIGURATION_TYPES=Release;Debug -GXcode + > cmake -S. -B_builds -DCMAKE_CONFIGURATION_TYPES=Release;Debug -GXcode > cmake --build _builds --config Debug It is legal to use same ``_builds`` directory to build ``Release`` variant diff --git a/docs/glossary/single-config.rst b/docs/glossary/single-config.rst index 0de3be0..4b784f1 100644 --- a/docs/glossary/single-config.rst +++ b/docs/glossary/single-config.rst @@ -13,7 +13,7 @@ Example of building ``Debug`` variant: .. code-block:: none - > cmake -H. -B_builds -DCMAKE_BUILD_TYPE=Debug + > cmake -S. -B_builds -DCMAKE_BUILD_TYPE=Debug > cmake --build _builds To use another build type like ``Release`` use diff --git a/docs/glossary/source-tree.rst b/docs/glossary/source-tree.rst index 46a7c76..ae5e5b8 100644 --- a/docs/glossary/source-tree.rst +++ b/docs/glossary/source-tree.rst @@ -8,7 +8,7 @@ Source tree Hierarchy of directories with source files such as CMake/C++ sources. :ref:`CMake ` starts with the :ref:`CMakeLists.txt ` -from top of the source tree. This directory can be set by :ref:`-H <-H>` +from top of the source tree. This directory can be set by :ref:`-S <-S>` in command line or by ``Browse Source...`` in CMake-GUI. This directory is mean to be shareable. E.g. probably you should not store @@ -17,7 +17,7 @@ directory that you want to be managed with :ref:`VCS `. .. seealso:: - * :ref:`-H <-H>` + * :ref:`-S <-S>` * :ref:`Binary tree ` * :doc:`GUI + Visual Studio ` * :doc:`GUI + Xcode ` diff --git a/docs/overview/cmake-can-not.rst b/docs/overview/cmake-can-not.rst index c900a8b..23f5723 100644 --- a/docs/overview/cmake-can-not.rst +++ b/docs/overview/cmake-can-not.rst @@ -126,7 +126,7 @@ In other words, you can't be "the CMake person" who will generate separate proje those who use Xcode and those who use Visual Studio. All developers in the team should be aware of how to generate projects using CMake. In practice it means they have to know which CMake arguments to use, some basic examples being -``cmake -H. -B_builds -GXcode`` and ``cmake -H. -B_builds "-GVisual Studio 12 2013"`` +``cmake -S. -B_builds -GXcode`` and ``cmake -S. -B_builds "-GVisual Studio 12 2013"`` for Xcode and Visual Studio, respectively. Additionally, they must understand the :ref:`changes they must make in their workflow `. As a general rule, developers should make an effort to learn the tools used in making the code they wish to utilize. Only when providing an end product to users is it diff --git a/docs/overview/yed/cmake-environment.graphml b/docs/overview/yed/cmake-environment.graphml index 169f825..558ace8 100755 --- a/docs/overview/yed/cmake-environment.graphml +++ b/docs/overview/yed/cmake-environment.graphml @@ -203,7 +203,7 @@ from CMake code: cmake \ - -H. \ + -S. \ -B_builds diff --git a/docs/platforms/android/windows.rst b/docs/platforms/android/windows.rst index 664aa5d..059017c 100644 --- a/docs/platforms/android/windows.rst +++ b/docs/platforms/android/windows.rst @@ -72,7 +72,7 @@ Generate: .. code-block:: none :emphasize-lines: 1, 5, 11 - [platforms-android-on-windows]> cmake -H. -B_builds "-GVisual Studio 14 2015 ARM" + [platforms-android-on-windows]> cmake -S. -B_builds "-GVisual Studio 14 2015 ARM" -- The C compiler identification is Clang 3.6.0 -- The CXX compiler identification is Clang 3.6.0 -- Check for working C compiler using: Visual Studio 14 2015 ARM @@ -140,7 +140,7 @@ If you see error like that: .. code-block:: none - [platforms-android-on-windows]> cmake -H. -B_builds "-GVisual Studio 14 2015 ARM" + [platforms-android-on-windows]> cmake -S. -B_builds "-GVisual Studio 14 2015 ARM" CMake Error at CMakeLists.txt:7 (message): File not found: @@ -159,7 +159,7 @@ you will see this error: .. code-block:: none - [platforms-android-on-windows]> cmake -H. -B_builds "-GVisual Studio 14 2015 ARM" + [platforms-android-on-windows]> cmake -S. -B_builds "-GVisual Studio 14 2015 ARM" CMake Error at CMakeLists.txt:17 (project): CMAKE_SYSTEM_NAME is 'VCMDDAndroid' but 'Visual C++ for Mobile Development (Android support)' is not installed. @@ -173,7 +173,7 @@ if you see this error: .. code-block:: none - [platforms-android-on-windows]> cmake -H. -B_builds "-GVisual Studio 14 2015 ARM" + [platforms-android-on-windows]> cmake -S. -B_builds "-GVisual Studio 14 2015 ARM" -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:17 (project): diff --git a/docs/templates.txt b/docs/templates.txt index f0485f1..4b7c2c0 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -45,7 +45,7 @@ Templates :emphasize-lines: 2, 4-5, 9, 15, 21-22 [project-examples]> rm -rf _builds - [project-examples]> cmake -Hset-compiler -B_builds + [project-examples]> cmake -Sset-compiler -B_builds .. image:: gnu.png :align: center diff --git a/docs/tutorials/cmake-sources/common.rst b/docs/tutorials/cmake-sources/common.rst index 752cdb4..7852387 100644 --- a/docs/tutorials/cmake-sources/common.rst +++ b/docs/tutorials/cmake-sources/common.rst @@ -36,7 +36,7 @@ Information about any kind of listfile can be taken from :emphasize-lines: 3-4 [cmake-sources]> rm -rf _builds - [cmake-sources]> cmake -Hpath-to-module -B_builds + [cmake-sources]> cmake -Spath-to-module -B_builds Full path to module: /.../cmake-sources/path-to-module/cmake/mymodule.cmake Module located in directory: /.../cmake-sources/path-to-module/cmake -- Configuring done @@ -114,7 +114,7 @@ Subdirectory ``boo`` uses this module: .. code-block:: none [cmake-sources]> rm -rf _builds - [cmake-sources]> cmake -Hwith-external-module/example -B_builds -DCMAKE_MODULE_PATH=`pwd`/with-external-module/external + [cmake-sources]> cmake -Swith-external-module/example -B_builds -DCMAKE_MODULE_PATH=`pwd`/with-external-module/external Top level CMakeLists.txt Processing foo/CMakeList.txt Processing boo/CMakeList.txt diff --git a/docs/tutorials/cmake-sources/includes.rst b/docs/tutorials/cmake-sources/includes.rst index 28721c9..a3b6df5 100644 --- a/docs/tutorials/cmake-sources/includes.rst +++ b/docs/tutorials/cmake-sources/includes.rst @@ -22,7 +22,7 @@ CMake comes with a set of :emphasize-lines: 2, 3 [cmake-sources]> rm -rf _builds - [cmake-sources]> cmake -Hinclude-processor-count -B_builds + [cmake-sources]> cmake -Sinclude-processor-count -B_builds Number of processors: 4 -- Configuring done -- Generating done @@ -56,7 +56,7 @@ custom CMake modules: :emphasize-lines: 3 [cmake-sources]> rm -rf _builds - [cmake-sources]> cmake -Hinclude-users -B_builds + [cmake-sources]> cmake -Sinclude-users -B_builds Hello from MyModule! -- Configuring done -- Generating done @@ -119,7 +119,7 @@ Works fine: :emphasize-lines: 3-4 [cmake-sources]> rm -rf _builds - [cmake-sources]> cmake -Hmodify-path -B_builds "-DCMAKE_MODULE_PATH=`pwd`/modify-path/standard" + [cmake-sources]> cmake -Smodify-path -B_builds "-DCMAKE_MODULE_PATH=`pwd`/modify-path/standard" Force processor count Number of processors: 16 -- Configuring done @@ -147,7 +147,7 @@ They will **not** be loaded: :emphasize-lines: 3 [cmake-sources]> rm -rf _builds - [cmake-sources]> cmake -Hmodify-incorrect -B_builds "-DCMAKE_MODULE_PATH=`pwd`/modify-incorrect/standard" + [cmake-sources]> cmake -Smodify-incorrect -B_builds "-DCMAKE_MODULE_PATH=`pwd`/modify-incorrect/standard" Number of processors: 4 -- Configuring done -- Generating done diff --git a/docs/tutorials/cmake-sources/subdirectories.rst b/docs/tutorials/cmake-sources/subdirectories.rst index c9f294a..e771c08 100644 --- a/docs/tutorials/cmake-sources/subdirectories.rst +++ b/docs/tutorials/cmake-sources/subdirectories.rst @@ -34,7 +34,7 @@ creates a node in a source tree: :emphasize-lines: 3-7 [cmake-sources]> rm -rf _builds - [cmake-sources]> cmake -Hsimple-tree -B_builds + [cmake-sources]> cmake -Ssimple-tree -B_builds Top level CMakeLists.txt Processing foo/CMakeList.txt Processing boo/CMakeList.txt @@ -52,7 +52,7 @@ Source variables ``CMAKE_CURRENT_SOURCE_DIR`` variable will hold a full path to a currently processed node. Root of the tree is always available in -``CMAKE_SOURCE_DIR`` (see :ref:`-H <-H>`): +``CMAKE_SOURCE_DIR`` (see :ref:`-S <-S>`): .. literalinclude:: /examples/cmake-sources/simple-tree-source-vars/CMakeLists.txt :language: cmake @@ -78,7 +78,7 @@ processed node. Root of the tree is always available in :emphasize-lines: 4-5, 7-8, 10-11, 13-14, 16-17 [cmake-sources]> rm -rf _builds - [cmake-sources]> cmake -Hsimple-tree-source-vars -B_builds + [cmake-sources]> cmake -Ssimple-tree-source-vars -B_builds Top level CMakeLists.txt CMAKE_SOURCE_DIR: /.../cmake-sources/simple-tree-source-vars CMAKE_CURRENT_SOURCE_DIR: /.../cmake-sources/simple-tree-source-vars @@ -134,7 +134,7 @@ Information can be taken from ``CMAKE_BINARY_DIR`` (see :ref:`-B <-B>`) and :emphasize-lines: 4-5, 7-8, 10-11, 13-14, 16-17 [cmake-sources]> rm -rf _builds - [cmake-sources]> cmake -Hsimple-tree-binary-vars -B_builds + [cmake-sources]> cmake -Ssimple-tree-binary-vars -B_builds Top level CMakeLists.txt CMAKE_BINARY_DIR: /.../cmake-sources/_builds CMAKE_CURRENT_BINARY_DIR: /.../cmake-sources/_builds diff --git a/docs/tutorials/cmake-stages.rst b/docs/tutorials/cmake-stages.rst index 3bd317e..3df6c7a 100644 --- a/docs/tutorials/cmake-stages.rst +++ b/docs/tutorials/cmake-stages.rst @@ -107,7 +107,7 @@ Example of generating Makefile on Linux: :emphasize-lines: 2, 17 [minimal-with-message-master]> rm -rf _builds - [minimal-with-message-master]> cmake -H. -B_builds + [minimal-with-message-master]> cmake -S. -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc @@ -144,7 +144,7 @@ If you run configure again CMakeLists.txt will be parsed one more time and .. code-block:: none :emphasize-lines: 2 - [minimal-with-message-master]> cmake -H. -B_builds + [minimal-with-message-master]> cmake -S. -B_builds Processing CMakeLists.txt -- Configuring done -- Generating done diff --git a/docs/tutorials/control-structures.rst b/docs/tutorials/control-structures.rst index 6c08b1c..bd752b1 100644 --- a/docs/tutorials/control-structures.rst +++ b/docs/tutorials/control-structures.rst @@ -30,7 +30,7 @@ with ``NO``/``YES`` values: :emphasize-lines: 2-4 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hif-simple -B_builds + [control-structures]> cmake -Sif-simple -B_builds Condition 1 Condition 3 -- Configuring done @@ -47,7 +47,7 @@ Adding ``else``/``elseif``: :emphasize-lines: 2-6 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hif-else -B_builds + [control-structures]> cmake -Sif-else -B_builds Condition 1 Condition 4 Condition 6 @@ -104,7 +104,7 @@ present in current scope or not? :emphasize-lines: 2-4 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hcmp0054-confuse -B_builds + [control-structures]> cmake -Scmp0054-confuse -B_builds A = Jane Doe A is empty -- Configuring done @@ -125,7 +125,7 @@ Since CMake accepts any names of the variables you can't filter out :emphasize-lines: 2-6 [control-structures]> rm -rf _builds - [control-structures]> cmake -Htry-fix -B_builds + [control-structures]> cmake -Stry-fix -B_builds A = Jane Doe A is empty (1) A is empty (2) @@ -147,7 +147,7 @@ To avoid such issues you should use CMake 3.1 and a ``CMP0054`` policy: :emphasize-lines: 2-3 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hcmp0054-fix -B_builds + [control-structures]> cmake -Scmp0054-fix -B_builds A = Jane Doe -- Configuring done -- Generating done @@ -167,7 +167,7 @@ command: :emphasize-lines: 2-4 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hcmp0054-workaround -B_builds + [control-structures]> cmake -Scmp0054-workaround -B_builds A = Jane Doe A is not empty -- Configuring done @@ -194,7 +194,7 @@ Example of a ``foreach( )`` command: :emphasize-lines: 2, 4-6, 8-10, 11, 12, 14, 16-17, 19-24 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hforeach -B_builds + [control-structures]> cmake -Sforeach -B_builds Explicit list: A B @@ -240,7 +240,7 @@ Example of usage of a ``foreach(... RANGE ...)`` command: :emphasize-lines: 2, 4-14, 16-21, 23-25 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hforeach-range -B_builds + [control-structures]> cmake -Sforeach-range -B_builds Simple range: 0 1 @@ -281,7 +281,7 @@ Example of usage of a ``while`` command: :emphasize-lines: 2, 4-8, 10-14 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hwhile -B_builds + [control-structures]> cmake -Swhile -B_builds Loop with condition as variable: a = x a = xx @@ -315,7 +315,7 @@ Exit from a loop with a ``break`` command: :emphasize-lines: 2, 4-6, 8-12 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hbreak -B_builds + [control-structures]> cmake -Sbreak -B_builds Stop 'while' loop: x xx @@ -343,7 +343,7 @@ Since CMake 3.2 it's possible to continue the loop: :emphasize-lines: 2, 6, 9 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hcontinue -B_builds + [control-structures]> cmake -Scontinue -B_builds Loop with 'continue': process 0 process 1 @@ -386,7 +386,7 @@ Function without arguments: :emphasize-lines: 3-4 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hsimple-function -B_builds + [control-structures]> cmake -Ssimple-function -B_builds Calling 'foo' function Calling 'foo' function -- Configuring done @@ -406,7 +406,7 @@ Function with arguments and example of ``ARGV*``, ``ARGC``, ``ARGN`` usage: :emphasize-lines: 4-6, 8-11, 13-14 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hfunction-args -B_builds + [control-structures]> cmake -Sfunction-args -B_builds Calling function 'foo': x = 1 y = 2 @@ -440,7 +440,7 @@ CMake style :emphasize-lines: 4-13, 15-23, 30-33, 36 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hcmake-style -B_builds + [control-structures]> cmake -Scmake-style -B_builds *** Run (1) *** FOO: TRUE BOO: FALSE @@ -495,7 +495,7 @@ results: :emphasize-lines: 2, 4-5, 7-8, 10-11 [examples]> rm -rf _builds - [examples]> cmake -Hcontrol-structures/cmake-style-limitations -B_builds + [examples]> cmake -Scontrol-structures/cmake-style-limitations -B_builds *** Run (1) *** X is defined: NO X value: '' @@ -523,7 +523,7 @@ a variable to the :ref:`parent scope ` instead: :emphasize-lines: 3-4, 6 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hreturn-value -B_builds + [control-structures]> cmake -Sreturn-value -B_builds Before 'boo': 333 After 'boo': 123 Calling 'bar' with arguments: '123' 'var_out' @@ -549,7 +549,7 @@ You can exit from a function using a ``return`` command: :emphasize-lines: 3-5 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hreturn -B_builds + [control-structures]> cmake -Sreturn -B_builds Exit on A Exit on B Exit @@ -582,7 +582,7 @@ the function **is defined**: :emphasize-lines: 2, 4-6, 8-10 [control-structures]> rm -rf _builds - [control-structures]> cmake -Hfunction-location -B_builds + [control-structures]> cmake -Sfunction-location -B_builds foo_run(123) Called from: /.../control-structures/function-location Defined in file: /.../control-structures/function-location/cmake/Modules/foo_run.cmake diff --git a/docs/tutorials/executables.rst b/docs/tutorials/executables.rst index f3d3588..299c050 100644 --- a/docs/tutorials/executables.rst +++ b/docs/tutorials/executables.rst @@ -26,7 +26,7 @@ Building executable from ``main.cpp``: :emphasize-lines: 2, 20 [executable-examples]> rm -rf _builds - [executable-examples]> cmake -Hsimple -B_builds + [executable-examples]> cmake -Ssimple -B_builds -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc @@ -80,7 +80,7 @@ if they are declared in different ``CMakeLists.txt``: :emphasize-lines: 2, 17-22 [examples]> rm -rf _builds - [examples]> cmake -Hexecutable-examples/duplicates -B_builds + [examples]> cmake -Sexecutable-examples/duplicates -B_builds -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc diff --git a/docs/tutorials/install/install-prefix.rst b/docs/tutorials/install/install-prefix.rst index 11fda5e..7a71f5a 100644 --- a/docs/tutorials/install/install-prefix.rst +++ b/docs/tutorials/install/install-prefix.rst @@ -18,7 +18,7 @@ of install procedure: :emphasize-lines: 2, 10, 12, 17 [install-examples]> rm -rf _builds - [install-examples]> cmake -Hsimple -B_builds -DCMAKE_INSTALL_PREFIX=_install/config-A + [install-examples]> cmake -Ssimple -B_builds -DCMAKE_INSTALL_PREFIX=_install/config-A [install-examples]> cmake --build _builds --target install Scanning dependencies of target foo [ 50%] Building CXX object CMakeFiles/foo.dir/foo.cpp.o @@ -28,7 +28,7 @@ of install procedure: -- Install configuration: "" -- Installing: /.../install-examples/_install/config-A/lib/libfoo.a - [install-examples]> cmake -Hsimple -B_builds -DCMAKE_INSTALL_PREFIX=_install/config-B + [install-examples]> cmake -Ssimple -B_builds -DCMAKE_INSTALL_PREFIX=_install/config-B [install-examples]> cmake --build _builds --target install [100%] Built target foo Install the project... @@ -49,7 +49,7 @@ code! :emphasize-lines: 2 [install-examples]> rm -rf _builds - [install-examples]> cmake -Hmodify-bad -B_builds -DCMAKE_INSTALL_PREFIX="`pwd`/_install" + [install-examples]> cmake -Smodify-bad -B_builds -DCMAKE_INSTALL_PREFIX="`pwd`/_install" -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc @@ -95,7 +95,7 @@ On the fly :emphasize-lines: 3, 7, 10, 14 [install-examples]> rm -rf _builds - [install-examples]> cmake -Hsimple -B_builds -DCMAKE_INSTALL_PREFIX="" + [install-examples]> cmake -Ssimple -B_builds -DCMAKE_INSTALL_PREFIX="" [install-examples]> make -C _builds DESTDIR="`pwd`/_install/config-A" install ... Install the project... @@ -129,7 +129,7 @@ problems with permissions on configure step instead of a silent copy: :emphasize-lines: 2, 17-20 [install-examples]> rm -rf _builds - [install-examples]> cmake -Hwrong-usage -B_builds + [install-examples]> cmake -Swrong-usage -B_builds -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc @@ -159,7 +159,7 @@ in archive: :emphasize-lines: 3, 11, 12 [install-examples]> rm -rf _builds _install - [install-examples]> cmake -Hwrong-usage -B_builds -DCMAKE_INSTALL_PREFIX="`pwd`/_install" + [install-examples]> cmake -Swrong-usage -B_builds -DCMAKE_INSTALL_PREFIX="`pwd`/_install" [install-examples]> (cd _builds && cpack -G TGZ) CPack: Create package using TGZ CPack: Install projects @@ -185,7 +185,7 @@ All work should be delegated to ``install`` command instead, in such case :emphasize-lines: 2 [install-examples]> rm -rf _builds _install - [install-examples]> cmake -Hright-usage -B_builds -DCMAKE_INSTALL_PREFIX="`pwd`/_install" + [install-examples]> cmake -Sright-usage -B_builds -DCMAKE_INSTALL_PREFIX="`pwd`/_install" -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc @@ -256,7 +256,7 @@ Configure for ``DESTDIR`` usage: :emphasize-lines: 2 [install-examples]> rm -rf _builds _install foo-0.1.1-Linux - [install-examples]> cmake -Hconfigure -B_builds -DCMAKE_INSTALL_PREFIX="" + [install-examples]> cmake -Sconfigure -B_builds -DCMAKE_INSTALL_PREFIX="" -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc @@ -311,7 +311,7 @@ Regular install: :emphasize-lines: 2, 20, 23-26 [install-examples]> rm -rf _builds _install - [install-examples]> cmake -Hconfigure -B_builds -DCMAKE_INSTALL_PREFIX="`pwd`/_install" + [install-examples]> cmake -Sconfigure -B_builds -DCMAKE_INSTALL_PREFIX="`pwd`/_install" -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc diff --git a/docs/tutorials/install/managing-dependencies/bad.rst b/docs/tutorials/install/managing-dependencies/bad.rst index f919e64..5152717 100644 --- a/docs/tutorials/install/managing-dependencies/bad.rst +++ b/docs/tutorials/install/managing-dependencies/bad.rst @@ -123,7 +123,7 @@ At first you will simply get :ref:`target names conflict `: :emphasize-lines: 2, 18-20 [examples]> rm -rf _builds - [examples]> cmake -Hdep-examples/deps-submodule-conflict -B_builds + [examples]> cmake -Sdep-examples/deps-submodule-conflict -B_builds -- The C compiler identification is GNU 5.4.1 -- The CXX compiler identification is GNU 5.4.1 -- Check for working C compiler: /usr/bin/cc @@ -187,7 +187,7 @@ functionality is leaking into module ``b``: :emphasize-lines: 2, 12-13 [examples]> rm -rf _builds - [examples]> cmake -Hdep-examples/deps-submodule-option -B_builds -DFOO_WITH_A=ON + [examples]> cmake -Sdep-examples/deps-submodule-option -B_builds -DFOO_WITH_A=ON ... [examples]> cmake --build _builds ... @@ -207,7 +207,7 @@ Disable module ``a`` and behavior of ``b`` changed! :emphasize-lines: 2, 12-13 [examples]> rm -rf _builds - [examples]> cmake -Hdep-examples/deps-submodule-option -B_builds -DFOO_WITH_A=OFF + [examples]> cmake -Sdep-examples/deps-submodule-option -B_builds -DFOO_WITH_A=OFF ... [examples]> cmake --build _builds ... @@ -247,7 +247,7 @@ Since version of ``x`` tied to project structure every time you switch option :emphasize-lines: 2 [examples]> rm -rf _builds - [examples]> cmake -Hdep-examples/deps-submodule-option -B_builds -DFOO_WITH_A=ON + [examples]> cmake -Sdep-examples/deps-submodule-option -B_builds -DFOO_WITH_A=ON Build everything from scratch first time: @@ -287,7 +287,7 @@ Disable component ``a``: .. code-block:: none - [examples]> cmake -Hdep-examples/deps-submodule-option -B_builds -DFOO_WITH_A=OFF + [examples]> cmake -Sdep-examples/deps-submodule-option -B_builds -DFOO_WITH_A=OFF Whole project rebuild! diff --git a/docs/tutorials/install/managing-dependencies/good.rst b/docs/tutorials/install/managing-dependencies/good.rst index 6b3ae29..0c8a3df 100644 --- a/docs/tutorials/install/managing-dependencies/good.rst +++ b/docs/tutorials/install/managing-dependencies/good.rst @@ -19,7 +19,7 @@ them to your system and then integrate into CMake using :emphasize-lines: 2 [examples]> rm -rf _builds - [examples]> cmake -Hdep-examples/deps-find-package -B_builds -DFOO_WITH_A=ON + [examples]> cmake -Sdep-examples/deps-find-package -B_builds -DFOO_WITH_A=ON [examples]> cmake --build _builds Result of running test with module ``a`` enabled: @@ -41,7 +41,7 @@ With module ``a`` disabled: .. code-block:: none - [examples]> cmake -Hdep-examples/deps-find-package -B_builds -DFOO_WITH_A=OFF + [examples]> cmake -Sdep-examples/deps-find-package -B_builds -DFOO_WITH_A=OFF Third parties remains the same of course, only ``foo`` executable rebuild: @@ -103,7 +103,7 @@ Using such project you can install all dependencies to some custom root :emphasize-lines: 2, 8, 12-16, 21, 25-29, 34, 38-42 [examples]> rm -rf _ep_build - [examples]> cmake -Hdep-examples/deps-super-build -B_ep_build -DCMAKE_INSTALL_PREFIX=_ep_install + [examples]> cmake -Sdep-examples/deps-super-build -B_ep_build -DCMAKE_INSTALL_PREFIX=_ep_install [examples]> cmake --build _ep_build ... -- Downloading... @@ -152,7 +152,7 @@ root directory **with your custom dependencies** instead of system dependencies: :emphasize-lines: 2, 5-7 [examples]> rm -rf _builds - [examples]> cmake -Hdep-examples/deps-find-package -B_builds -DCMAKE_PREFIX_PATH=/.../examples/_ep_install -DCMAKE_VERBOSE_MAKEFILE=ON + [examples]> cmake -Sdep-examples/deps-find-package -B_builds -DCMAKE_PREFIX_PATH=/.../examples/_ep_install -DCMAKE_VERBOSE_MAKEFILE=ON [examples]> cmake --build _builds /usr/bin/c++ ... -o foo /.../_ep_install/lib/liba.a diff --git a/docs/tutorials/libraries/static-shared.rst b/docs/tutorials/libraries/static-shared.rst index 94163ca..28887b5 100644 --- a/docs/tutorials/libraries/static-shared.rst +++ b/docs/tutorials/libraries/static-shared.rst @@ -40,7 +40,7 @@ will be **two builds** and **two root directories**. > cd library-examples [library-examples]> rm -rf _builds _install - [library-examples]> cmake -Hright-way -B_builds/shared -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="`pwd`/_install/configuration-A" + [library-examples]> cmake -Sright-way -B_builds/shared -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="`pwd`/_install/configuration-A" [library-examples]> cmake --build _builds/shared --target install Scanning dependencies of target foo [ 50%] Building CXX object CMakeFiles/foo.dir/foo.cpp.o @@ -50,7 +50,7 @@ will be **two builds** and **two root directories**. -- Install configuration: "" -- Installing: /.../library-examples/_install/configuration-A/lib/libfoo.so - [library-examples]> cmake -Hright-way -B_builds/static -DCMAKE_INSTALL_PREFIX="`pwd`/_install/configuration-B" + [library-examples]> cmake -Sright-way -B_builds/static -DCMAKE_INSTALL_PREFIX="`pwd`/_install/configuration-B" [library-examples]> cmake --build _builds/static --target install Scanning dependencies of target foo [ 50%] Building CXX object CMakeFiles/foo.dir/foo.cpp.o @@ -94,7 +94,7 @@ produce ``foo.lib``: > cd library-examples [library-examples]> rmdir _builds _install /S /Q - [library-examples]> cmake -Hright-way -B_builds\static -G "Visual Studio 14 2015" -DCMAKE_INSTALL_PREFIX=%cd%\_install + [library-examples]> cmake -Sright-way -B_builds\static -G "Visual Studio 14 2015" -DCMAKE_INSTALL_PREFIX=%cd%\_install [library-examples]> cmake --build _builds\static --config Release --target install ... -- Install configuration: "Release" @@ -106,7 +106,7 @@ But shared build will produce **both** ``foo.lib`` and ``foo.dll``, effectively .. code-block:: bat :emphasize-lines: 5-6 - [library-examples]> cmake -Hright-way -B_builds\shared -G "Visual Studio 14 2015" -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=%cd%\_install + [library-examples]> cmake -Sright-way -B_builds\shared -G "Visual Studio 14 2015" -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=%cd%\_install [library-examples]> cmake --build _builds\shared --config Release --target install ... -- Install configuration: "Release" @@ -123,7 +123,7 @@ Even if libraries doesn't conflict on file level their **configs** will conflict > cd library-examples [library-examples]> rm -rf _install _builds - [library-examples]> cmake -Hbar -B_builds/shared -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="`pwd`/_install" + [library-examples]> cmake -Sbar -B_builds/shared -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="`pwd`/_install" [library-examples]> cmake --build _builds/shared --target install [library-examples]> grep lib/libbar.so -IR _install _install/lib/cmake/bar/barTargets-release.cmake: IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libbar.so" @@ -134,7 +134,7 @@ Config for static variant will have the same ``barTargets-release.cmake`` name: .. code-block:: none :emphasize-lines: 3-5 - [library-examples]> cmake -Hbar -B_builds/static -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="`pwd`/_install" + [library-examples]> cmake -Sbar -B_builds/static -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="`pwd`/_install" [library-examples]> cmake --build _builds/static --target install [library-examples]> grep lib/libbar.a -IR _install _install/lib/cmake/bar/barTargets-release.cmake: IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libbar.a" @@ -202,7 +202,7 @@ By default we will build executable and static library: > cd library-examples [library-examples]> rm -rf _builds - [library-examples]> cmake -Hcustom -B_builds + [library-examples]> cmake -Scustom -B_builds [library-examples]> cmake --build _builds [library-examples]> ls _builds/libfoo.a _builds/boo _builds/libfoo.a @@ -213,7 +213,7 @@ But we are free to switch to shared library: .. code-block:: none [library-examples]> rm -rf _builds - [library-examples]> cmake -Hcustom -B_builds -DBUILD_SHARED_LIBS=ON + [library-examples]> cmake -Scustom -B_builds -DBUILD_SHARED_LIBS=ON [library-examples]> cmake --build _builds [library-examples]> ls _builds/libfoo.dylib _builds/boo _builds/libfoo.dylib @@ -224,7 +224,7 @@ Create bundle: .. code-block:: none [library-examples]> rm -rf _builds - [library-examples]> cmake -Hcustom -B_builds -DCMAKE_MACOSX_BUNDLE=ON + [library-examples]> cmake -Scustom -B_builds -DCMAKE_MACOSX_BUNDLE=ON [library-examples]> cmake --build _builds [library-examples]> ls -d _builds/libfoo.a _builds/boo.app _builds/libfoo.a @@ -235,7 +235,7 @@ Or do the both: .. code-block:: none [library-examples]> rm -rf _builds - [library-examples]> cmake -Hcustom -B_builds -DCMAKE_MACOSX_BUNDLE=ON -DBUILD_SHARED_LIBS=ON + [library-examples]> cmake -Scustom -B_builds -DCMAKE_MACOSX_BUNDLE=ON -DBUILD_SHARED_LIBS=ON [library-examples]> cmake --build _builds [library-examples]> ls -d _builds/libfoo.dylib _builds/boo.app _builds/libfoo.dylib @@ -265,7 +265,7 @@ executable: > cd library-examples [library-examples]> rm -rf _builds - [library-examples]> cmake -Hsurprise -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON + [library-examples]> cmake -Ssurprise -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON [library-examples]> cmake --build _builds ... /usr/bin/c++ -o foo ... boo/libboo.a @@ -276,7 +276,7 @@ library, so he expects shared in next configuration: .. code-block:: none [library-examples]> rm -rf _builds - [library-examples]> cmake -Hsurprise -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=ON + [library-examples]> cmake -Ssurprise -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=ON But of course he still got static because type of library is forced: @@ -296,7 +296,7 @@ planning to use one of the variants: :emphasize-lines: 5, 13 [library-examples]> rm -rf _builds - [library-examples]> cmake -Hsurprise -B_builds + [library-examples]> cmake -Ssurprise -B_builds [library-examples]> cmake --build _builds Scanning dependencies of target boo [ 16%] Building CXX object boo/CMakeFiles/boo.dir/boo.cpp.o @@ -331,11 +331,11 @@ in fact **we don't really interested in**: > cd library-examples [library-examples]> rm -rf _builds _install - [library-examples]> cmake -Hbar -B_builds -DCMAKE_INSTALL_PREFIX="`pwd`/_install" + [library-examples]> cmake -Sbar -B_builds -DCMAKE_INSTALL_PREFIX="`pwd`/_install" [library-examples]> cmake --build _builds --target install [library-examples]> rm -rf _builds - [library-examples]> cmake -Huse_bar -B_builds -DCMAKE_PREFIX_PATH="`pwd`/_install" + [library-examples]> cmake -Suse_bar -B_builds -DCMAKE_PREFIX_PATH="`pwd`/_install" [library-examples]> cmake --build _builds Scanning dependencies of target use_bar_shared [ 25%] Building CXX object CMakeFiles/use_bar_shared.dir/use_bar.cpp.o @@ -435,7 +435,7 @@ Let's build it: .. code-block:: none [library-examples]> rm -rf _builds - [library-examples]> cmake -Hdup -B_builds + [library-examples]> cmake -Sdup -B_builds [library-examples]> cmake --build _builds We are linked to the ``libbaz.so`` and we **do linked** to ``libbar_shared.so`` diff --git a/docs/tutorials/libraries/symbols/link-order.rst b/docs/tutorials/libraries/symbols/link-order.rst index 87a2f35..47dd936 100644 --- a/docs/tutorials/libraries/symbols/link-order.rst +++ b/docs/tutorials/libraries/symbols/link-order.rst @@ -79,7 +79,7 @@ Build will fail with linker error: :emphasize-lines: 2, 20, 40, 42-45 [examples]> rm -rf _builds - [examples]> cmake -Hlibrary-examples/link-order-bad -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON + [examples]> cmake -Slibrary-examples/link-order-bad -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON -- The C compiler identification is GNU 5.4.1 -- The CXX compiler identification is GNU 5.4.1 -- Check for working C compiler: /usr/bin/cc @@ -174,7 +174,7 @@ control the right order of files: :emphasize-lines: 2, 20, 22 [examples]> rm -rf _builds - [examples]> cmake -Hlibrary-examples/link-order-fix -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON + [examples]> cmake -Slibrary-examples/link-order-fix -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON -- The C compiler identification is GNU 5.4.1 -- The CXX compiler identification is GNU 5.4.1 -- Check for working C compiler: /usr/bin/cc diff --git a/docs/tutorials/libraries/symbols/odr-global.rst b/docs/tutorials/libraries/symbols/odr-global.rst index 61df28e..35ccdd5 100644 --- a/docs/tutorials/libraries/symbols/odr-global.rst +++ b/docs/tutorials/libraries/symbols/odr-global.rst @@ -63,7 +63,7 @@ both targets: :emphasize-lines: 8 [examples]> rm -rf _builds - [examples]> cmake -Hlibrary-examples/link-error-odr-global -B_builds + [examples]> cmake -Slibrary-examples/link-error-odr-global -B_builds ... [examples]> cmake --build _builds ... @@ -98,7 +98,7 @@ Building C++11 variant: :emphasize-lines: 2, 7 [examples]> rm -rf _builds - [examples]> cmake -Hlibrary-examples/link-error-odr-global-fix -B_builds -DCMAKE_CXX_STANDARD=11 + [examples]> cmake -Slibrary-examples/link-error-odr-global-fix -B_builds -DCMAKE_CXX_STANDARD=11 ... [examples]> cmake --build _builds ... @@ -111,7 +111,7 @@ Building C++98 variant: :emphasize-lines: 2, 7 [examples]> rm -rf _builds - [examples]> cmake -Hlibrary-examples/link-error-odr-global-fix -B_builds -DCMAKE_CXX_STANDARD=98 + [examples]> cmake -Slibrary-examples/link-error-odr-global-fix -B_builds -DCMAKE_CXX_STANDARD=98 ... [examples]> cmake --build _builds ... diff --git a/docs/tutorials/libraries/symbols/odr-local.rst b/docs/tutorials/libraries/symbols/odr-local.rst index e5cd29f..dea0806 100644 --- a/docs/tutorials/libraries/symbols/odr-local.rst +++ b/docs/tutorials/libraries/symbols/odr-local.rst @@ -56,7 +56,7 @@ Let's build the project now: :emphasize-lines: 2, 4-5 [library-examples]> rm -rf _builds - [library-examples]> cmake -Hlink-error-odr-local -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON + [library-examples]> cmake -Slink-error-odr-local -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON ... [library-examples]> cmake --build _builds @@ -112,7 +112,7 @@ Links fine now: :emphasize-lines: 5, 7, 9, 15, 18 [library-examples]> rm -rf _builds - [library-examples]> cmake -Hlink-error-odr-local-fix -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON + [library-examples]> cmake -Slink-error-odr-local-fix -B_builds -DCMAKE_VERBOSE_MAKEFILE=ON ... [library-examples]> cmake --build _builds /usr/bin/c++ -DBOO_USE_SHORT_INT /.../Boo.cpp diff --git a/docs/tutorials/libraries/symbols/simple.rst b/docs/tutorials/libraries/symbols/simple.rst index 073e05a..3250df2 100644 --- a/docs/tutorials/libraries/symbols/simple.rst +++ b/docs/tutorials/libraries/symbols/simple.rst @@ -57,7 +57,7 @@ Generate project: :emphasize-lines: 2 [library-examples]> rm -rf _builds - [library-examples]> cmake -Hlink-error -B_builds + [library-examples]> cmake -Slink-error -B_builds -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc @@ -149,7 +149,7 @@ Should work now: :emphasize-lines: 2, 21, 32-33 [library-examples]> rm -rf _builds - [library-examples]> cmake -Hlink-error-fix -B_builds + [library-examples]> cmake -Slink-error-fix -B_builds -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc diff --git a/docs/tutorials/libraries/symbols/tools.rst b/docs/tutorials/libraries/symbols/tools.rst index f60fc39..e7b6074 100644 --- a/docs/tutorials/libraries/symbols/tools.rst +++ b/docs/tutorials/libraries/symbols/tools.rst @@ -46,7 +46,7 @@ Build library: :emphasize-lines: 2, 21, 24, 27-28 [library-examples]> rm -rf _builds - [library-examples]> cmake -Hlibrary-symbols -B_builds + [library-examples]> cmake -Slibrary-symbols -B_builds -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc diff --git a/docs/tutorials/out-of-source.rst b/docs/tutorials/out-of-source.rst index 8ccb860..b13ec6a 100644 --- a/docs/tutorials/out-of-source.rst +++ b/docs/tutorials/out-of-source.rst @@ -22,29 +22,29 @@ without conflicts, e.g. Debug and Release variant: .. code-block:: none - > cmake -H. -B_builds/Debug -DCMAKE_BUILD_TYPE=Debug - > cmake -H. -B_builds/Release -DCMAKE_BUILD_TYPE=Release + > cmake -S. -B_builds/Debug -DCMAKE_BUILD_TYPE=Debug + > cmake -S. -B_builds/Release -DCMAKE_BUILD_TYPE=Release or any other kind of customization, e.g. options: .. code-block:: none - > cmake -H. -B_builds/feature-on -DFOO_FEATURE=ON - > cmake -H. -B_builds/feature-off -DFOO_FEATURE=OFF + > cmake -S. -B_builds/feature-on -DFOO_FEATURE=ON + > cmake -S. -B_builds/feature-off -DFOO_FEATURE=OFF generators: .. code-block:: none - > cmake -H. -B_builds/xcode -G Xcode - > cmake -H. -B_builds/make -G "Unix Makefiles" + > cmake -S. -B_builds/xcode -G Xcode + > cmake -S. -B_builds/make -G "Unix Makefiles" platforms: .. code-block:: none - > cmake -H. -B_builds/osx -G Xcode - > cmake -H. -B_builds/ios -G Xcode -DCMAKE_TOOLCHAIN_FILE=/.../ios.cmake + > cmake -S. -B_builds/osx -G Xcode + > cmake -S. -B_builds/ios -G Xcode -DCMAKE_TOOLCHAIN_FILE=/.../ios.cmake VCS friendly ------------ diff --git a/docs/tutorials/project.rst b/docs/tutorials/project.rst index a4e6128..f2334ac 100644 --- a/docs/tutorials/project.rst +++ b/docs/tutorials/project.rst @@ -37,7 +37,7 @@ Run test on ``Linux``: :emphasize-lines: 2, 4-5, 9, 15, 21-22 [project-examples]> rm -rf _builds - [project-examples]> cmake -Hset-compiler -B_builds + [project-examples]> cmake -Sset-compiler -B_builds Before 'project': C: '' C++: '' @@ -78,7 +78,7 @@ Also ``project`` is a place where toolchain file will be read. :emphasize-lines: 2-5, 9, 12, 15-17, 20, 23, 26-28, 30 [project-examples]> rm -rf _builds - [project-examples]> cmake -Htoolchain -B_builds -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake + [project-examples]> cmake -Stoolchain -B_builds -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake Before 'project' Processing toolchain Processing toolchain @@ -133,7 +133,7 @@ is empty now: :emphasize-lines: 2, 8, 15 [project-examples]> rm -rf _builds - [project-examples]> cmake -Hc-compiler -B_builds + [project-examples]> cmake -Sc-compiler -B_builds Before 'project': C: '' C++: '' @@ -164,7 +164,7 @@ tools will not be triggered): :emphasize-lines: 2, 11-12 [project-examples]> rm -rf _builds - [project-examples]> cmake -Hcpp-not-found -B_builds + [project-examples]> cmake -Scpp-not-found -B_builds -- The C compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works @@ -190,7 +190,7 @@ No checks for C or C++ compiler as you can see: .. code-block:: none [project-examples]> rm -rf _builds - [project-examples]> cmake -Hno-language -B_builds + [project-examples]> cmake -Sno-language -B_builds -- Configuring done -- Generating done -- Build files have been written to: /.../project-examples/_builds @@ -226,7 +226,7 @@ Command ``project`` declare ``*_{SOURCE,BINARY}_DIR`` variables. Since version :emphasize-lines: 2, 4-7, 23-26 [project-examples]> rm -rf _builds - [project-examples]> cmake -Hvariables -B_builds + [project-examples]> cmake -Svariables -B_builds Before project: Source: Binary: @@ -271,7 +271,7 @@ when you have hierarchy of projects: :emphasize-lines: 22 [project-examples]> rm -rf _builds - [project-examples]> cmake -Hhierarchy -B_builds + [project-examples]> cmake -Shierarchy -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc @@ -320,7 +320,7 @@ before any other commands. It means that ``project`` will be called **before** :emphasize-lines: 17 [project-examples]> rm -rf _builds - [project-examples]> cmake -Hnot-declared -B_builds + [project-examples]> cmake -Snot-declared -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc diff --git a/docs/tutorials/tests.rst b/docs/tutorials/tests.rst index 6140db6..a1d7468 100644 --- a/docs/tutorials/tests.rst +++ b/docs/tutorials/tests.rst @@ -61,7 +61,7 @@ Configure and build project: :emphasize-lines: 2, 20 [examples]> rm -rf _builds - [examples]> cmake -Htest-examples/simple -B_builds + [examples]> cmake -Stest-examples/simple -B_builds -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc diff --git a/docs/tutorials/toolchain/globals/cxx-standard.rst b/docs/tutorials/toolchain/globals/cxx-standard.rst index 881bbb2..009de6d 100644 --- a/docs/tutorials/toolchain/globals/cxx-standard.rst +++ b/docs/tutorials/toolchain/globals/cxx-standard.rst @@ -89,7 +89,7 @@ generation and compilation: :emphasize-lines: 2, 9, 17-19 [examples]> rm -rf _builds - [examples]> cmake -Htoolchain-usage-examples/globals/cxx-standard/bad -B_builds -DWITH_FOO=ON + [examples]> cmake -Stoolchain-usage-examples/globals/cxx-standard/bad -B_builds -DWITH_FOO=ON -- The C compiler identification is GNU 5.4.1 -- The CXX compiler identification is GNU 5.4.1 ... @@ -138,7 +138,7 @@ You can add it with ``-DCMAKE_TOOLCHAIN_FILE=/path/to/cxx11.cmake``: :emphasize-lines: 2, 20, 29-31 [examples]> rm -rf _builds - [examples]> cmake -Htoolchain-usage-examples/globals/cxx-standard/toolchain -B_builds -DCMAKE_TOOLCHAIN_FILE=cxx11.cmake -DWITH_FOO=YES + [examples]> cmake -Stoolchain-usage-examples/globals/cxx-standard/toolchain -B_builds -DCMAKE_TOOLCHAIN_FILE=cxx11.cmake -DWITH_FOO=YES -- The C compiler identification is GNU 5.4.1 -- The CXX compiler identification is GNU 5.4.1 -- Check for working C compiler: /usr/bin/cc diff --git a/docs/tutorials/variables/cache.rst b/docs/tutorials/variables/cache.rst index 0163b9e..1b20b72 100644 --- a/docs/tutorials/variables/cache.rst +++ b/docs/tutorials/variables/cache.rst @@ -14,7 +14,7 @@ Cache variables saved in :ref:`CMakeCache.txt` file: :emphasize-lines: 2, 7 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hcache-cmakecachetxt -B_builds + [usage-of-variables]> cmake -Scache-cmakecachetxt -B_builds -- Configuring done -- Generating done -- Build files have been written to: /.../usage-of-variables/_builds @@ -39,7 +39,7 @@ are set globally: :emphasize-lines: 2-3 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hcache-no-scope -B_builds + [usage-of-variables]> cmake -Scache-no-scope -B_builds A: 123 -- Configuring done -- Generating done @@ -60,7 +60,7 @@ effect - old variable will be used still: [usage-of-variables]> rm -rf _builds [usage-of-variables]> cp double-set/1/CMakeLists.txt double-set/ - [usage-of-variables]> cmake -Hdouble-set -B_builds + [usage-of-variables]> cmake -Sdouble-set -B_builds Variable from cache: 123 -- Configuring done -- Generating done @@ -77,7 +77,7 @@ Update :ref:`CMakeLists.txt ` (don't remove cache!): :emphasize-lines: 2-3, 8 [usage-of-variables]> cp double-set/2/CMakeLists.txt double-set/ - [usage-of-variables]> cmake -Hdouble-set -B_builds + [usage-of-variables]> cmake -Sdouble-set -B_builds Variable from cache: 123 -- Configuring done -- Generating done @@ -94,7 +94,7 @@ Cache variable can be set by ``-D`` command line option. Variable that set by .. code-block:: none :emphasize-lines: 1-2, 7 - [usage-of-variables]> cmake -Dabc=444 -Hdouble-set -B_builds + [usage-of-variables]> cmake -Dabc=444 -Sdouble-set -B_builds Variable from cache: 444 -- Configuring done -- Generating done @@ -121,7 +121,7 @@ it by ``-C``: :emphasize-lines: 2, 4-6 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -C initial-cache/cache.cmake -Hinitial-cache -B_builds + [usage-of-variables]> cmake -C initial-cache/cache.cmake -Sinitial-cache -B_builds loading initial cache file initial-cache/cache.cmake A: 123 B: 456 @@ -144,7 +144,7 @@ you can add ``FORCE``: :emphasize-lines: 2-3 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -DA=456 -Hforce -B_builds + [usage-of-variables]> cmake -DA=456 -Sforce -B_builds A: 123 -- Configuring done -- Generating done @@ -171,12 +171,12 @@ Force as a workaround :emphasize-lines: 2-3, 7-8 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hno-force-confuse -B_builds + [usage-of-variables]> cmake -Sno-force-confuse -B_builds A: 456 -- Configuring done -- Generating done -- Build files have been written to: /.../usage-of-variables/_builds - [usage-of-variables]> cmake -Hno-force-confuse -B_builds + [usage-of-variables]> cmake -Sno-force-confuse -B_builds A: 123 -- Configuring done -- Generating done @@ -193,12 +193,12 @@ regular variable with the same name will be unset too each time: :emphasize-lines: 2-3, 7-8 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hforce-workaround -B_builds + [usage-of-variables]> cmake -Sforce-workaround -B_builds A: 456 -- Configuring done -- Generating done -- Build files have been written to: /.../usage-of-variables/_builds - [usage-of-variables]> cmake -Hforce-workaround -B_builds + [usage-of-variables]> cmake -Sforce-workaround -B_builds A: 456 -- Configuring done -- Generating done @@ -325,7 +325,7 @@ in cache ``456`` and ``789`` **will be ignored**, so final result is ``123``: :emphasize-lines: 2-4 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hinternal-force -B_builds + [usage-of-variables]> cmake -Sinternal-force -B_builds FOO_A (internal): 789 FOO_B (string): 123 -- Configuring done @@ -371,7 +371,7 @@ Default value: :emphasize-lines: 2-4 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hproject-customization -B_builds + [usage-of-variables]> cmake -Sproject-customization -B_builds FOO_A: Default value for A FOO_B: Default value for B -- Configuring done @@ -383,7 +383,7 @@ User's value: .. code-block:: none :emphasize-lines: 1-2 - [usage-of-variables]> cmake -DFOO_A=User -Hproject-customization -B_builds + [usage-of-variables]> cmake -DFOO_A=User -Sproject-customization -B_builds FOO_A: User FOO_B: Default value for B -- Configuring done @@ -395,7 +395,7 @@ Note that such approach doesn't work for regular CMake variable ``FOO_B``: .. code-block:: none :emphasize-lines: 1, 3 - [usage-of-variables]> cmake -DFOO_B=User -Hproject-customization -B_builds + [usage-of-variables]> cmake -DFOO_B=User -Sproject-customization -B_builds FOO_A: User FOO_B: Default value for B -- Configuring done @@ -415,7 +415,7 @@ Command ``option`` can be used for creating boolean cache entry: :emphasize-lines: 2-4, 9-10 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hoption -B_builds + [usage-of-variables]> cmake -Soption -B_builds FOO_A: OFF FOO_B: ON -- Configuring done diff --git a/docs/tutorials/variables/environment.rst b/docs/tutorials/variables/environment.rst index b33244b..1817a47 100644 --- a/docs/tutorials/variables/environment.rst +++ b/docs/tutorials/variables/environment.rst @@ -20,7 +20,7 @@ Environment variable can be read by using ``$ENV{...}`` syntax: [usage-of-variables]> echo $USERNAME ruslo [usage-of-variables]> export USERNAME - [usage-of-variables]> cmake -Hread-env -B_builds + [usage-of-variables]> cmake -Sread-env -B_builds Environment variable USERNAME: ruslo -- Configuring done -- Generating done @@ -42,7 +42,7 @@ By using ``set(ENV{...})`` syntax CMake can set environment variable: [usage-of-variables]> echo $USERNAME ruslo [usage-of-variables]> export USERNAME - [usage-of-variables]> cmake -Hset-env -B_builds + [usage-of-variables]> cmake -Sset-env -B_builds Environment variable USERNAME: Jane Doe -- Configuring done -- Generating done @@ -64,7 +64,7 @@ Unset environment variable: [usage-of-variables]> echo $USERNAME ruslo [usage-of-variables]> export USERNAME - [usage-of-variables]> cmake -Hunset-env -B_builds + [usage-of-variables]> cmake -Sunset-env -B_builds Environment variable USERNAME: -- Configuring done -- Generating done @@ -91,7 +91,7 @@ Child process will inherit environment variables of parent: :emphasize-lines: 2, 3, 7 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Henv-inherit -B_builds + [usage-of-variables]> cmake -Senv-inherit -B_builds Set environment variable Top level ABC: This is ABC Environment variable from level1: This is ABC @@ -118,7 +118,7 @@ Note that in previous examples variable was set on :emphasize-lines: 2, 3 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Henv-configure -B_builds + [usage-of-variables]> cmake -Senv-configure -B_builds Environment variable ABC: 123 -- Configuring done -- Generating done @@ -162,7 +162,7 @@ time it will break normal :ref:`workflow `: [usage-of-variables]> rm -rf _builds [usage-of-variables]> export ABC=abc - [usage-of-variables]> cmake -Henv-depends -B_builds + [usage-of-variables]> cmake -Senv-depends -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc @@ -206,7 +206,7 @@ You have to run configure manually yourself: .. code-block:: none :emphasize-lines: 1, 9 - [usage-of-variables]> cmake -Henv-depends -B_builds + [usage-of-variables]> cmake -Senv-depends -B_builds -- Configuring done -- Generating done -- Build files have been written to: /.../usage-of-variables/_builds diff --git a/docs/tutorials/variables/regular.rst b/docs/tutorials/variables/regular.rst index 4f96176..9a8bcbf 100644 --- a/docs/tutorials/variables/regular.rst +++ b/docs/tutorials/variables/regular.rst @@ -73,7 +73,7 @@ in scope of ``boo`` directory: :emphasize-lines: 2-5 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hdirectory-scope -B_builds + [usage-of-variables]> cmake -Sdirectory-scope -B_builds Top level scope (before): 123 Directory 'boo' scope: 456 Top level scope (after): 123 @@ -97,7 +97,7 @@ the current scope it will be dereferenced to an empty string: :emphasize-lines: 2-7 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Htake-from-parent-scope -B_builds + [usage-of-variables]> cmake -Stake-from-parent-scope -B_builds Top level scope state: { abc = '123', xyz = '456' } [boo]: Scope for function 'boo' copied from parent: { abc = '123', xyz = '456' } [boo]: Command 'set(abc ...)' modify current scope, state: { abc = '789', xyz = '456' } @@ -127,7 +127,7 @@ like ``set`` and ``unset`` will affect the current scope: :emphasize-lines: 2-6 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hsame-scope -B_builds + [usage-of-variables]> cmake -Ssame-scope -B_builds abc (before): 123 abc (after): 456 xyz (before): 336 @@ -176,7 +176,7 @@ the cache: :emphasize-lines: 2-4 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hfrom-cache -B_builds + [usage-of-variables]> cmake -Sfrom-cache -B_builds Regular variable from current scope: 123 Cache variable if regular not found: 789 -- Configuring done @@ -197,7 +197,7 @@ will remove the regular variable with the same name from current scope: :emphasize-lines: 2,3 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hcache-remove-regular -B_builds + [usage-of-variables]> cmake -Scache-remove-regular -B_builds Regular variable unset, take from cache: 789 -- Configuring done -- Generating done @@ -221,7 +221,7 @@ function and not from top level scope: :emphasize-lines: 2-5 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hcache-confuse -B_builds + [usage-of-variables]> cmake -Scache-confuse -B_builds Function scope before cache modify = 123 Function scope after cache modify = 789 Parent scope is not affected, take variable from current scope, not cache = 123 @@ -235,7 +235,7 @@ removing cache: .. code-block:: none :emphasize-lines: 1-4 - [usage-of-variables]> cmake -Hcache-confuse -B_builds + [usage-of-variables]> cmake -Scache-confuse -B_builds Function scope before cache modify = 123 Function scope after cache modify = 123 Parent scope is not affected, take variable from current scope, not cache = 123 @@ -259,7 +259,7 @@ Variable names are case-sensitive: :emphasize-lines: 2-8 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hcase-sensitive -B_builds + [usage-of-variables]> cmake -Scase-sensitive -B_builds a: 123 b: 567 aBc: 333 @@ -280,7 +280,7 @@ Name of variable may consist of **any** characters: :emphasize-lines: 2-8 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hany-names -B_builds + [usage-of-variables]> cmake -Sany-names -B_builds Variable name: 'abc', value: '123' Variable name: 'ab c', value: '456' Variable name: 'ab?c', value: '789' @@ -307,7 +307,7 @@ quote character will be treated as part of the string: :emphasize-lines: 3-8 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hquotes -B_builds + [usage-of-variables]> cmake -Squotes -B_builds a = 'Quoted argument' b = 'x-"Unquoted argument"' c = @@ -369,7 +369,7 @@ Dereferencing of variable by ``${...}`` will happen as many times as needed: :emphasize-lines: 2,17-26 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hnested-dereference -B_builds + [usage-of-variables]> cmake -Snested-dereference -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc @@ -413,7 +413,7 @@ name, etc.: :emphasize-lines: 2,17-20 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Htypes-of-variable -B_builds + [usage-of-variables]> cmake -Stypes-of-variable -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc @@ -500,7 +500,7 @@ remove elements by index, etc.: :emphasize-lines: 2-8 [usage-of-variables]> rm -rf _builds - [usage-of-variables]> cmake -Hlist-operations -B_builds + [usage-of-variables]> cmake -Slist-operations -B_builds length of 'a;b;c' (l0) = 3 length of 'a;b;c' (l1) = 3 length of 'a;b c' (l2) = 2 @@ -535,7 +535,7 @@ list: :emphasize-lines: 4-16, 19-31, 34-46 [examples]> rm -rf _builds - [examples]> cmake -Husage-of-variables/empty-list -B_builds + [examples]> cmake -Susage-of-variables/empty-list -B_builds Adding non-empty element to non-empty list. diff --git a/docs/tutorials/version-policies.rst b/docs/tutorials/version-policies.rst index 92b063e..c9dbb24 100644 --- a/docs/tutorials/version-policies.rst +++ b/docs/tutorials/version-policies.rst @@ -88,7 +88,7 @@ CMake will think that you're running code with old policies and warns you: .. code-block:: none :emphasize-lines: 4-5 - [minimum-required-example]> cmake -Hbad -B_builds/bad + [minimum-required-example]> cmake -Sbad -B_builds/bad -- The C compiler identification is GNU 4.9.3 -- The CXX compiler identification is GNU 4.9.3 CMake Warning at /.../share/cmake-3.3.1/Modules/Platform/CYGWIN.cmake:15 (message): @@ -124,7 +124,7 @@ with no warnings: .. code-block:: none - [minimum-required-example]> cmake -Hgood -B_builds/good + [minimum-required-example]> cmake -Sgood -B_builds/good -- The C compiler identification is GNU 4.9.3 -- The CXX compiler identification is GNU 4.9.3 -- Check for working C compiler: /usr/bin/cc @@ -185,7 +185,7 @@ Works fine for CMake before ``3.0``: [policy-examples]> cmake --version cmake version 2.8.12.2 [policy-examples]> rm -rf _builds - [policy-examples]> cmake -Hbug-2.8 -B_builds + [policy-examples]> cmake -Sbug-2.8 -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc @@ -208,7 +208,7 @@ For CMake version ``>= 3.0`` warning will be reported: [policy-examples]> cmake --version cmake version 3.5.2 [policy-examples]> rm -rf _builds - [policy-examples]> cmake -Hbug-2.8 -B_builds + [policy-examples]> cmake -Sbug-2.8 -B_builds ... -- Configuring done CMake Warning (dev) at CMakeLists.txt:4 (add_library): @@ -234,7 +234,7 @@ warning turns into error: :emphasize-lines: 2,18 [policy-examples]> rm -rf _builds - [policy-examples]> cmake -Hset-3.0 -B_builds + [policy-examples]> cmake -Sset-3.0 -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc @@ -298,7 +298,7 @@ Looks good for ``CMake 3.0+``: [policy-examples]> cmake --version cmake version 3.5.2 [policy-examples]> rm -rf _builds - [policy-examples]> cmake -Hunknown-2.8 -B_builds + [policy-examples]> cmake -Sunknown-2.8 -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc @@ -325,7 +325,7 @@ have no idea what this policy is about: > cmake --version cmake version 2.8.12.2 > rm -rf _builds - > cmake -Hunknown-2.8 -B_builds + > cmake -Sunknown-2.8 -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc diff --git a/docs/tutorials/workflow.rst b/docs/tutorials/workflow.rst index a3d6a0a..3844b29 100644 --- a/docs/tutorials/workflow.rst +++ b/docs/tutorials/workflow.rst @@ -7,7 +7,7 @@ Workflow There is a nice feature in :ref:`CMake ` that can greatly simplify developer's workflow: :ref:`native build tool ` will watch CMake sources for changes and run re-configure step on update automatically. In -command-line terms it means that you have to run ``cmake -H. -B_builds`` **only +command-line terms it means that you have to run ``cmake -S. -B_builds`` **only once**, you don't need to run configure again after modification of CMakeLists.txt - you can keep using ``cmake --build``. @@ -29,7 +29,7 @@ Generate Makefile: .. code-block:: none :emphasize-lines: 1, 16 - [minimal-with-message]> cmake -H. -B_builds + [minimal-with-message]> cmake -S. -B_builds -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc @@ -82,7 +82,7 @@ Let's "modify" ``foo.cpp`` source: Make detects that executable ``foo`` is out-of-date and rebuild it. Well, that's what build systems designed for :) -Now let's "change" CMakeLists.txt. Do we need to run ``cmake -H. -B_builds`` +Now let's "change" CMakeLists.txt. Do we need to run ``cmake -S. -B_builds`` again? The answer is NO - just keep using ``cmake --build _builds``. CMakeLists.txt added as dependent file to the Makefile: @@ -150,7 +150,7 @@ Suspicious behavior If your workflow doesn't match configure-once approach then it may be a symptom of wrongly written CMake code. Especially when you have to run -``cmake -H. -B_builds`` twice or when ``cmake --build _builds`` doesn't catch +``cmake -S. -B_builds`` twice or when ``cmake --build _builds`` doesn't catch updates from CMake code. .. admonition:: CMake issue