[Cmake-commits] CMake branch, next, updated. v3.4.1-1877-g746af29

Chuck Atkins chuck.atkins at kitware.com
Fri Jan 8 11:43:44 EST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  746af298c623980ebc96eb203adeffef4853628c (commit)
       via  6dcfc1f49c6afa6cf6a3cd4b7c90e59dbfc18fb0 (commit)
      from  f97ef254862a4c5d37e370b6390cbbe97cd89946 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=746af298c623980ebc96eb203adeffef4853628c
commit 746af298c623980ebc96eb203adeffef4853628c
Merge: f97ef25 6dcfc1f
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Fri Jan 8 11:43:43 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 8 11:43:43 2016 -0500

    Merge topic 'allow-variables-for-find-defaults' into next
    
    6dcfc1f4 find_*: Add variables to enable NO_XXX_PATH defaults to find commands


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6dcfc1f49c6afa6cf6a3cd4b7c90e59dbfc18fb0
commit 6dcfc1f49c6afa6cf6a3cd4b7c90e59dbfc18fb0
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Tue Jan 5 11:46:49 2016 -0500
Commit:     Chuck Atkins <chuck.atkins at kitware.com>
CommitDate: Tue Jan 5 11:46:49 2016 -0500

    find_*: Add variables to enable NO_XXX_PATH defaults to find commands

diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
index bd4d295..7078c8c 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -56,8 +56,9 @@ Options include:
 ``DOC``
   Specify the documentation string for the ``<VAR>`` cache entry.
 
-If ``NO_DEFAULT_PATH`` is specified, then no additional paths are
-added to the search.
+If ``NO_DEFAULT_PATH`` is specified or if
+:variable:`CMAKE_FIND_NO_DEFAULT_PATH` is set and contains ``ALL`` or
+|CMAKE_PATH_NAME|, then no additional paths are added to the search.
 If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
 
 .. |CMAKE_PREFIX_PATH_XXX_SUBDIR| replace::
@@ -73,7 +74,9 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
 
 1. Search paths specified in cmake-specific cache variables.
    These are intended to be used on the command line with a ``-DVAR=value``.
-   This can be skipped if ``NO_CMAKE_PATH`` is passed.
+   This can be skipped if ``NO_CMAKE_PATH`` is passed or if
+   :variable:`CMAKE_FIND_NO_CMAKE_PATH` is set and contains ``ALL`` or
+   |CMAKE_PATH_NAME|.
 
    * |CMAKE_PREFIX_PATH_XXX|
    * |CMAKE_XXX_PATH|
@@ -81,7 +84,9 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
 
 2. Search paths specified in cmake-specific environment variables.
    These are intended to be set in the user's shell configuration.
-   This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed.
+   This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or if
+   :variable:`CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH` is set and contains
+   ``ALL`` or |CMAKE_PATH_NAME|.
 
    * |CMAKE_PREFIX_PATH_XXX|
    * |CMAKE_XXX_PATH|
@@ -93,13 +98,16 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
    Hard-coded guesses should be specified with the ``PATHS`` option.
 
 4. Search the standard system environment variables.
-   This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is an argument.
+   This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is an argument or if
+   :variable:`CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH` is set and contains
+   ``ALL`` or |CMAKE_PATH_NAME|
 
    * |SYSTEM_ENVIRONMENT_PATH_XXX|
 
 5. Search cmake variables defined in the Platform files
    for the current system.  This can be skipped if ``NO_CMAKE_SYSTEM_PATH``
-   is passed.
+   is passed  or if :variable:`CMAKE_FIND_NO_CMAKE_SYSTEM_PATH` is set and
+   contains ``ALL`` or |CMAKE_PATH_NAME|.
 
    * |CMAKE_SYSTEM_PREFIX_PATH_XXX|
    * |CMAKE_SYSTEM_XXX_PATH|
diff --git a/Help/command/find_file.rst b/Help/command/find_file.rst
index bf7a919..45fc84e 100644
--- a/Help/command/find_file.rst
+++ b/Help/command/find_file.rst
@@ -30,4 +30,5 @@ find_file
 .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
    :variable:`CMAKE_FIND_ROOT_PATH_MODE_INCLUDE`
 
