Commit Graph

1300 Commits

Author SHA1 Message Date
Brad King
9062fc9c16 Merge topic 'install-object-name-strategy'
c651b0e002 objects: implement installation naming strategies
29c7f19280 cmTarget: add the `INSTALL_OBJECT_NAME_STRATEGY` property
757c40c478 cmObjectLocation: add a class to track object locations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11046
2025-08-18 09:45:19 -04:00
Craig Scott
6592d66030 Help: Prevent section headings being used for <ORIGIN>_autogen xrefs
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.
2025-08-15 19:02:16 +10:00
Peter Kokot
8aacf67b54 CMAKE_LANG_USING_LINKER_MODE: Fix typo and update docs
- s/FLAGS/FLAG
- Moved deprecation notice to top.
- Added "See Also" section to the CMAKE_LANG_LINK_MODE variable.
2025-08-11 03:48:26 +02:00
Brad King
c037d3038b Merge topic 'patch-22360-position-independent-code'
6168592f0e Help: Improve position independent code docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11035
2025-08-08 08:20:47 -04:00
Ben Boeckel
29c7f19280 cmTarget: add the INSTALL_OBJECT_NAME_STRATEGY property 2025-08-07 11:24:32 -04:00
Verney7
cfbf0480ff Sunway: Add sw_64 support
``sw_64`` is a new RISC ISA, which is a bit like RISC-V.
2025-08-07 09:42:11 -04:00
Peter Kokot
6168592f0e Help: Improve position independent code docs
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
2025-08-06 02:27:55 +02:00
Peter Kokot
a5d67cf610 CMAKE_SYSTEM_NAME: Add initial list of removed platforms
Issue: #26496
2025-08-05 23:59:43 +02:00
Ben Boeckel
8180ecad9b autogen: support the SHORT intermediate dir strategy 2025-07-29 09:44:03 -04:00
John Parent
392543384f cmake: support setting the intermediate dir strategy from the environment 2025-07-28 12:01:28 -04:00
Peter Kokot
0622cb343e AIX: Drop unnecessary -l from CMAKE_DL_LIBS
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.
2025-07-21 11:34:03 -04:00
Brad King
816e235609 Merge topic 'patch-TestBigEndian'
59da6d9e5c TestBigEndian, CMAKE_<LANG>_BYTE_ORDER: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10950
2025-07-21 10:24:09 -04:00
Peter Kokot
934567de19 CMAKE_DL_LIBS: Update documentation 2025-07-18 22:39:18 +02:00
Peter Kokot
59da6d9e5c TestBigEndian, CMAKE_<LANG>_BYTE_ORDER: Update documentation
- 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.
2025-07-16 14:55:48 +02:00
Benjamin Buch
41aea12941 Do not define CMAKE_PARENT_LIST_FILE in CMakeLists.txt
Add policy `CMP0198` for compatibility.

Issue: #25026
2025-07-15 11:51:45 -04:00
Brad King
3faa92ec71 Merge topic 'doc_undefined_mods'
46279eff38 Help: Document cases of variables modification having undefined behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10903
2025-06-26 09:09:38 -04:00
Dan Raviv
46279eff38 Help: Document cases of variables modification having undefined behavior 2025-06-24 08:47:41 -07:00
Matthew Woehlke
fba540daf6 project: Add SPDX_LICENSE argument
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.
2025-06-20 14:01:25 -04:00
Moritz Haase
61d8fae116 find_package: Use deterministic search order by default
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.
2025-06-18 06:34:59 +02:00
Brad King
50bd58c352 Merge topic 'doc-generator-xrefs'
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
2025-06-17 09:10:23 -04:00
Ben Boeckel
b634998727 Help: add and make references to generators consistent 2025-06-12 21:25:24 +02:00
Matthew Woehlke
1105932871 Help: Fix CMAKE_PROJECT_COMPAT_VERSION documentation
Fix a minor error in the explanatory example in the documentation of the
CMAKE_PROJECT_COMPAT_VERSION property.
2025-06-12 14:08:18 -04:00
Brad King
7dba72f9d1 Merge topic 'suppress-implicit-find-events'
c42d82d569 find_*: support suppressing implicit transition events
64f429cc4f Help/dev: add release note for implicit configure log find events
4cd83339f1 cmFindCommon: fix comment after renaming the `FullDebugMode` member

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10874
2025-06-12 09:49:16 -04:00
Ben Boeckel
c42d82d569 find_*: support suppressing implicit transition events
When projects explicitly unset variables, the transition detection can
end up reporting events when they are not desired.

See: #24833
2025-06-11 20:09:32 +02:00
Matthew Woehlke
a0cfaaf2dc Help: Note when <project>_COMPAT_VERSION were added
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).
2025-06-11 11:08:28 -04:00
Maximilian Sander
cdf2a36f48 HIP: Add support for [CMAKE_]HIP_LINKER_LAUNCHER
`CMAKE_<LANG>_LINKER_LAUNCHER` and `<LANG>_LINKER_LAUNCHER` are
already support for C, CXX, CUDA, OBJC, OBJCXX, and Fortran.  Add HIP.

