The references to the <ORIGIN>_autogen and
<ORIGIN>_autogen_timestamp_deps anchors were being replaced by the
section heading text that immediately followed the anchors. But in most
cases, the text where the cross-referencing was placed was expecting the
anchor text to be used instead. Add custom text for such cross-references
so that the text reads as originally intended.
This adds few adjustments for position independent code descriptions.
* CheckPIESupported:
The output of check_pie_supported() is already logged in details by
the try_compile event. To make the example a bit nicer to use in
projects the message(VERBOSE) is used instead of the WARNING. In case
of MSVC, there isn't anything to warn about as it isn't supported by
default.
Added intro code block showing how to include this module.
Synced descriptions.
Fixes: #22360
The `-lld` linker flag was added from the previous command-line script
that have all values in `CMAKE_DL_LIBS` prepended with `-l`.
On AIX, the `dlopen()` is otherwise in C library (default). But it seems
that also `libld` library was once needed on some versions to have
dynamic loading working.
Sync `CMAKE_DL_LIBS` value style with all other current usages.
- Fixed typo in the module description.
- Added examples section highlighting the code migration towards the
`CMAKE_<LANG>_BYTE_ORDER` variable.
- Documented command similar to other modules.
- Added examples for the `CMAKE_<LANG>_BYTE_ORDER` variable and
explained when endianness for different languages can be used.
Add an argument to the `project` command to allow specifying a license
for a project as a whole. This is in addition to specifying licenses on
individual targets, and will be used to set the license(s) on exported
packages.
Also, move listing of `COMPAT_VERSION` variables to follow
lexicographical order.
Historically, find_package() does not guarantee the order in which directories
matching a search path containing a glob expression are processed in - the
"first valid package" will be selected if there are multiple candidates. In such
cases, which package is chosen is completely random and can change, potentially
leading to build failures and reproducibility issues. This is rather unexpected
and confusing for developers.
Now that CMake has bumped its major version, it's a good time to change default
sort order and direction could be changed to natural sorting with a descending
order. That will result in the newest version of a library being picked in case
there are multiple ones available.
98837b42c3 Help: minor reference and markup fixes
b634998727 Help: add and make references to generators consistent
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10877
Tweak documentation of project `_COMPAT_VERSION` variables to note when
they were added. Note that, while these are "experimental" for now,
they are always set; the experimental gate is only required for them to
be set to non-empty values (and since they are optional, they may be
empty regardless).
With IntelLLVM on Windows, we link using the compiler driver.
With MSVC on Windows, we invoke the linker directly. If we
use both in a single build tree, for separate languages,
the value of `CMAKE_LINK_DEF_FILE_FLAG` conflicts. Add a
per-language `CMAKE_<LANG>_LINK_DEF_FILE_FLAG` variable to
avoid the conflict. Preserve the language-agnostic variable
for compatibility with projects that reference it.
Fixes: #26005
Add a `AUTOMOC_INCLUDE_DIRECTORIES` target property and a corresponding
`CMAKE_AUTOMOC_INCLUDE_DIRECTORIES` variable to initialize it.
This is useful for targets that do not need moc to search include
directories from all dependencies.
Closes: #26414
- Added intro code block showing how to include this module.
- Added brief description about IPO and LTO and how it is enabled in
CMake.
- Used "command" instead of "function".
- Reworded few descriptions.
- Synced indentation for items related to the command section.
- Added "See Also" sections to related target properties and variables.
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