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
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
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: #24321Fixes: #21228Fixes: #19968
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
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`).
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
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>
- 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
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
4ed399ccfb GNUInstallDirs: Change special path defaults to absolute
7566a477f7 GNUInstallDirs: Factor out helper for special absolute path logic
42dfcbf1a5 GNUInstallDirs: Refactor LIBDIR default calculation
9789f7d05e GNUInstallDirs: Add internal helper to compute specific defaults
83f44bbf53 GNUInstallDirs: Factor out helper to compute system type
0c9b6aa9e4 GNUInstallDirs: De-duplicate description of defaults
18e1341950 GNUInstallDirs: Move defaults from arguments to variables
9f41a67fce GNUInstallDirs: Reduce duplication of CMAKE_INSTALL_ prefix
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10542
Components are added in a backward-compatible way:
* ASPELL component - adds the ASPELL::ASPELL imported target
* Executable component - adds the ASPELL::Executable imported target
If components are not specified in find_package() call, module, by
default, searches for both components and provides backward
compatibility with the find_package(ASPELL) usage via ASPELL_LIBRARIES,
ASPELL_INCLUDE_DIR, and ASPELL_EXECUTABLE variables.
The ASPELL_DEFINITIONS variable description removed from the
documentation as it was never defined by this module.
Additionally added a Pspell interface check (pspell.h header file) if
Aspell library provides it. It is checked separately because it might
be located in a subdirectory of pspell/pspell.h and code includes it as
`<pspell.h>`. Some distributions package pspell.h as part of the
libpspell development package and install also libaspell development
package as a dependency for BC.
Added also ASPELL_VERSION variable in case aspell executable can
determine it.
Issue: #26811
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
When the `MACOSX_PACKAGE_LOCATION` property is set on a directory, Xcode
copies the entire directory into the bundle. Implement this on Ninja
and Makefile generators too.
Fixes: #26808
Co-authored-by: Brad King <brad.king@kitware.com>
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
When `--schedule-random` is used in automated CI jobs, failures may
occur due to test order. We now log the seed. Provide a way for
developers to re-run the same order by specifying the seed.
Fixes: #26760
Co-authored-by: Brad King <brad.king@kitware.com>
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
The `LINK_LIBRARIES` and `INTERFACE_LINK_LIBRARIES` target properties
establish the graph of link dependencies used to propagate usage
requirements transitively. Therefore the `$<TARGET_PROPERTY:...>`
generator expression should evaluate them transitively as it does for
other transitive properties. Add policy CMP0189 for compatibility.
Fixes: #26709
Issue: #12435
The semantics mimic other languages like Python, Java, JS, etc.
To advance past a zero-length match, the search algorithm first
tries to find a non-zero alternative branch. If that fails, it
force-advances by 1 character.
Fixes: #13790, #13792, #18690, #26629
When doing successive matches, track the input start and current search
start positions separately to prevent the `^` anchor from matching in
the middle of the string. Add policy CMP0186 to provide compatibility.
Issue: #26629Fixes: #16899
The variable CPACK_ARCHIVE_FILE_NAME (added in 9e06e97d30)
only works if per-component packaging is enabled. This isn't obvious
from the documentation.
Make it also work for non-component packages and adjust documentation.
Fixes: #8769