mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-06 15:19: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
6 lines
254 B
CMake
6 lines
254 B
CMake
set(ENV{MSYSTEM} "FAKEMSYS")
|
|
set(ENV{MSYSTEM_PREFIX} "${CMAKE_CURRENT_LIST_DIR}/MSYSTEM_PREFIX")
|
|
enable_language(C)
|
|
find_path(MSYSTEM_PREFIX_INCLUDE_DIR NAMES msystem_prefix.h)
|
|
message(STATUS "MSYSTEM_PREFIX_INCLUDE_DIR='${MSYSTEM_PREFIX_INCLUDE_DIR}'")
|