+.. |CMAKE_PATH_NAME| replace:: ``INCLUDE``
 .. include:: FIND_XXX.txt
diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst
index 5d07574..de7f98a 100644
--- a/Help/command/find_library.rst
+++ b/Help/command/find_library.rst
@@ -30,6 +30,7 @@ find_library
 .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
    :variable:`CMAKE_FIND_ROOT_PATH_MODE_LIBRARY`
 
+.. |CMAKE_PATH_NAME| replace:: ``LIBRARY``
 .. include:: FIND_XXX.txt
 
 When more than one value is given to the ``NAMES`` option this command by
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index 58dff9d..6d72879 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -238,7 +238,9 @@ enabled.
 
 1. Search paths specified in cmake-specific cache variables.  These
    are intended to be used on the command line with a ``-DVAR=value``.
-   This can be skipped if ``NO_CMAKE_PATH`` is passed::
+   This can be skipped if ``NO_CMAKE_PATH`` is passed or if
+   :variable:`CMAKE_FIND_NO_CMAKE_PATH` is set and contains ``ALL`` or
+   ``PACKAGE``::
 
      CMAKE_PREFIX_PATH
      CMAKE_FRAMEWORK_PATH
@@ -246,7 +248,9 @@ enabled.
 
 2. Search paths specified in cmake-specific environment variables.
    These are intended to be set in the user's shell configuration.
-   This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed::
+   This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or
+   :variable:`CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH` is set and contains
+   ``ALL`` or ``PACKAGE``::
 
      <package>_DIR
      CMAKE_PREFIX_PATH
@@ -259,9 +263,10 @@ enabled.
    be specified with the ``PATHS`` option.
 
 4. Search the standard system environment variables.  This can be
-   skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed.  Path entries
-   ending in ``/bin`` or ``/sbin`` are automatically converted to their
-   parent directories::
+   skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed or
+   :variable:`CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH` is set and contains
+   ``ALL`` or ``PACKAGE``.  Path entries ending in ``/bin`` or ``/sbin``
+   are automatically converted to their parent directories::
 
      PATH
 
diff --git a/Help/command/find_path.rst b/Help/command/find_path.rst
index 4403cb5..748c754 100644
--- a/Help/command/find_path.rst
+++ b/Help/command/find_path.rst
@@ -30,6 +30,7 @@ find_path
 .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
    :variable:`CMAKE_FIND_ROOT_PATH_MODE_INCLUDE`
 
+.. |CMAKE_PATH_NAME| replace:: ``INCLUDE``
 .. include:: FIND_XXX.txt
 
 When searching for frameworks, if the file is specified as ``A/b.h``, then
diff --git a/Help/command/find_program.rst b/Help/command/find_program.rst
index d3430c0..d6c954a 100644
--- a/Help/command/find_program.rst
+++ b/Help/command/find_program.rst
@@ -25,6 +25,7 @@ find_program
 .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
    :variable:`CMAKE_FIND_ROOT_PATH_MODE_PROGRAM`
 
+.. |CMAKE_PATH_NAME| replace:: ``PROGRAM``
 .. include:: FIND_XXX.txt
 
 When more than one value is given to the ``NAMES`` option this command by
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 3f49572..ac8701b 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -124,7 +124,12 @@ Variables that Change Behavior
    /variable/CMAKE_FIND_FRAMEWORK
    /variable/CMAKE_FIND_LIBRARY_PREFIXES
    /variable/CMAKE_FIND_LIBRARY_SUFFIXES
+   /variable/CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH
+   /variable/CMAKE_FIND_NO_CMAKE_PATH
+   /variable/CMAKE_FIND_NO_CMAKE_SYSTEM_PATH
+   /variable/CMAKE_FIND_NO_DEFAULT_PATH
    /variable/CMAKE_FIND_NO_INSTALL_PREFIX
+   /variable/CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH
    /variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
    /variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
    /variable/CMAKE_FIND_PACKAGE_WARN_NO_MODULE
