Commit Graph

124 Commits

Author SHA1 Message Date
6ziv
b5793cf41b install(EXPORT): Fix SYSTEM include directories relative to install prefix
Fixes: #23393
2025-10-29 16:03:02 -04:00
AJIOB
5de7a09e77 Tests/RunCMake: Match dots more precisely, part 3 2025-10-20 14:45:24 -04:00
AJIOB
62b112ee25 Tests/RunCMake: Match CMakeLists.txt file name more precisely 2025-10-16 17:42:12 +03:00
AJIOB
06ccd15457 Tests/RunCMake: Match xxx.cmake file name more precisely 2025-10-16 17:42:12 +03:00
Hanna Rusakovich
638cf8f194 Tests/RunCMake: Match CMakeLists.txt file name more precisely 2025-10-15 09:39:01 -04:00
Taylor Sasser
d92b6c3e20 CPS: Add Symbolic Components
Adds support for "symbolic" components, which represent feature-level
capabilities of a package that do not correspond to actual build targets.
These are modeled as pseudo-targets, using the INTERFACE type as a base,
and can be queried via:

  get_target_property(... <tgt> "SYMBOLIC")

This enables consumers to declare requirements on optional features
(e.g., SSL support) even when they do not map to concrete targets.

Fixes: #27187
2025-10-02 10:46:02 -04:00
F. Pichot
abfc07f91f install(EXPORT): Record COMPONENT in global COMPONENTS list
Issue: #27249
2025-09-23 10:19:13 -04:00
Timo Röhling
798cc7010c Tests: Fix regex matching to handle paths with special characters
Use `string(REGEX QUOTE)` for `MATCHES` with constructed patterns.

Fixes: #27234
2025-09-18 13:27:01 -04:00
Brad King
1c3300998f Merge topic 'short-object-names'
8180ecad9b autogen: support the `SHORT` intermediate dir strategy
f97d1bf7d8 Visual Studio: support shortened object filenames
a3a190c006 cmcmd: also forward rsp files in `.o` directories
3f33a5387a Makefiles: support shortened object filenames
b121adaa04 Makefiles: pass the target name to `cmake -E cmake_depends`
851e07fda3 Ninja: support short object directories
050f891d81 Tests: choose an explicit FULL strategy in tests expecting it
cce31527f8 Tests/ObjectLibrary: add shortened path tests
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10833
2025-07-30 11:36:21 -04:00
Brad King
188c2d2476 Merge topic 'export-dependencies-unwind'
92b403fc62 install(EXPORT): Use UNWIND_INCLUDE in exported find_dependency()
bba78d656e FindDependency: Split up macro to allow for no_return variant

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10968
2025-07-30 10:14:47 -04:00
Ben Boeckel
050f891d81 Tests: choose an explicit FULL strategy in tests expecting it
Since it can be set in the environment when running the test suite,
guard tests which are sensitive to intermediate directory strategy
changes with explicit settings.
2025-07-29 08:06:30 -04:00
Brad King
21e99dbf49 install(DIRECTORY): Revert "Add EXCLUDE_EMPTY_DIRECTORIES option"
Revert commit b70ef48b27 (install(DIRECTORY): Add
EXCLUDE_EMPTY_DIRECTORIES option, 2025-04-20, v4.1.0-rc1~212^2).
The implementation had at least two problems:

* It did not exclude the top-level directory if empty.
* It did not exclude non-empty directories whose contents are
  all filtered out.

Revert the feature pending a revised implementation.

