CMakeDetermineVSServicePack: Sync documentation

- Added intro code block showing how to include this module.
- Used "command" instead of "function".
This commit is contained in:
Peter Kokot
2025-05-26 00:40:01 +02:00
parent cfcff29087
commit 10ad343e73

View File

@@ -11,21 +11,32 @@ CMakeDetermineVSServicePack
been superseded by the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that been superseded by the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that
contains the compiler version number. contains the compiler version number.
This module provides a function to determine the installed Visual Studio service This module provides a command to determine the installed Visual Studio
pack version for Visual Studio 2012 and earlier. service pack version for Visual Studio 2012 and earlier.
Load this module in a CMake project with:
.. code-block:: cmake
include(CMakeDetermineVSServicePack)
Commands
^^^^^^^^
This module provides the following command:
.. command:: DetermineVSServicePack .. command:: DetermineVSServicePack
Determines the Visual Studio service pack version of the ``cl`` compiler
in use:
.. code-block:: cmake .. code-block:: cmake
DetermineVSServicePack(<result>) DetermineVSServicePack(<variable>)
Determines the Visual Studio service pack version of the ``cl`` compiler in The result is stored in the specified internal cache variable ``<variable>``,
use and stores the result in the specified internal cache variable which is set to one of the following values, or to an empty string if the
``<result>``. service pack cannot be determined:
The ``<result>`` variable will be set to one of the following values or an
empty string if the service pack cannot be determined:
* ``vc80``, ``vc80sp1`` * ``vc80``, ``vc80sp1``
* ``vc90``, ``vc90sp1`` * ``vc90``, ``vc90sp1``