CMake detects libraries that the compiler driver implicitly passes to
the linker, and stores them in `CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES`
for use in constructing mixed-language link lines. Some compiler driver
flags add implicitly linked libraries that should not be used during
mixed-language linking because they are handled by similar flags passed
to the other language's compiler driver. Add an environment variable
that users can set to avoid undesired implicit link libraries in such
scenarios.
Follow the pattern from commit 023de565d3 (Optionally exclude implicit
link directories via environment, 2023-05-25, v3.27.0-rc1~54^2).
Fixes: #26911
bf1bb62e74 macOS: Restore support for LLVM/Clang without explicit CMAKE_OSX_SYSROOT
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10734
In commit 7b19531291 (macOS: Do not pass any SDK/-isysroot to compilers
by default, 2024-11-06, v4.0.0-rc1~511^2) we broke support for using
upstream LLVM/Clang to build for macOS because the compiler has no
default sysroot. Handle empty `CMAKE_OSX_SYSROOT` with LLVM/Clang by
falling back to the macOS SDK reported by `xcrun --show-sdk-path` .
Fixes: #26863
FindMFC:
- Synced module documentation with other similar find modules.
- Added examples section.
- Added reference link to CMAKE_MFC_FLAG variable.
CMAKE_MFC_FLAG:
- Added separate examples section.
- Mentioned FindMFC module.
- Used target_compile_definitions() instead of add_definitions().
a9ea55f0d7 Fix CMAKE_PARENT_LIST_FILE after return from include() or find_package()
41708398eb cmMakefile: Factor out base class for list file scope RAII
ce8be3da80 cmMakefile: De-duplicate CMAKE_CURRENT_LIST_FILE variable names
0b85f8f137 Tests: Add cases for CMAKE_PARENT_LIST_FILE with include() and find_package()
002979e145 Tests/RunCMake/include: Match incidental line numbers more robustly
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10505
In commit 7b19531291 (macOS: Do not pass any SDK/-isysroot to compilers
by default, 2024-11-06, v4.0.0-rc1~511^2) we forgot to update the
documentation of `CMAKE_OSX_SYSROOT`.
Fixes: #26846
In commit 84996a65aa (Unity: Add option to use relative paths for unity
files, 2024-10-15, v4.0.0-rc1~637^2) we added support for this variable
to initialize the `UNITY_BUILD_RELOCATABLE` target property, but forgot
to document it.
Issue: #26352
The `CMAKE_COMPILER_IS_*` variables have been documented as deprecated
since CMake 3.24, without emitting warnings. This commit updates their
documentation to help users safely migrate to `CMAKE_<LANG>_COMPILER_ID`
variables. Also a RST deprecation directive is added to clarify their
status.
7f0f382c55 Provide CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID on more compilers
019f0f8b32 ARCHITECTURE_ID: Save persistently even if empty
8e46672b29 Fortran: Detect pointer size on sparc architectures
eddf66eaef CMakeDetermineASMCompiler: De-duplicate list of compiler info variables
c0224f5aa1 CMakeDetermineCompilerABI: Make ABI info string more robust
67ab580804 Windows/Clang: Fix indentation in platform information module
1c9f8eeb4f Help: Document CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10516
Provide it whenever we can detect a target architecture from the
compiler during compiler inspection. In order to avoid changing
existing IDs, do this only for compilers where we don't already
detect a target architecture during compiler identification.
Fixes: #17702
- QNX C/C++ compiler is identified in `CMAKE_<LANG>_COMPILER_ID` as
value "QCC". The qcc/q++ are frontend compiler commands that invoke
the GNU compiler (gcc/g++) as a backend compiler, but it's treated as
a separate compiler with its own ID for better determination.
- The C/C++ compiler on UnixWare/OpenServer is identified in
`CMAKE_<LANG>_COMPILER_ID` as value "SCO", (compiler that defines the
`__SCO_VERSION__` preprocessor macro).
This adds a `CMAKE_FIND_REQUIRED` variable which causes `find_package`,
`find_path`, `find_file`, `find_library` and `find_program` to be
considered `REQUIRED` by default.
It also introduces an `OPTIONAL` keyword to those commands, allowing
them to ignore the value of this variable.
Issue: #26576
Extend commit 1a35351125 (Add CMAKE_POLICY_VERSION_MINIMUM to help
configure outdated projects, 2025-02-13, v4.0.0-rc1~12^2) with an
environment variable to initialize the cache entry. That will make it
easier to use when `cmake` is invoked under layers of scripting.
Closes: #26715
Provide packagers and end users with a way to try configuring projects that
have not been updated to set their policy version to a supported level.
Closes: #26698
This allows projects to use `if(AIX)` blocks instead of spelling
out `if(CMAKE_SYSTEM_NAME STREQUAL "AIX")`. We already have similar
variables for many other platforms.
Run the script:
Utilities/Sphinx/update_versions.py --since v3.31.0 --overwrite
Manually renumber `3.32` to `4.0` since the script is meant for
minor version increments. Also filter out changes to documents
that were added for long-existing variables.