From 30d08bdce92960caa3fc68a3de95fffdf569e97b Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 10 Aug 2018 20:13:53 -0400 Subject: doc: Consistently use for describing the name of a package --- Help/command/export.rst | 8 +-- Help/command/find_package.rst | 76 ++++++++++++++--------------- Help/cpack_gen/wix.rst | 4 +- Help/manual/cmake-developer.7.rst | 6 +-- Help/manual/cmake-packages.7.rst | 50 +++++++++---------- Modules/CMakeFindDependencyMacro.cmake | 2 +- Modules/CMakePackageConfigHelpers.cmake | 12 ++--- Modules/FindPackageHandleStandardArgs.cmake | 4 +- Source/cmFindPackageCommand.cxx | 4 +- Tests/FindPackageTest/CMakeLists.txt | 2 +- 10 files changed, 84 insertions(+), 84 deletions(-) diff --git a/Help/command/export.rst b/Help/command/export.rst index 0c676c6a72..8c4932848e 100644 --- a/Help/command/export.rst +++ b/Help/command/export.rst @@ -51,15 +51,15 @@ unspecified. :: - export(PACKAGE ) + export(PACKAGE ) Store the current build directory in the CMake user package registry -for package ````. The find_package command may consider the -directory while searching for package ````. This helps dependent +for package ````. The find_package command may consider the +directory while searching for package ````. This helps dependent projects find and use a package from the current project's build tree without help from the user. Note that the entry in the package registry that this command creates works only in conjunction with a -package configuration file (``Config.cmake``) that works with the +package configuration file (``Config.cmake``) that works with the build tree. In some cases, for example for packaging and for system wide installations, it is not desirable to write the user package registry. If the :variable:`CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst index a4416abd39..bbe8c4deb1 100644 --- a/Help/command/find_package.rst +++ b/Help/command/find_package.rst @@ -5,12 +5,12 @@ Load settings for an external project. :: - find_package( [version] [EXACT] [QUIET] [MODULE] + find_package( [version] [EXACT] [QUIET] [MODULE] [REQUIRED] [[COMPONENTS] [components...]] [OPTIONAL_COMPONENTS components...] [NO_POLICY_SCOPE]) -Finds and loads settings from an external project. ``_FOUND`` +Finds and loads settings from an external project. ``_FOUND`` will be set to indicate whether the package was found. When the package is found package-specific information is provided through variables and :ref:`Imported Targets` documented by the package itself. The @@ -44,7 +44,7 @@ are encouraged to read on. The command has two modes by which it searches for packages: "Module" mode and "Config" mode. Module mode is available when the command is invoked with the above reduced signature. CMake searches for a file -called ``Find.cmake`` in the :variable:`CMAKE_MODULE_PATH` +called ``Find.cmake`` in the :variable:`CMAKE_MODULE_PATH` followed by the CMake installation. If the file is found, it is read and processed by CMake. It is responsible for finding the package, checking the version, and producing any needed messages. Many @@ -54,7 +54,7 @@ option is not given the command proceeds to Config mode. The complete Config mode command signature is:: - find_package( [version] [EXACT] [QUIET] + find_package( [version] [EXACT] [QUIET] [REQUIRED] [[COMPONENTS] [components...]] [CONFIG|NO_MODULE] [NO_POLICY_SCOPE] @@ -82,29 +82,29 @@ mode is also implied by use of options not specified in the reduced signature. Config mode attempts to locate a configuration file provided by the -package to be found. A cache entry called ``_DIR`` is created to +package to be found. A cache entry called ``_DIR`` is created to hold the directory containing the file. By default the command -searches for a package with the name ````. If the ``NAMES`` option -is given the names following it are used instead of ````. The -command searches for a file called ``Config.cmake`` or -``-config.cmake`` for each name specified. A -replacement set of possible configuration file names may be given +searches for a package with the name ````. If the ``NAMES`` option +is given the names following it are used instead of ````. +The command searches for a file called ``Config.cmake`` or +``-config.cmake`` for each name specified. +A replacement set of possible configuration file names may be given using the ``CONFIGS`` option. The search procedure is specified below. Once found, the configuration file is read and processed by CMake. Since the file is provided by the package it already knows the location of package contents. The full path to the configuration file -is stored in the cmake variable ``_CONFIG``. +is stored in the cmake variable ``_CONFIG``. All configuration files which have been considered by CMake while searching for an installation of the package with an appropriate -version are stored in the cmake variable ``_CONSIDERED_CONFIGS``, -the associated versions in ``_CONSIDERED_VERSIONS``. +version are stored in the cmake variable ``_CONSIDERED_CONFIGS``, +the associated versions in ``_CONSIDERED_VERSIONS``. If the package configuration file cannot be found CMake will generate an error describing the problem unless the ``QUIET`` argument is specified. If ``REQUIRED`` is specified and the package is not found a fatal error is generated and the configure step stops executing. If -``_DIR`` has been set to a directory not containing a +``_DIR`` has been set to a directory not containing a configuration file CMake will ignore it and search from scratch. When the ``[version]`` argument is given Config mode will only find a @@ -127,7 +127,7 @@ version file is loaded in a nested scope in which the following variables have been defined: ``PACKAGE_FIND_NAME`` - the ```` name + the ```` ``PACKAGE_FIND_VERSION`` full requested version string ``PACKAGE_FIND_VERSION_MAJOR`` @@ -158,17 +158,17 @@ whether the configuration file provides an acceptable version. They are not available after the find_package call returns. If the version is acceptable the following variables are set: -``_VERSION`` +``_VERSION`` full provided version string -``_VERSION_MAJOR`` +``_VERSION_MAJOR`` major version if provided, else 0 -``_VERSION_MINOR`` +``_VERSION_MINOR`` minor version if provided, else 0 -``_VERSION_PATCH`` +``_VERSION_PATCH`` patch version if provided, else 0 -``_VERSION_TWEAK`` +``_VERSION_TWEAK`` tweak version if provided, else 0 -``_VERSION_COUNT`` +``_VERSION_COUNT`` number of version components, 0 to 4 and the corresponding package configuration file is loaded. @@ -192,7 +192,7 @@ Much of the interface is provided for completeness and for use internally by find-modules loaded by Module mode. Most user code should simply call:: - find_package( [major[.minor]] [EXACT] [REQUIRED|QUIET]) + find_package( [major[.minor]] [EXACT] [REQUIRED|QUIET]) in order to find a package. Package maintainers providing CMake package configuration files are encouraged to name and install them @@ -228,7 +228,7 @@ containing a configuration file:: /.app/Contents/Resources/CMake/ (A) In all cases the ```` is treated as case-insensitive and corresponds -to any of the names specified (```` or names given by ``NAMES``). +to any of the names specified (```` or names given by ``NAMES``). Paths with ``lib/`` are enabled if the :variable:`CMAKE_LIBRARY_ARCHITECTURE` variable is set. ``lib*`` includes one @@ -286,7 +286,7 @@ enabled. (``;`` on Windows and ``:`` on UNIX). This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed:: - _DIR + _DIR CMAKE_PREFIX_PATH CMAKE_FRAMEWORK_PATH CMAKE_APPBUNDLE_PATH @@ -329,7 +329,7 @@ enabled. hard-coded guesses. .. |FIND_XXX| replace:: find_package -.. |FIND_ARGS_XXX| replace:: +.. |FIND_ARGS_XXX| replace:: .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace:: :variable:`CMAKE_FIND_ROOT_PATH_MODE_PACKAGE` @@ -344,28 +344,28 @@ defines variables to provide information about the call arguments (and restores their original state before returning): ``CMAKE_FIND_PACKAGE_NAME`` - the ```` name which is searched for -``_FIND_REQUIRED`` + the ```` which is searched for +``_FIND_REQUIRED`` true if ``REQUIRED`` option was given -``_FIND_QUIETLY`` +``_FIND_QUIETLY`` true if ``QUIET`` option was given -``_FIND_VERSION`` +``_FIND_VERSION`` full requested version string -``_FIND_VERSION_MAJOR`` +``_FIND_VERSION_MAJOR`` major version if requested, else 0 -``_FIND_VERSION_MINOR`` +``_FIND_VERSION_MINOR`` minor version if requested, else 0 -``_FIND_VERSION_PATCH`` +``_FIND_VERSION_PATCH`` patch version if requested, else 0 -``_FIND_VERSION_TWEAK`` +``_FIND_VERSION_TWEAK`` tweak version if requested, else 0 -``_FIND_VERSION_COUNT`` +``_FIND_VERSION_COUNT`` number of version components, 0 to 4 -``_FIND_VERSION_EXACT`` +``_FIND_VERSION_EXACT`` true if ``EXACT`` option was given -``_FIND_COMPONENTS`` +``_FIND_COMPONENTS`` list of requested components -``_FIND_REQUIRED_`` +``_FIND_REQUIRED_`` true if component ```` is required, false if component ```` is optional @@ -375,7 +375,7 @@ In Config mode ``find_package`` handles ``REQUIRED``, ``QUIET``, and ``[version]`` options automatically but leaves it to the package configuration file to handle components in a way that makes sense for the package. The package configuration file may set -``_FOUND`` to false to tell ``find_package`` that component +``_FOUND`` to false to tell ``find_package`` that component requirements are not satisfied. See the :command:`cmake_policy` command documentation for discussion diff --git a/Help/cpack_gen/wix.rst b/Help/cpack_gen/wix.rst index 3822fa00c0..fc8a098a4d 100644 --- a/Help/cpack_gen/wix.rst +++ b/Help/cpack_gen/wix.rst @@ -214,8 +214,8 @@ Windows using WiX. If this variable is set the generated installer will create an entry in the windows registry key - ``HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\`` - The value for ```` is provided by this variable. + ``HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\`` + The value for ```` is provided by this variable. Assuming you also install a CMake configuration file this will allow other CMake projects to find your package with diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 32e8cfc2c1..f05c4b129b 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -579,11 +579,11 @@ file and the ``Help/manual/cmake-modules.7.rst`` toctree entry. Find Modules ------------ -A "find module" is a ``Modules/Find.cmake`` file to be loaded -by the :command:`find_package` command when invoked for ````. +A "find module" is a ``Modules/Find.cmake`` file to be loaded +by the :command:`find_package` command when invoked for ````. The primary task of a find module is to determine whether a package -exists on the system, set the ``_FOUND`` variable to reflect +exists on the system, set the ``_FOUND`` variable to reflect this and provide any variables, macros and imported targets required to use the package. A find module is useful in cases where an upstream library does not provide a diff --git a/Help/manual/cmake-packages.7.rst b/Help/manual/cmake-packages.7.rst index c9442bc192..876ca84d9d 100644 --- a/Help/manual/cmake-packages.7.rst +++ b/Help/manual/cmake-packages.7.rst @@ -73,7 +73,7 @@ Handling of ``COMPONENTS`` and ``OPTIONAL_COMPONENTS`` is defined by the package. By setting the :variable:`CMAKE_DISABLE_FIND_PACKAGE_` variable to -``TRUE``, the ``PackageName`` package will not be searched, and will always +``TRUE``, the ```` package will not be searched, and will always be ``NOTFOUND``. .. _`Config File Packages`: @@ -92,9 +92,9 @@ packages, that is, they belong with the header files and any other files provided to assist downstreams in using the package. A set of variables which provide package status information are also set -automatically when using a config-file package. The ``_FOUND`` +automatically when using a config-file package. The ``_FOUND`` variable is set to true or false, depending on whether the package was -found. The ``_DIR`` cache variable is set to the location of the +found. The ``_DIR`` cache variable is set to the location of the package configuration file. Find-module Packages @@ -108,10 +108,10 @@ file, it is not shipped with upstream, but is used by downstream to find the files by guessing locations of files with platform-specific hints. Unlike the case of an upstream-provided package configuration file, no single point -of reference identifies the package as being found, so the ``_FOUND`` +of reference identifies the package as being found, so the ``_FOUND`` variable is not automatically set by the :command:`find_package` command. It can still be expected to be set by convention however and should be set by -the author of the Find-module. Similarly there is no ``_DIR`` variable, +the author of the Find-module. Similarly there is no ``_DIR`` variable, but each of the artifacts such as library locations and header file locations provide a separate cache variable. @@ -197,7 +197,7 @@ When the :command:`find_package` command loads a version file it first sets the following variables: ``PACKAGE_FIND_NAME`` - The name + The ```` ``PACKAGE_FIND_VERSION`` Full requested version string @@ -240,26 +240,26 @@ variables. When the version file claims to be an acceptable match for the requested version the find_package command sets the following variables for use by the project: -``_VERSION`` +``_VERSION`` Full provided version string -``_VERSION_MAJOR`` +``_VERSION_MAJOR`` Major version if provided, else 0 -``_VERSION_MINOR`` +``_VERSION_MINOR`` Minor version if provided, else 0 -``_VERSION_PATCH`` +``_VERSION_PATCH`` Patch version if provided, else 0 -``_VERSION_TWEAK`` +``_VERSION_TWEAK`` Tweak version if provided, else 0 -``_VERSION_COUNT`` +``_VERSION_COUNT`` Number of version components, 0 to 4 The variables report the version of the package that was actually found. -The ```` part of their name matches the argument given to the +The ```` part of their name matches the argument given to the :command:`find_package` command. .. _`Creating Packages`: @@ -347,8 +347,8 @@ The :module:`CMakePackageConfigHelpers` module provides a macro for creating a simple ``ConfigVersion.cmake`` file. This file sets the version of the package. It is read by CMake when :command:`find_package` is called to determine the compatibility with the requested version, and to set some -version-specific variables ``_VERSION``, ``_VERSION_MAJOR``, -``_VERSION_MINOR`` etc. The :command:`install(EXPORT)` command is +version-specific variables ``_VERSION``, ``_VERSION_MAJOR``, +``_VERSION_MINOR`` etc. The :command:`install(EXPORT)` command is used to export the targets in the ``ClimbingStatsTargets`` export-set, defined previously by the :command:`install(TARGETS)` command. This command generates the ``ClimbingStatsTargets.cmake`` file to contain :prop_tgt:`IMPORTED` @@ -432,8 +432,8 @@ the dependency is not found, along with a diagnostic that the ``ClimbingStats`` package can not be used without the ``Stats`` package. If ``COMPONENTS`` are specified when the downstream uses :command:`find_package`, -they are listed in the ``_FIND_COMPONENTS`` variable. If a particular -component is non-optional, then the ``_FIND_REQUIRED_`` will +they are listed in the ``_FIND_COMPONENTS`` variable. If a particular +component is non-optional, then the ``_FIND_REQUIRED_`` will be true. This can be tested with logic in the package configuration file: .. code-block:: cmake @@ -580,8 +580,8 @@ non-standard install locations or directly in their own build trees. A project may populate either the user or system registry (using its own means, see below) to refer to its location. In either case the package should store at the registered location a -`Package Configuration File`_ (``Config.cmake``) and optionally a -`Package Version File`_ (``ConfigVersion.cmake``). +`Package Configuration File`_ (``Config.cmake``) and optionally a +`Package Version File`_ (``ConfigVersion.cmake``). The :command:`find_package` command searches the two package registries as two of the search steps specified in its documentation. If it has @@ -603,18 +603,18 @@ must be manually taught to register their packages if desired. On Windows the user package registry is stored in the Windows registry under a key in ``HKEY_CURRENT_USER``. -A ```` may appear under registry key:: +A ```` may appear under registry key:: - HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\ + HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\ as a ``REG_SZ`` value, with arbitrary name, that specifies the directory containing the package configuration file. On UNIX platforms the user package registry is stored in the user home -directory under ``~/.cmake/packages``. A ```` may appear under +directory under ``~/.cmake/packages``. A ```` may appear under the directory:: - ~/.cmake/packages/ + ~/.cmake/packages/ as a file, with arbitrary name, whose content specifies the directory containing the package configuration file. @@ -629,10 +629,10 @@ CMake currently provides no interface to add to the system package registry. Installers must be manually taught to register their packages if desired. On Windows the system package registry is stored in the Windows registry -under a key in ``HKEY_LOCAL_MACHINE``. A ```` may appear under +under a key in ``HKEY_LOCAL_MACHINE``. A ```` may appear under registry key:: - HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\ + HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\ as a ``REG_SZ`` value, with arbitrary name, that specifies the directory containing the package configuration file. diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake index 6a89fff2ae..de1a3329a3 100644 --- a/Modules/CMakeFindDependencyMacro.cmake +++ b/Modules/CMakeFindDependencyMacro.cmake @@ -14,7 +14,7 @@ CMakeFindDependencyMacro It is designed to be used in a :ref:`Package Configuration File ` - (``Config.cmake``). ``find_dependency`` forwards the correct + (``Config.cmake``). ``find_dependency`` forwards the correct parameters for ``QUIET`` and ``REQUIRED`` which were passed to the original :command:`find_package` call. Any additional arguments specified are forwarded to :command:`find_package`. diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index 790d4084c5..d5301d7379 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -27,10 +27,10 @@ # ) # # ``configure_package_config_file()`` should be used instead of the plain -# :command:`configure_file()` command when creating the ``Config.cmake`` -# or ``-config.cmake`` file for installing a project or library. It helps -# making the resulting package relocatable by avoiding hardcoded paths in the -# installed ``Config.cmake`` file. +# :command:`configure_file()` command when creating the ``Config.cmake`` +# or ``-config.cmake`` file for installing a project or library. +# It helps making the resulting package relocatable by avoiding hardcoded paths +# in the installed ``Config.cmake`` file. # # In a ``FooConfig.cmake`` file there may be code like this to make the install # destinations know to the using project: @@ -101,7 +101,7 @@ # When using the ``NO_SET_AND_CHECK_MACRO``, this macro is not generated # into the ``FooConfig.cmake`` file. # -# ``check_required_components()`` should be called at the end of +# ``check_required_components()`` should be called at the end of # the ``FooConfig.cmake`` file. This macro checks whether all requested, # non-optional components have been found, and if this is not the case, sets # the ``Foo_FOUND`` variable to ``FALSE``, so that the package is considered to @@ -127,7 +127,7 @@ # COMPATIBILITY ) # # -# Writes a file for use as ``ConfigVersion.cmake`` file to +# Writes a file for use as ``ConfigVersion.cmake`` file to # ````. See the documentation of :command:`find_package()` for # details on this. # diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 67f6bd6f2b..1722d6aafb 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -145,7 +145,7 @@ endmacro() # internal helper macro to generate the failure message when used in CONFIG_MODE: macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) - # _CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found: + # _CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found: if(${_NAME}_CONFIG) _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing:${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})") else() @@ -199,7 +199,7 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG") endif() - # In config-mode, we rely on the variable _CONFIG, which is set by find_package() + # In config-mode, we rely on the variable _CONFIG, which is set by find_package() # when it successfully found the config-file, including version checking: if(FPHSA_CONFIG_MODE) list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 598b9b6080..96de6adcef 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -487,7 +487,7 @@ bool cmFindPackageCommand::InitialPass(std::vector const& args, this->SetModuleVariables(components); - // See if there is a Find.cmake module. + // See if there is a Find.cmake module. if (this->UseFindModules) { bool foundModule = false; if (!this->FindModule(foundModule)) { @@ -538,7 +538,7 @@ bool cmFindPackageCommand::InitialPass(std::vector const& args, } // No find module. Assume the project has a CMake config file. Use - // a _DIR cache variable to locate it. + // a _DIR cache variable to locate it. this->Variable = this->Name; this->Variable += "_DIR"; diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index 08768711ce..3fd55413e8 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -188,7 +188,7 @@ find_package(ArchC 3.1 EXACT NAMES zot) find_package(ArchD 4.0 EXACT NAMES zot) unset(CMAKE_LIBRARY_ARCHITECTURE) -# Test _DIR environment variable. +# Test _DIR environment variable. # We erase the main prefix path to ensure the env var is used. set(CMAKE_PREFIX_PATH) set(ENV{EnvA_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/lib/zot-3.1") -- cgit v1.2.1