[Cmake-commits] CMake branch, next, updated. v3.5.2-1299-g4e2aa86
Brad King
brad.king at kitware.com
Mon May 9 10:25:13 EDT 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 4e2aa8656d6e1c0ea79767174476cbdcaefbb93b (commit)
via 5c7e8c3d8332729b151c11c53275046b0363b84e (commit)
from d1ea20a5782ac72f5d4616360d73e51cf3958dd2 (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=4e2aa8656d6e1c0ea79767174476cbdcaefbb93b
commit 4e2aa8656d6e1c0ea79767174476cbdcaefbb93b
Merge: d1ea20a 5c7e8c3
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon May 9 10:25:12 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon May 9 10:25:12 2016 -0400
Merge topic 'find-command-prefix-from-PATH-windows-only' into next
5c7e8c3d Drop find_(library|file|path) prefixes from PATH on non-Windows
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c7e8c3d8332729b151c11c53275046b0363b84e
commit 5c7e8c3d8332729b151c11c53275046b0363b84e
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon May 9 10:06:22 2016 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon May 9 10:21:42 2016 -0400
Drop find_(library|file|path) prefixes from PATH on non-Windows
Since commit v3.3.0-rc1~430^2 (Teach find_(library|file|path) to get
prefixes from PATH, 2015-02-18) we search in <prefix>/include and
<prefix>/lib directories for prefixes with bin directories in the PATH
environment variable. The motivation was to support MSYS, MinGW and
similar Windows platforms in their default environments automatically.
At the time this behavior was thought to be worthwhile in general.
Suggested-by: Chuck Atkins <chuck.atkins at kitware.com>
diff --git a/Help/command/find_file.rst b/Help/command/find_file.rst
index bf7a919..e56097b 100644
--- a/Help/command/find_file.rst
+++ b/Help/command/find_file.rst
@@ -14,7 +14,8 @@ find_file
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH`
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH`
-.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``INCLUDE``,
+.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``INCLUDE``.
+ On Windows hosts:
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, and the
directories in ``PATH`` itself.
diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst
index 5d07574..31e6ec0 100644
--- a/Help/command/find_library.rst
+++ b/Help/command/find_library.rst
@@ -14,7 +14,8 @@ find_library
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_LIBRARY_PATH`
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH`
-.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``LIB``,
+.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``LIB``.
+ On Windows hosts:
``<prefix>/lib/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set,
and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|,
and the directories in ``PATH`` itself.
diff --git a/Help/command/find_path.rst b/Help/command/find_path.rst
index 4403cb5..76342d0 100644
--- a/Help/command/find_path.rst
+++ b/Help/command/find_path.rst
@@ -14,7 +14,8 @@ find_path
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH`
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_PATH`
-.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``INCLUDE``,
+.. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in ``INCLUDE``.
+ On Windows hosts:
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, and the
directories in ``PATH`` itself.
diff --git a/Help/release/dev/find-command-prefix-from-PATH-windows-only.rst b/Help/release/dev/find-command-prefix-from-PATH-windows-only.rst
new file mode 100644
index 0000000..be6eb3e
--- /dev/null
+++ b/Help/release/dev/find-command-prefix-from-PATH-windows-only.rst
@@ -0,0 +1,12 @@
+find-command-prefix-from-PATH-windows-only
+------------------------------------------
+
+* The :command:`find_library`, :command:`find_path`, and :command:`find_file`
+ commands no longer search in installation prefixes derived from the ``PATH``
+ environment variable on non-Windows platforms. This behavior was added in
+ CMake 3.3 to support Windows hosts but has proven problematic on UNIX hosts.
+ Users that keep some ``<prefix>/bin`` directories in the ``PATH`` just for
+ their tools do not necessarily want any supporting ``<prefix>/lib``
+ directories searched. One may set the ``CMAKE_PREFIX_PATH`` environment
+ variable with a :ref:`;-list <CMake Language Lists>` of prefixes that are
+ to be searched.
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index 90091c1..995097f 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -276,10 +276,16 @@ void cmFindBase::FillSystemEnvironmentPath()
if(!this->EnvironmentPath.empty())
{
paths.AddEnvPath(this->EnvironmentPath);
+#if defined(_WIN32) || defined(__CYGWIN__)
paths.AddEnvPrefixPath("PATH", true);
+ paths.AddEnvPath("PATH");
+#endif
+ }
+ else
+ {
+ // Add PATH
+ paths.AddEnvPath("PATH");
}
- // Add PATH
- paths.AddEnvPath("PATH");
paths.AddSuffixes(this->SearchPathSuffixes);
}
diff --git a/Tests/RunCMake/find_file/RunCMakeTest.cmake b/Tests/RunCMake/find_file/RunCMakeTest.cmake
index 014f397..5ce96e0 100644
--- a/Tests/RunCMake/find_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_file/RunCMakeTest.cmake
@@ -1,3 +1,5 @@
include(RunCMake)
-run_cmake(PrefixInPATH)
+if(WIN32 OR CYGWIN)
+ run_cmake(PrefixInPATH)
+endif()
diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake
index 136031c..5733965 100644
--- a/Tests/RunCMake/find_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake
@@ -1,4 +1,6 @@
include(RunCMake)
run_cmake(Created)
-run_cmake(PrefixInPATH)
+if(WIN32 OR CYGWIN)
+ run_cmake(PrefixInPATH)
+endif()
diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake
index 014f397..5ce96e0 100644
--- a/Tests/RunCMake/find_path/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake
@@ -1,3 +1,5 @@
include(RunCMake)
-run_cmake(PrefixInPATH)
+if(WIN32 OR CYGWIN)
+ run_cmake(PrefixInPATH)
+endif()
-----------------------------------------------------------------------
Summary of changes:
Help/command/find_file.rst | 3 ++-
Help/command/find_library.rst | 3 ++-
Help/command/find_path.rst | 3 ++-
.../dev/find-command-prefix-from-PATH-windows-only.rst | 12 ++++++++++++
Source/cmFindBase.cxx | 10 ++++++++--
Tests/RunCMake/find_file/RunCMakeTest.cmake | 4 +++-
Tests/RunCMake/find_library/RunCMakeTest.cmake | 4 +++-
Tests/RunCMake/find_path/RunCMakeTest.cmake | 4 +++-
8 files changed, 35 insertions(+), 8 deletions(-)
create mode 100644 Help/release/dev/find-command-prefix-from-PATH-windows-only.rst
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list