diff --git a/Help/variable/CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH.rst
new file mode 100644
index 0000000..ee761aa
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH.rst
@@ -0,0 +1,10 @@
+CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH
+------------------------------------
+
+.. |NO_XXX_PATH| replace:: NO_CMAKE_ENVIRONMENT_PATH
+.. include:: CMAKE_FIND_NO_XXX_PATH.txt
+
+See also :variable:`CMAKE_FIND_NO_DEFAULT_PATH`,
+:variable:`CMAKE_FIND_NO_CMAKE_PATH`,
+:variable:`CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH`, and
+:variable:`CMAKE_FIND_NO_CMAKE_SYSTEM_PATH`.
diff --git a/Help/variable/CMAKE_FIND_NO_CMAKE_PATH.rst b/Help/variable/CMAKE_FIND_NO_CMAKE_PATH.rst
new file mode 100644
index 0000000..0ac6666
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_NO_CMAKE_PATH.rst
@@ -0,0 +1,10 @@
+CMAKE_FIND_NO_CMAKE_PATH
+------------------------
+
+.. |NO_XXX_PATH| replace:: NO_CMAKE_PATH
+.. include:: CMAKE_FIND_NO_XXX_PATH.txt
+
+See also :variable:`CMAKE_FIND_NO_DEFAULT_PATH`,
+:variable:`CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH`,
+:variable:`CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH`, and
+:variable:`CMAKE_FIND_NO_CMAKE_SYSTEM_PATH`.
diff --git a/Help/variable/CMAKE_FIND_NO_CMAKE_SYSTEM_PATH.rst b/Help/variable/CMAKE_FIND_NO_CMAKE_SYSTEM_PATH.rst
new file mode 100644
index 0000000..827ef79
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_NO_CMAKE_SYSTEM_PATH.rst
@@ -0,0 +1,10 @@
+CMAKE_FIND_NO_CMAKE_SYSTEM_PATH
+-------------------------------
+
+.. |NO_XXX_PATH| replace:: NO_CMAKE_SYSTEM_PATH
+.. include:: CMAKE_FIND_NO_XXX_PATH.txt
+
+See also :variable:`CMAKE_FIND_NO_DEFAULT_PATH`,
+:variable:`CMAKE_FIND_NO_CMAKE_PATH`,
+:variable:`CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH`, and
+:variable:`CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH`.
diff --git a/Help/variable/CMAKE_FIND_NO_DEFAULT_PATH.rst b/Help/variable/CMAKE_FIND_NO_DEFAULT_PATH.rst
new file mode 100644
index 0000000..37e8369
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_NO_DEFAULT_PATH.rst
@@ -0,0 +1,10 @@
+CMAKE_FIND_NO_DEFAULT_PATH
+--------------------------
+
+.. |NO_XXX_PATH| replace:: NO_DEFAULT_PATH
+.. include:: CMAKE_FIND_NO_XXX_PATH.txt
+
+See also :variable:`CMAKE_FIND_NO_CMAKE_PATH`,
+:variable:`CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH`,
+:variable:`CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH`, and
+:variable:`CMAKE_FIND_NO_CMAKE_SYSTEM_PATH`.
diff --git a/Help/variable/CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH.rst b/Help/variable/CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH.rst
new file mode 100644
index 0000000..977083e
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH.rst
@@ -0,0 +1,10 @@
+CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH
+-------------------------------------
+
+.. |NO_XXX_PATH| replace:: NO_SYSTEM_ENVIRONMENT_PATH
+.. include:: CMAKE_FIND_NO_XXX_PATH.txt
+
+See also :variable:`CMAKE_FIND_NO_DEFAULT_PATH`,
+:variable:`CMAKE_FIND_NO_CMAKE_PATH`,
+:variable:`CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH`, and
+:variable:`CMAKE_FIND_NO_CMAKE_SYSTEM_PATH`.
diff --git a/Help/variable/CMAKE_FIND_NO_XXX_PATH.txt b/Help/variable/CMAKE_FIND_NO_XXX_PATH.txt
new file mode 100644
index 0000000..ca9ad26
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_NO_XXX_PATH.txt
@@ -0,0 +1,21 @@
+This variable enables the |NO_XXX_PATH| option to be on by default for the
+various find commands.  It's value is a list with valid entries being:
+
+``INCLUDE``
+ Enable the option for the :command:`find_file` and :command:`find_path`
+ commands.
+
+``LIBRARY``
+ Enable the option for the :command:`find_library` command.
+
+``PACKAGE``
+ Enable the option for the :command:`find_package` command.
+
+``PROGRAM``
+ Enable the option for the :command:`find_program` command.
+
+``ALL``
+ Enable the option for all find commands.
+
+The list can contain any combination of valid entries in any order to affect
+the specified find command.
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 913985f..ee94869 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -57,6 +57,25 @@ cmFindCommon::~cmFindCommon()
 }
 
 //----------------------------------------------------------------------------
