Merge topic 'find-command-prefix-from-PATH-windows-only'
b30b32a4
Drop find_(library|file|path) prefixes from PATH on non-Windows
This commit is contained in:
commit
541d20dd9f
|
@ -14,7 +14,8 @@ find_file
|
||||||
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH`
|
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH`
|
||||||
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_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`
|
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
|
||||||
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, and the
|
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, and the
|
||||||
directories in ``PATH`` itself.
|
directories in ``PATH`` itself.
|
||||||
|
|
|
@ -14,7 +14,8 @@ find_library
|
||||||
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_LIBRARY_PATH`
|
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_LIBRARY_PATH`
|
||||||
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_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,
|
``<prefix>/lib/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE` is set,
|
||||||
and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|,
|
and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|,
|
||||||
and the directories in ``PATH`` itself.
|
and the directories in ``PATH`` itself.
|
||||||
|
|
|
@ -14,7 +14,8 @@ find_path
|
||||||
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH`
|
.. |CMAKE_XXX_PATH| replace:: :variable:`CMAKE_INCLUDE_PATH`
|
||||||
.. |CMAKE_XXX_MAC_PATH| replace:: :variable:`CMAKE_FRAMEWORK_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`
|
``<prefix>/include/<arch>`` if :variable:`CMAKE_LIBRARY_ARCHITECTURE`
|
||||||
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, and the
|
is set, and |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|, and the
|
||||||
directories in ``PATH`` itself.
|
directories in ``PATH`` itself.
|
||||||
|
|
|
@ -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.
|
|
@ -276,10 +276,16 @@ void cmFindBase::FillSystemEnvironmentPath()
|
||||||
if(!this->EnvironmentPath.empty())
|
if(!this->EnvironmentPath.empty())
|
||||||
{
|
{
|
||||||
paths.AddEnvPath(this->EnvironmentPath);
|
paths.AddEnvPath(this->EnvironmentPath);
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
paths.AddEnvPrefixPath("PATH", true);
|
paths.AddEnvPrefixPath("PATH", true);
|
||||||
|
paths.AddEnvPath("PATH");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Add PATH
|
||||||
|
paths.AddEnvPath("PATH");
|
||||||
}
|
}
|
||||||
// Add PATH
|
|
||||||
paths.AddEnvPath("PATH");
|
|
||||||
paths.AddSuffixes(this->SearchPathSuffixes);
|
paths.AddSuffixes(this->SearchPathSuffixes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
include(RunCMake)
|
include(RunCMake)
|
||||||
|
|
||||||
run_cmake(PrefixInPATH)
|
if(WIN32 OR CYGWIN)
|
||||||
|
run_cmake(PrefixInPATH)
|
||||||
|
endif()
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
include(RunCMake)
|
include(RunCMake)
|
||||||
|
|
||||||
run_cmake(Created)
|
run_cmake(Created)
|
||||||
run_cmake(PrefixInPATH)
|
if(WIN32 OR CYGWIN)
|
||||||
|
run_cmake(PrefixInPATH)
|
||||||
|
endif()
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
include(RunCMake)
|
include(RunCMake)
|
||||||
|
|
||||||
run_cmake(PrefixInPATH)
|
if(WIN32 OR CYGWIN)
|
||||||
|
run_cmake(PrefixInPATH)
|
||||||
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue