Commit Graph

3755 Commits

Author SHA1 Message Date
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
39da33ae81 CMakeDetermineVSServicePack: Add policy to remove this module
It has been documented as deprecated since CMake 3.0.
2025-05-28 09:47:06 -04:00
Brad King
bc9785a12b Merge topic 'linker-launcher'
d176a8c5ce Fortran: Add support for [CMAKE_]Fortran_LINKER_LAUNCHER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10831
2025-05-28 09:17:17 -04:00
Brad King
479f4f5e9a Merge topic 'patch-CheckIncludeFile'
b2e7736d81 CheckIncludeFile*: Sync documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10826
2025-05-28 08:55:44 -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
Peter Kokot
b2e7736d81 CheckIncludeFile*: Sync documentation
- Added intro code blocks showing how to include these modules.
- Used "command" instead of "macro".
- Mentioned policy CMP0075.
- Added additional example to CheckIncludeFile showing how to use
  CMAKE_REQUIRED_* variable.
2025-05-27 00:16:57 +02:00
Peter Kokot
e6f9ebbbe1 Check{,C,CXX,OBJC,OBJCXX,Fortran}SourceCompiles: Update documentation
Changes:

- Added intro code blocks showing how to include these modules.
- Added examples sections.
- Used "command" instead of "macro".
- Commands sections added to have a clearer overview of the modules at
  first encounter.
- Reworded commands arguments a bit.
- Added a rubric title for variables that affect the checks.
- CheckFortranSourceCompiles: Added CMake version when SRC_EXT option
  was introduced.
- Listed CMAKE_TRY_COMPILE_TARGET_TYPE variable in the rubric together
  with CMAKE_REQUIRED_* variables and added an include RST file for it.
- Used lowercase style for check_fortran_source_compiles().
2025-05-26 02:49:32 +02:00
Brad King
863ba7c207 Merge topic 'patch-CheckTypeSize'
1afdd98ca3 CheckTypeSize: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10808
2025-05-22 08:26: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
Peter Kokot
1afdd98ca3 CheckTypeSize: Update documentation
- Added intro code block showing how to include this module.
- Used "command" instead of "macro".
- Described the command arguments in a list separately.
- Refactored some descriptions.
- Added a rubric title for variables that affect the check.
2025-05-20 23:35:18 +02: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
Peter Kokot
c9956e777c CheckStructHasMember: Update documentation
- Added intro code block showing how to include this module.
- Used "command" instead of "macro".
- Reworded descriptions a bit.
- Extended examples section showing how to check struct members in C and
  C++. Added additional example showing how to use
  CMAKE_REQUIRED_DEFINITIONS variable.
2025-05-19 02:39:54 +02:00
Brad King
ef726f2e79 Merge topic 'patch-FindHg'
50769f3f10 FindHg: Sync module documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10770
2025-05-14 08:52:57 -04:00
Brad King
69d4fbf2e2 Merge topic 'patch-FindDoxygen'
d024ddb18a FindDoxygen: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10754
2025-05-13 10:47:18 -04:00
Peter Kokot
50769f3f10 FindHg: Sync module documentation
- Added intro code block with find_package() showing how to find the
  package with this module.
- Used "command" instead of "macro".
- Synced descriptions with other similar find modules.
2025-05-12 23:21:18 +02:00
Peter Kokot
f70f972562 CMakeDependentOption: Sync documentation
- Added intro code block with include() showing how to load this module.
- Used "command" instead of "macro".
- Removed duplicate mention of CMakeDependentOption module in the
  option() documentation.
- Synced captions in examples.
2025-05-12 21:10:29 +02:00
Peter Kokot
d024ddb18a FindDoxygen: Update documentation
- Refactored module docs sections.
- Used Doxygen_FOUND variable. The uppercased DOXYGEN_FOUND is also set
  except it has value of "YES" or "NO".
- Added separate examples section.
- Renamed "Functions" to "Commands".
- Documented doxygen_add_docs() command options as a list for better
  overview, and separated the Doxyfile configuration section as part of
  the command docs.
- Synced module docs with other similar find modules.
2025-05-11 08:38:08 +02:00
Brad King
4d51ad2b0a Merge topic 'install-DIRECTORY-exclude-empty'
b70ef48b27 install(DIRECTORY): Add EXCLUDE_EMPTY_DIRECTORIES option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10683
2025-05-07 09:45:42 -04:00
Brad King
b7a013af51 Merge topic 'patch-GenerateExportHeader'
12ec3270c4 GenerateExportHeader: Extend documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10747
2025-05-07 09:41:39 -04:00
Hao Dong
b70ef48b27 install(DIRECTORY): Add EXCLUDE_EMPTY_DIRECTORIES option
EXCLUDE_EMPTY_DIRECTORIES option excludes empty directories under the
directory to install. A directory is considered not empty if and only if
the directory contains at least one file or one symbolic link or one
none-empty sub-directory.

Closes: #19189
2025-05-06 10:59:24 -04:00
Brad King
015cada32d Merge topic 'patch-FindProtobuf'
1bdb0ee1b8 FindProtobuf: Deprecate protobuf_generate_*() and update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10742
2025-05-06 09:43:34 -04:00
Peter Kokot
12ec3270c4 GenerateExportHeader: Extend documentation
- Added a quick module introduction.
- Used "commands" instead of "functions".
- Listed macro names with short descriptions.
- Described command arguments as a list separately and moved code
  examples to a dedicated section.
- Added examples section with extended examples demonstrating how to use
  this module.
- Updated the description of the deprecated add_compiler_export_flags()
  command and added example showing how to upgrade code when
  encountering it.
- Added "See Also" section with some related links.
2025-05-06 02:52:01 +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
35c86a88c1 Merge branch 'release-4.0' 2025-05-05 11:22:50 -04:00
Brad King
a12ed97b5c CMake 4.0.2 2025-05-05 10:23:02 -04:00
Peter Kokot
1bdb0ee1b8 FindProtobuf: Deprecate protobuf_generate_*() and update documentation
This deprecates the protobuf_generate_cpp() and protobuf_generate_python()
commands because the protobuf_generate() can work for both of these
cases and provides more options. Also, upstream Protobuf CMake-based
build system has marked these two commands as legacy and requires
setting a separate protobuf_MODULE_COMPATIBLE variable to boolean true
before calling the find_package(Protobuf).

Changes:
- Reworded and synced module documentation with other similar find
  modules.
- Imported targets moved to top.
- Moved examples to a separate section.
- Extended examples with basic usage and some quick hints how to upgrade
  deprecated commands to protobuf_generate().
- Used lowercase style of commands.
- Used "commands" instead of "functions" or "macros".
- Documented the DESCRIPTORS argument for protobuf_generate() command
  and added a note that this option is not available when Protobuf is
  found in config mode.
- Added a note about the Protobuf CMake-based build system and that
  probuf_generate*() commands might come from the upstream CMake config
  files. Mentioned also the protobuf_MODULE_COMPATIBLE variable from
  upstream CMake build system.
  See #21228.
  This fixes this issue in favor of #24321 which tracks further
  progress about Protobuf.
- Documented the missing `PROTOBUF_GENERATE_CPP_APPEND_PATH` variable.
  See #19968.

Issue: #24321
Fixes: #21228
Fixes: #19968
2025-05-05 09:33:32 -04:00
Brad King
8c7ab4e1e6 Merge topic 'asm-no-msvc'
14212494bb ASM: Guard exclusion of MSVC C/CXX compiler with a policy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10740
2025-05-05 08:55:20 -04:00
Brad King
93cbcd7596 Merge topic 'xcode-debugger-workdir'
149ee3b4bc Xcode: Use DEBUGGER_WORKING_DIRECTORY as a fallback for scheme work dir
0f1b9ef32a Help: VS_DEBUGGER_WORKING_DIRECTORY precedence

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10736
2025-05-05 08:52:54 -04:00
Brad King
14212494bb ASM: Guard exclusion of MSVC C/CXX compiler with a policy
Since commit 6baf65ec46 (ASM: Do not consider MSVC C/CXX compiler for
generic ASM, 2025-04-08) we no longer mistake `cl` for an assembler.
However, some projects unconditionally enable ``ASM``, which worked
on Windows only due to that bug.  Restore compatibility with such
projects by guarding the change behind a new policy ``CMP0194``.

Fixes: #26907
Issue: #26617
2025-05-03 13:18:19 -04:00
Craig Scott
149ee3b4bc Xcode: Use DEBUGGER_WORKING_DIRECTORY as a fallback for scheme work dir
This also means when XCODE_SCHEME_WORKING_DIRECTORY is
set and a Xcode generator is used, that property will be used when
writing the debugger field in the file API replies.

