mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 04:40:56 -06:00
MSYS2 and similar MinGW/MSYS distributions define development
environments with a `MSYSTEM` environment variable. Each such
environment has a documented installation prefix for its packages,
often provided by a `MSYSTEM_PREFIX` environment variable.
Since commit 84a25fc263 (cmake_host_system_information: Add
MSYSTEM_PREFIX query, 2023-09-08) we can look up this prefix.
Add `$MSYSTEM_PREFIX/local` and `$MSYSTEM_PREFIX` to our system search
prefixes when targeting MinGW under `MSYSTEM` environments. This is
their equivalent to `/usr/local` and `/usr`, which we search by default
on UNIX systems.
Issue: #24216
61 lines
2.2 KiB
ReStructuredText
61 lines
2.2 KiB
ReStructuredText
CMAKE_SYSTEM_PREFIX_PATH
|
|
------------------------
|
|
|
|
:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying installation
|
|
*prefixes* to be searched by the :command:`find_package`,
|
|
:command:`find_program`, :command:`find_library`, :command:`find_file`, and
|
|
:command:`find_path` commands. Each command will add appropriate
|
|
subdirectories (like ``bin``, ``lib``, or ``include``) as specified in its own
|
|
documentation.
|
|
|
|
By default this contains the system directories for the current system, the
|
|
:variable:`CMAKE_INSTALL_PREFIX`, and the :variable:`CMAKE_STAGING_PREFIX`.
|
|
The installation and staging prefixes may be excluded by setting
|
|
the :variable:`CMAKE_FIND_NO_INSTALL_PREFIX` variable before the
|
|
first :command:`project` invocation.
|
|
|
|
The system directories that are contained in ``CMAKE_SYSTEM_PREFIX_PATH`` are
|
|
locations that typically include installed software. An example being
|
|
``/usr/local`` for UNIX based platforms. In addition to standard platform
|
|
locations, CMake will also add values to ``CMAKE_SYSTEM_PREFIX_PATH`` based on
|
|
environment variables. The environment variables and search locations that
|
|
CMake uses may evolve over time, as platforms and their conventions also
|
|
evolve. The following provides an indicative list of environment variables
|
|
and locations that CMake searches, but they are subject to change:
|
|
|
|
|
|
CrayLinuxEnvironment:
|
|
* ``ENV{SYSROOT_DIR}/``
|
|
* ``ENV{SYSROOT_DIR}/usr``
|
|
* ``ENV{SYSROOT_DIR}/usr/local``
|
|
|
|
Darwin:
|
|
* ``ENV{SDKROOT}/usr`` When ``CMAKE_OSX_SYSROOT`` is not explicitly specified.
|
|
|
|
OpenBSD:
|
|
* ``ENV{LOCALBASE}``
|
|
|
|
Unix:
|
|
* ``ENV{CONDA_PREFIX}`` when using a conda compiler
|
|
|
|
MSYSTEM environment with MinGW toolchain:
|
|
.. versionadded:: 3.28
|
|
|
|
* ``ENV{MSYSTEM_PREFIX}/local``
|
|
* ``ENV{MSYSTEM_PREFIX}``
|
|
|
|
Windows:
|
|
* ``ENV{ProgramW6432}``
|
|
* ``ENV{ProgramFiles}``
|
|
* ``ENV{ProgramFiles(x86)}``
|
|
* ``ENV{SystemDrive}/Program Files``
|
|
* ``ENV{SystemDrive}/Program Files (x86)``
|
|
|
|
|
|
``CMAKE_SYSTEM_PREFIX_PATH`` is *not* intended to be modified by the project;
|
|
use :variable:`CMAKE_PREFIX_PATH` for this.
|
|
|
|
See also :variable:`CMAKE_SYSTEM_INCLUDE_PATH`,
|
|
:variable:`CMAKE_SYSTEM_LIBRARY_PATH`, :variable:`CMAKE_SYSTEM_PROGRAM_PATH`,
|
|
and :variable:`CMAKE_SYSTEM_IGNORE_PATH`.
|