Issue: #19189
Closes: #27092
2025-07-28 14:21:09 -04:00
Vito Gamberini
92b403fc62 install(EXPORT): Use UNWIND_INCLUDE in exported find_dependency() 2025-07-25 21:31:21 -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
36fffb673a CMP0062: Remove support for OLD behavior 2025-01-22 10:40:54 -05:00
Brad King
655a245d60 Tests: Explicitly disable AIX_SHARED_LIBRARY_ARCHIVE in some cases
We do not want AIX shared library archives in test cases that rely on
cross-platform appearance of `.so` files.
2024-11-23 15:23:25 -05:00
Brad King
a4adfc8e12 Merge topic 'test-fix-empty-elseif'
858ccfc941 Tests: Replace accidental empty elseif() with else()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Merge-request: !9995
2024-11-15 09:10:42 -05:00
Brad King
4c4f173876 Clarify advice given by compatibility deprecation message for CMake < 3.10
Since commit 84db8506ff (Deprecate compatibility with CMake versions older
than 3.10, 2024-10-03, v3.31.0-rc1~23^2) the `cmake_minimum_required` and
`cmake_policy` commands warn if the project does not enable policies as
of 3.10 or higher.  Clarify the advice given in the warning message about
how to update the version specification, particularly without actually
requiring a newer minimum version of CMake.
2024-11-14 09:40:01 -05:00
Brad King
858ccfc941 Tests: Replace accidental empty elseif() with else()
Issue: #26442
2024-11-13 15:31:12 -05:00
Brad King
84db8506ff Deprecate compatibility with CMake versions older than 3.10
Issue a deprecation warning on calls to `cmake_minimum_required` or
`cmake_policy` that set policies based on versions older than 3.10.
Note that the effective policy version includes `...<max>` treatment.
Update the check from commit 3a4791548d (Deprecate compatibility with
CMake versions older than 3.5, 2023-02-09, v3.27.0-rc1~508^2).
2024-10-03 14:18:26 -04:00
Brad King
f4aa34daa7 Tests/RunCMake: Update cmake_minimum_required versions to 3.10
For policy-specific tests, use the version before the policy was
introduced.  Otherwise, use 3.10 where possible.
2024-10-03 11:52:22 -04:00
Brad King
fdceee50e6 Merge topic 'normalize-install-destination-paths'
6a1fac1450 install: Normalize DESTINATION paths
2184fcfb00 Tests: Configure RunCMake.install cases with correct build type
5a8a6dfe81 cmGeneratorExpression: Change Find() parameter type to cm::string_view
d810374b3d install(PACKAGE_INFO): Remove outdated TODO comment
d13ed01d54 Tests: Remove unused files from RunCMake.install

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9800
2024-09-20 10:27:30 -04:00
Craig Scott
6a1fac1450 install: Normalize DESTINATION paths
The file generated by install(EXPORT) computes _IMPORT_PREFIX
in a way that assumes a normalized path. If the DESTINATION
contains any ../ components, the computed _IMPORT_PREFIX
would be wrong. Force the DESTINATION path to be normalized,
subject to the new CMP0176 policy.

Also normalize all other DESTINATION paths for consistency,
except for INCLUDES DESTINATION, which is not strictly a
destination but rather a search path to add.

Fixes: #26252
2024-09-19 20:31:47 +10:00
Chen Linxuan
39603a7e5c install: Add TYPE LIBEXEC for FILES and DIRECTORY
Signed-off-by: Chen Linxuan <me@black-desk.cn>
2024-09-18 11:05:28 -04:00
Craig Scott
2184fcfb00 Tests: Configure RunCMake.install cases with correct build type
The run_install_test() function would build and install with the
configuration hard-coded to Debug, but the configuration step
did not specify any configuration. This resulted in a "no config"
configuration, and the install step then wouldn't install the Debug
export files. This would only be a problem if using a single config
CMake generator, and it appears none of the existing tests relied
on actually installing the config-specific export file.
2024-09-18 08:39:59 +10:00
Craig Scott
d13ed01d54 Tests: Remove unused files from RunCMake.install 2024-09-18 08:39:57 +10:00
Robert Maynard
2fc9e482a9 Evaluation of TRANSITIVE_LINK_PROPERTIES isn't considered a usage
Fixes #26108
2024-07-05 13:16:47 -04:00
Brad King
b3245f33ef Tests/RunCMake/install: Avoid intermittent failures on AIX
Since commit 3a739d4dcb (EXPORT_PACKAGE_DEPENDENCIES: Add experimental
feature gate, 2024-03-12, v3.29.0-rc4~6^2) a case has intermittently
failed due to CMake rerunning during the case's build step and printing
the feature gate warning to stderr.  Redirect all build output to stdout
as we do in similar cases elsewhere.

Although we don't expect CMake to re-run in this case, somehow an AIX
host's filesystem is occasionally recording high-resolution timestamps
out of order among files saved in quick succession.
2024-05-10 08:48:02 -04:00
Brad King
3a739d4dcb EXPORT_PACKAGE_DEPENDENCIES: Add experimental feature gate
Some design concerns have been raised after trying the 3.29 release
candidates.  Avoid committing to a stable public interface for now.

Issue: #25767
2024-03-12 14:24:53 -04:00
Brad King
b1c4806914 install(EXPORT): Drop REQUIRED from exported find_dependency calls
In commit c6e6861e63 (install(EXPORT): Export find_dependency() calls,
2023-11-07, v3.29.0-rc1~439^2~1) we made the calls `REQUIRED`.  However,
a dependency is only required if the dependent package is required.
`find_dependency` already forwards the `REQUIRED` mark, and also already
marks the dependent package as not found if the dependency is missing.

Fixes: #25756
2024-03-11 12:07:32 -04:00
Kyle Edwards
c6e6861e63 install(EXPORT): Export find_dependency() calls
Issue: #20511
Co-Authored-by: Brad King <brad.king@kitware.com>
Co-Authored-by: Robert Maynard <rmaynard@nvidia.com>
2023-11-13 11:07:52 -05:00
David Lindauer
531b4fe643 OrangeC: Add support for OrangeC compiler
Add compiler information modules.  Update the test suite.

Fixes: #25032
Co-authored-by: Brad King <brad.king@kitware.com>
2023-09-25 12:27:29 -04:00
Brad King
3a9b8ef047 Tests: Teach ISPC tests to run on macOS arm64 host 2023-05-10 10:04:48 -04:00
Brad King
9c14f14848 install(TARGETS): Do not apply installation tweaks to NAMELINK files
These files are symlinks to the real binaries, and we already apply
tweaks to those.  Previously we generated installation tweak code
guarded by a `NOT IS_SYMLINK` condition that is never true.  Drop the
code altogether.

