summaryrefslogtreecommitdiffstats
path: root/Source/cmFindBase.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-09 14:06:22 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-09 16:58:08 (GMT)
commitb30b32a4931080280680aa5b439c0d4918553c56 (patch)
tree15bee4c60f6311fd73d60a0e98a90bcd89a17ffc /Source/cmFindBase.cxx
parent3ecdddfc35a0f0ecc1495d902f34d9cee2d59459 (diff)
downloadCMake-b30b32a4931080280680aa5b439c0d4918553c56.zip
CMake-b30b32a4931080280680aa5b439c0d4918553c56.tar.gz
CMake-b30b32a4931080280680aa5b439c0d4918553c56.tar.bz2
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@kitware.com>
Diffstat (limited to 'Source/cmFindBase.cxx')
-rw-r--r--Source/cmFindBase.cxx10
1 files changed, 8 insertions, 2 deletions
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);
}