Closes: #26967
2025-05-30 10:05:46 -04:00
Maximilian Sander
77312cc636 CUDA: Add support for [CMAKE_]CUDA_LINKER_LAUNCHER
`CMAKE_<LANG>_LINKER_LAUNCHER` and `<LANG>_LINKER_LAUNCHER` are
already support for C, CXX, OBJC, OBJCXX, and Fortran.  Add CUDA.

Issue: #26967
2025-05-30 10:00:18 -04:00
Brad King
a385cafc59 Merge topic 'renesas-compiler'
514135f563 Renesas: Add support for Renesas compilers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10669
2025-05-29 13:13:08 -04:00
Brad King
8b710d8264 Linker: Generate per-language module -DEF: flags on Windows
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
2025-05-28 13:48:26 -04:00
Hirofumi Nakamura
514135f563 Renesas: Add support for Renesas compilers
- CC-RX for RX architecture
- CC-RL for RL78 architecture
- CC-RH for RH850 architecture

Closes: #26880
2025-05-28 09:22:38 -04:00
Maximilian Sander
d176a8c5ce Fortran: Add support for [CMAKE_]Fortran_LINKER_LAUNCHER
`CMAKE_<LANG>_LINKER_LAUNCHER` and `<LANG>_LINKER_LAUNCHER` are
already support for C, CXX, OBJC, and OBJCXX.  Add Fortran.

Closes: #26951
2025-05-27 11:00:54 -04:00
Brad King
fc9e9d1196 Merge topic 'automoc-specific-include-dirs'
39677f4cc6 AUTOMOC: Add option to specify moc include directories explicitly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Osyotr <zhenchik35026@gmail.com>
Merge-request: !10640
2025-05-21 08:46:35 -04:00
Brad King
e711538aca Merge topic 'patch-CheckIPOSupported'
294b30b27e CheckIPOSupported: Extend documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10796
2025-05-20 09:00:16 -04:00
David Worley
39677f4cc6 AUTOMOC: Add option to specify moc include directories explicitly
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
2025-05-19 21:07:48 -04:00
Brad King
d27e0eff14 Help: Document when CMAKE_FIND_LIBRARY_{PREFIXES,SUFFIXES} are provided
Issue: #26943
2025-05-19 12:26:27 -04:00
Peter Kokot
294b30b27e CheckIPOSupported: Extend documentation
- 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.
2025-05-18 23:56:31 +02:00
Brad King
805a40b668 Optionally exclude implicit link libraries via environment
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
2025-05-05 12:12:44 -04:00
Brad King
67f86c7db8 Merge topic 'clang-macos-sdk'
bf1bb62e74 macOS: Restore support for LLVM/Clang without explicit CMAKE_OSX_SYSROOT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10734
2025-05-03 10:02:18 -04:00
Brad King
bf1bb62e74 macOS: Restore support for LLVM/Clang without explicit CMAKE_OSX_SYSROOT
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
2025-05-02 13:49:40 -04:00
Brad King
2cdcf68235 Merge topic 'patch-FindMFC'
bc9faec5e5 FindMFC, CMAKE_MFC_FLAG: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10720
2025-04-29 11:04:19 -04:00
Peter Kokot
bc9faec5e5 FindMFC, CMAKE_MFC_FLAG: Update documentation
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().
2025-04-28 02:36:29 +02:00
Vito Gamberini
0138df29dc project: add COMPAT_VERSION keyword
Fixes: #26893
2025-04-25 13:42:11 -04:00
Brad King
cb31aa3476 Merge topic 'doc-include-rst'
9784834b4c Help: Use `*.rst` extension for included files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10615
2025-04-15 09:42:51 -04:00
Brad King
ee24bb6a6f Merge topic 'cmake-parent-list-file'
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
2025-04-14 08:29:52 -04:00
Alex Turbov
9784834b4c Help: Use *.rst extension for included files
So, editor(s) can correctly highlight the RST syntax in the included files.
2025-04-14 03:07:46 +04:00
Benjamin Buch
a9ea55f0d7 Fix CMAKE_PARENT_LIST_FILE after return from include() or find_package()
Fix the implementation, clarify the documentation, and add tests.

Fixes: #25026
Co-authored-by: Brad King <brad.king@kitware.com>
2025-04-12 09:40:37 -04:00
Brad King
03ceeac1bd Merge topic 'doc-macos-usr-local'
c69add958a Help: Add note about /usr/local/include on macOS without CMAKE_OSX_SYSROOT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10636
2025-04-10 10:54:13 -04:00
Brad King
c69add958a Help: Add note about /usr/local/include on macOS without CMAKE_OSX_SYSROOT
Issue: #19180
2025-04-10 10:16:29 -04:00
Brad King
b309159930 Merge topic 'iar-add-icstat-support'
c7d2a17253 IAR: Add support for C-STAT static analysis

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10624
2025-04-10 08:40:28 -04:00
Felipe Torrezan
c7d2a17253 IAR: Add support for C-STAT static analysis
The IAR platform offers an integrated static analysis tool named
IAR C-STAT.

Closes: #26844
2025-04-09 12:01:02 -04:00