Add a test covering the motivating use case, in which a `POST_BUILD`
step modifies the namelink file to not actually be a symlink.

Fixes: #24647
2023-03-28 12:06:24 -04:00
Marc Chevrier
ede33f30cf Apple: Handle generation and comsuption of text-based stubs (.tbd files)
Fixes: #24123
2023-03-01 12:23:28 +01:00
Kyle Edwards
18e02ace5b install(CODE|SCRIPT): Support $<INSTALL_PREFIX> genex
Fixes: #24534
2023-02-24 10:17:45 -05:00
Brad King
3a4791548d Deprecate compatibility with CMake versions older than 3.5
Issue a deprecation warning on calls to `cmake_minimum_required` or
`cmake_policy` that set policies based on versions older than 3.5.
Note that the effective policy version includes `...<max>` treatment.
Update the check from commit 5845c218d7 (Deprecate compatibility with
CMake versions older than 2.8.12, 2020-06-12, v3.19.0-rc1~629^2).
2023-02-11 06:25:11 -05:00
Brad King
1edf138506 Tests/RunCMake: Update cmake_minimum_required versions
For policy-specific tests, use the version before the policy was
introduced.  Otherwise, use 3.5 where possible.

Also, remove `cmake_minimum_required()` and `project()` calls from
individual cases where they are handled by `CMakeLists.txt`.
2023-02-11 06:24:22 -05:00
Brad King
e73470991f Tests: Loosen RunCMake.install directory symlink expected output
The case added by commit 85f01a1ec2 (file(INSTALL): Improve formatting
of symlink creation error, 2022-10-06) may print `Up-to-date:` or
`Installing:` for the file inside a symlinked directory based on
filesystem timestamp granularity.  Since that output is not what the
test intends to cover, simply accept either possibility.
2022-10-10 09:55:43 -04:00
John Parent
569fb1893e file(INSTALL): Report "Installing:" for a symlink to a directory 2022-10-06 15:10:23 -04:00
John Parent
1461ae4933 file(INSTALL): Clarify symlink vs dir conflict errors
Clarify error reporting in scenario creating a symlink where a directory
previously exists.
2022-10-06 15:10:05 -04:00
Brad King
85f01a1ec2 file(INSTALL): Improve formatting of symlink creation error
Avoid printing two error messages.  Format paths without wrapping.
2022-10-06 15:08:06 -04:00
Nils Gladitz
b0c8e31b54 install: Don't ignore EXCLUDE_FROM_ALL when used with ALL_COMPONENTS
Fixes: #23494
2022-05-16 09:34:31 -04:00
Ben Boeckel
c5b56b35c2 cmInstallExportGenerator: expose the temporary directory
This needs to be known so that C++ module properties for the install can
be staged beside the other files.

Always perform the MD5 transformation (in non-bootstrap builds) so that
the path can be computed prior to generation (where it used the longest
configuration name to detect too-long paths). Update tests to expect the
always-present MD5 value. Note that this improves robustness of the test
suite as testing in a too-long path may have triggered the MD5
conversion anyways.
2022-04-28 09:13:48 -04:00
Brad King
069d836dab Merge topic 'restore-target-export-includes'
83d79636bf install(TARGETS): Restore per-export INCLUDES DESTINATION

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6969
2022-02-10 09:07:35 -05:00
Eugene Shalygin
83d79636bf install(TARGETS): Restore per-export INCLUDES DESTINATION
In commit 55e4753bbb (Refactor cmTargetExport removing
InterfaceIncludeDirecories, 2021-07-20, v3.22.0-rc1~337^2~1) the storage
of `INCLUDES DESTINATION` was moved into each target.  However, a target
may be installed in multiple exports, and their `INCLUDES DESTINATION`
should not be mixed.

Convert the IncludeDirectoriesEntries vector to a map and modify access
function to store the directories lists with respect to cmExportTarget
object. This fixes error when the same target is exported more than once
via different exports and each for consequent export its include
directories list grows. Add a test for this case.

Fixes: #23183
2022-02-09 13:31:26 -05:00
Brad King
a9ffded98c Add deprecation warnings for policies CMP0097 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for policies
introduced in CMake 3.16 and below to encourage projects to port
away from setting policies to OLD.
2022-02-03 14:13:12 -05:00
Brad King
dbe33b20bd install: Add context to {PUBLIC,PRIVATE}_HEADER/RESOURCE DESTINATION warnings 2021-10-27 12:59:16 -04:00
Brad King
d76cb12905 Add deprecation warnings for policies CMP0088 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for policies
introduced in CMake 3.14 and below to encourage projects to port
away from setting policies to OLD.
2021-06-30 10:07:42 -04:00
Kyle Edwards
0c3c6acaff Tests: Add tests for new options 2021-06-04 10:07:38 -04:00