Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.15 Update #44

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/examples/run-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions docs/first-step/generate-native-tool/cli-make.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ 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):

.. 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
Expand Down
4 changes: 2 additions & 2 deletions docs/first-step/generate-native-tool/cli-visual-studio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/first-step/generate-native-tool/cli-xcode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/glossary/-B.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Add ``-B<path-to-binary-tree>`` to set the path to directory where CMake will
store generated files. There must be no spaces between ``-B`` and
``<path-to-binary-tree>``. Always must be used with :ref:`-H <-H>` option.
``<path-to-binary-tree>``. Always must be used with :ref:`-S <-S>` option.

Path to this directory will be saved in
`CMAKE_BINARY_DIR <https://cmake.org/cmake/help/latest/variable/CMAKE_BINARY_DIR.html>`__
Expand All @@ -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

Expand All @@ -28,4 +28,4 @@ variable.

* :ref:`Binary tree <binary tree>`
* :ref:`-S <-S>`
* :ref:`-H <-H>`
* :ref:`-S <-S>`
18 changes: 9 additions & 9 deletions docs/glossary/-H.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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<path-to-source-tree>`` to set directory with ``CMakeLists.txt``.
Add ``-S<path-to-source-tree>`` to set directory with ``CMakeLists.txt``.
This internal option is not documented but
`widely used by community <https://github.com/search?q=%22cmake+-H%22&ref=searchresults&type=Code&utf8=%E2%9C%93>`__.
There must be no spaces between ``-H`` and ``<path-to-source-tree>``
`widely used by community <https://github.com/search?q=%22cmake+-S%22&ref=searchresults&type=Code&utf8=%E2%9C%93>`__.
There must be no spaces between ``-S`` and ``<path-to-source-tree>``
(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.
Expand All @@ -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::

Expand All @@ -49,4 +49,4 @@ variable.

.. admonition:: CMake mailing list

* `Document -H/-B <http://www.mail-archive.com/[email protected]/msg16693.html>`__
* `Document -S/-B <http://www.mail-archive.com/[email protected]/msg16693.html>`__
2 changes: 1 addition & 1 deletion docs/glossary/-S.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
--

Add ``-S <path-to-source-tree>`` 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

Expand Down
2 changes: 1 addition & 1 deletion docs/glossary/multi-config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/glossary/single-config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/glossary/source-tree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Source tree

Hierarchy of directories with source files such as CMake/C++ sources.
:ref:`CMake <CMake>` starts with the :ref:`CMakeLists.txt <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
Expand All @@ -17,7 +17,7 @@ directory that you want to be managed with :ref:`VCS <VCS>`.

.. seealso::

* :ref:`-H <-H>`
* :ref:`-S <-S>`
* :ref:`Binary tree <binary tree>`
* :doc:`GUI + Visual Studio </first-step/generate-native-tool/gui-visual-studio>`
* :doc:`GUI + Xcode </first-step/generate-native-tool/gui-xcode>`
2 changes: 1 addition & 1 deletion docs/overview/cmake-can-not.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <affecting 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
Expand Down
2 changes: 1 addition & 1 deletion docs/overview/yed/cmake-environment.graphml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
from CMake code:

cmake \
-H. \
-S. \
-B_builds<y:LabelModel>
<y:SmartNodeLabelModel distance="4.0"/>
</y:LabelModel>
Expand Down
8 changes: 4 additions & 4 deletions docs/platforms/android/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand All @@ -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.
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion docs/templates.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/cmake-sources/common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/cmake-sources/includes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/cmake-sources/subdirectories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/cmake-stages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading