Commit Graph

14 Commits

Author SHA1 Message Date
Matthew Woehlke
4bb4bbcf59 Tests: Actually test CPS generation with no config
Commit 58d9950842 (CPS: Fix empty configuration field on noconfig
builds, 2025-06-30) fixed an issue with CPS generation that would
incorrectly use the empty string to identify the configuration in some
instances. (The expected CMake behavior is that an empty configuration
is always equivalent to 'noconfig'.) However, that commit did not add
any tests for the fix.

Add those tests now. Also, tweak the tests that were added, that test
for expected non-empty configuration-specific content, to hard-code what
configuration or configurations are produced. Lastly, remove the
explicit test for existence of the CPS file in said tests; `file(READ)`
will complain if the file does not exist, so the separate test is
superfluous.
2025-07-03 13:58:31 -04:00
Vito Gamberini
7db44fbfb8 CPS: Support FILE_SET HEADERS
Fixes: #26806
2025-07-02 10:34:10 -04:00
Brad King
b938922909 Merge topic 'cps-noconfig-fix'
58d9950842 CPS: Fix empty configuration field on noconfig builds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10922
2025-07-02 08:00:39 -04:00
Vito Gamberini
58d9950842 CPS: Fix empty configuration field on noconfig builds
Fixes: #27044
2025-07-01 17:01:13 -04:00
Matthew Woehlke
755a24ccae CPS: Add export support for [default_]license
Add `LICENSE` and `DEFAULT_LICENSE` arguments to the `PACKAGE_INFO`
modes of the `install` and `export` commands. If not otherwise
specified, the `LICENSE` will be taken from the project's
`SPDX_LICENSE`, if available.
2025-06-20 14:01:25 -04:00
Matthew Woehlke
bb1e00b92c cmPackageInfoArguments: Validate new arguments
Add validation of recently added `DESCRIPTION` and `HOMEPAGE_URL`
arguments to `export`/`install` commands.
2025-06-13 14:30:46 -04:00
Matthew Woehlke
da97747dac CPS: Support additional metadata
Add support for specifying CPS's supplemental `description` and
`website` attributes. Add ability to inherit these from the `project()`,
similar to how version information can be inherited.
2025-06-03 16:50:46 -04:00
Matthew Woehlke
ecf81c1bc1 CPS: Get metadata from project
Modify {export,install}(PACKAGE_INFO) commands to inherit version
information from the current project in situations where it seems
reasonable to do so. Add an option to explicitly request inheritance
from a specific project.

This leverages the recently added project(COMPAT_VERSION).
2025-06-02 10:31:36 -04:00
Matthew Woehlke
9adf93d112 Tests/InstallPackageInfo: Consolidate bad arguments tests
Consolidate InstallPackageInfo's bad arguments tests into only two test
cases that each test multiple invocations, rather than having a single
test per invocation. This makes them match the similar ExportPackageInfo
tests which were necessarily consolidated due to those testing many more
variants (due to differences in the respective interfaces). This will
simplify adding additional tests in the future.
2025-06-02 10:31:36 -04:00
Daniel Tierney
df3e246bc1 export: Import/export target property for license
Add import/export support and documentation for the SPDX_LICENSE
target property. A target's license can be specified by setting
this property to an SPDX license expression. CMake and CPS-format
export files generated with `export()` or `install()` will
retain the license information. CMake also imports the license
property for imported targets.

Closes: #26706
2025-05-13 17:01:20 -04:00
Taylor Sasser
555ecfa046 Add tests for install(PACKAGE_INFO) destination 2025-04-28 11:05:31 -04:00
Brad King
953e5ec831 Merge branch 'backport-export-multiple-set-not-installed' 2025-03-17 18:04:53 -04:00
Matthew Woehlke
c8ccd5a9e3 export: Add build-tree CPS support
Add Common Package Specification support to export(EXPORT).
2025-02-25 15:42:23 -05:00
Matthew Woehlke
9d83a1ed1f Tests: Rename certain CPS tests
Rename the RunCMake/PackageInfo and RunCMake/CpsExportImport tests to
indicate that they cover CPS generated by the install command. This
opens space for similar tests that will cover CPS generation via the
export command.
2025-02-25 12:18:13 -05:00