Fixes: #26909
2025-05-03 10:16:15 -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
Peter Kokot
c375b3da9f FindProtobuf: Change protobuf_generate(DEPENDENCIES) argument to multi-value
This is a sync with the upstream `protobuf_generate()` command which has
this argument provided as a multi-value argument as of Protobuf 6.30.0
version (`cmake/protobuf-generate.cmake`).
2025-05-01 05:43:29 +02:00
Brad King
07a30dc075 Merge topic 'GNUInstallDirs-get-absolute-install-dir'
cc6dbd194c GNUInstallDirs: Cache CMAKE_INSTALL_* with leading usr/ for install prefix /
a7fcb1320c GNUInstallDirs: Make GNUInstallDirs_get_absolute_install_dir a function
03e796f9ab GNUInstallDirs: Move the common handler for `SYSCONFDIR` and `LOCALSTATEDIR`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10584
2025-04-30 09:52:43 -04:00
Brad King
cf54042a7c Merge topic 'externalproject-archive-types'
1cc85064ff ExternalProject: Remove explicit list of supported archive types
fb3757654e ExternalProject: Refactor local decompression test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10715
2025-04-30 09:51:15 -04:00
Brad King
ea9aa30551 Merge topic 'patch-FindBISON-FindFLEX'
c9d86e8beb FindFLEX: Update documentation
e0c4e8ecf4 FindBISON: Update documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10723
2025-04-30 09:44:37 -04:00
Cristian Le
cc6dbd194c GNUInstallDirs: Cache CMAKE_INSTALL_* with leading usr/ for install prefix /
As a consequence, `GNUInstallDirs_get_absolute_install_dir` does not
alter the `var` argument (the relative path argument).

Closes: #26834
Signed-off-by: Cristian Le <git@lecris.dev>
2025-04-29 13:49:42 -04:00
Javier Martín
1cc85064ff ExternalProject: Remove explicit list of supported archive types
- Do not try to guess the flags to pass to "cmake -E tar" ("z" or not) based
  on the extension. It is not necessary, as the archive type is autodetected
  since we switched to libarchive.
- Add new tests for .tar.zst archives, which would fail without the change.

Fixes: #25062
2025-04-29 11:22:13 -04:00
Brad King
e94ace226b Merge topic 'configure-log-find-v1'
a3f273b657 cmFindBase: Create `find-v1` configure log events
58b5d41a4f cmFindBase: Track initial state with an `enum`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10621
2025-04-29 10:54:10 -04:00
Peter Kokot
c9d86e8beb FindFLEX: Update documentation
- Updated and synced module documentation with other similar find
  modules.
- Used lowercase style for commands across the docs.
- Commands documented with indentation.
- Command arguments described as a list separately.
- Used "commands" instead of "macros".
- Extended examples section.
- Added example showing how to use found Flex library by creating an
  imported target inside a project. Fixes: #18718
2025-04-29 06:33:47 +02:00
Peter Kokot
e0c4e8ecf4 FindBISON: Update documentation
- Updated and synced module documentation with other similar find
  modules.
- Documented bison_target() command indented relative to the title.
- Command arguments described as a list separately.
- Used "command" instead of "macro".
- Used lowercase style across the docs.
- Extended examples section.
2025-04-29 06:18:15 +02:00
Ben Boeckel
a3f273b657 cmFindBase: Create find-v1 configure log events
Record `find_` command events in the configure log, except
`find_package` as it is far more complicated (and will have its own
event kind).

Note that testing only generates the events of interest, there is no
verification. Also note that testing that the "found" to "notfound"
transition causes an event is not testable because a truthy value in the
variable skips any kind of verification or other logic beyond
normalization.

Co-Authored-by: Ryan Krattiger <ryan.krattiger@kitware.com>
See: #24833
2025-04-28 13:55:36 +02:00
Vito Gamberini
0138df29dc project: add COMPAT_VERSION keyword
Fixes: #26893
2025-04-25 13:42:11 -04:00
Brad King
0cc962665b fileapi: Generate partial reply when buildsystem generation fails
In particular, the `configureLog` reply is useful for IDEs to read
`CMakeFiles/CMakeConfigureLog.yaml` when configuration fails.

Fixes: #26621
2025-04-14 10:42:03 -04:00
Brad King
dfc4beb09c Merge topic 'doc-path-case-sensitivity'
1fb7067b6e Help: Add 4.0 release note about file path case sensitivity on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10639
2025-04-11 14:37:21 -04:00
Brad King
1fb7067b6e Help: Add 4.0 release note about file path case sensitivity on Windows
Since KWSys commit `4feb470ab` (SystemTools: Remove GetActualCaseForPath
from CollapseFullPath, 2024-10-23), imported by commit ede7f2afa6 (KWSys
2024-10-24 (e1acde2e), 2024-10-24, v4.0.0-rc1~589^2~1^2), the KWSys
`CollapseFullPath` function that we use to normalize source file paths
no longer looks up the on-disk case of file paths.  This change was
intentionally made to reduce unnecessary disk accesses.  The change may
affect Windows-only projects that were never built on a case sensitive
filesystem.  Call out the change in the 4.0 release notes.

Issue: #26854
2025-04-11 10:33:09 -04:00
Brad King
028e1027be Merge branch 'release-4.0' 2025-04-10 11:32:29 -04:00
Brad King
ee515b2aa8 CMake 4.0.1 2025-04-10 10:58:22 -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