+inline bool ListContains2Helper(const cmMakefile* make,
+  const std::string& cmakeVar, const std::string& test1,
+  const std::string& test2)
+{
+  std::vector<std::string> v;
+  cmSystemTools::ExpandListArgument(
+    make->GetSafeDefinition(cmakeVar), v, true);
+  for(std::vector<std::string>::const_iterator i = v.begin();
+    i != v.end(); ++i)
+    {
+    if(*i == test1 || *i == test2)
+      {
+      return true;
+      }
+    }
+  return false;
+}
+
+//----------------------------------------------------------------------------
 void cmFindCommon::InitializeSearchPathGroups()
 {
   std::vector<PathLabel>* labels;
@@ -88,6 +107,18 @@ void cmFindCommon::InitializeSearchPathGroups()
     cmSearchPath(this)));
   this->LabeledPaths.insert(std::make_pair(PathLabel::Guess,
     cmSearchPath(this)));
+
+  // Initialize global path options
+  this->NoDefaultPath = ListContains2Helper(this->Makefile,
+    "CMAKE_FIND_NO_DEFAULT_PATH", "ALL", this->CMakePathName);
+  this->NoCMakeEnvironmentPath = ListContains2Helper(this->Makefile,
+    "CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH", "ALL", this->CMakePathName);
+  this->NoCMakePath = ListContains2Helper(this->Makefile,
+    "CMAKE_FIND_NO_CMAKE_PATH", "ALL", this->CMakePathName);
+  this->NoSystemEnvironmentPath = ListContains2Helper(this->Makefile,
+    "CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH", "ALL", this->CMakePathName);
+  this->NoCMakeSystemPath = ListContains2Helper(this->Makefile,
+    "CMAKE_FIND_NO_CMAKE_SYSTEM_PATH", "ALL", this->CMakePathName);
 }
 
 //----------------------------------------------------------------------------

-----------------------------------------------------------------------

Summary of changes:
 Help/command/FIND_XXX.txt                          |   20 +++++++++----
 Help/command/find_file.rst                         |    1 +
 Help/command/find_library.rst                      |    1 +
 Help/command/find_package.rst                      |   15 ++++++----
 Help/command/find_path.rst                         |    1 +
 Help/command/find_program.rst                      |    1 +
 Help/manual/cmake-variables.7.rst                  |    5 ++++
 .../CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH.rst       |   10 +++++++
 Help/variable/CMAKE_FIND_NO_CMAKE_PATH.rst         |   10 +++++++
 Help/variable/CMAKE_FIND_NO_CMAKE_SYSTEM_PATH.rst  |   10 +++++++
 Help/variable/CMAKE_FIND_NO_DEFAULT_PATH.rst       |   10 +++++++
 .../CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH.rst      |   10 +++++++
 Help/variable/CMAKE_FIND_NO_XXX_PATH.txt           |   21 +++++++++++++
 Source/cmFindCommon.cxx                            |   31 ++++++++++++++++++++
 14 files changed, 135 insertions(+), 11 deletions(-)
 create mode 100644 Help/variable/CMAKE_FIND_NO_CMAKE_ENVIRONMENT_PATH.rst
 create mode 100644 Help/variable/CMAKE_FIND_NO_CMAKE_PATH.rst
 create mode 100644 Help/variable/CMAKE_FIND_NO_CMAKE_SYSTEM_PATH.rst
 create mode 100644 Help/variable/CMAKE_FIND_NO_DEFAULT_PATH.rst
 create mode 100644 Help/variable/CMAKE_FIND_NO_SYSTEM_ENVIRONMENT_PATH.rst
 create mode 100644 Help/variable/CMAKE_FIND_NO_XXX_PATH.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list