Commit Graph

17 Commits

Author SHA1 Message Date
Craig Scott c5231ba29e find_package: Save/restore PACKAGE_PREFIX_DIR
Package configuration files generated by `configure_package_config_file`
set this variable in `@PACKAGE_INIT@` and then use it later.  There may
be intervening calls to `find_package`, e.g., via `find_dependency`.
If the loaded package also used `configure_package_config_file`, it
may change the value of `PACKAGE_PREFIX_DIR`.  Explicitly save and
restore the value to avoid this.

Fixes: #25827
2024-04-19 11:44:09 -04:00
Craig Scott 8ac7958e3a generate_apple_*_selection_file: Save/restore PACKAGE_PREFIX_DIR
Issue: #25827
2024-04-19 11:41:12 -04:00
Brad King f1cacaa830 Tests/RunCMake/CMakePackage: Define variable closer to where it is used 2024-04-15 14:01:33 -04:00
Brad King 0e4db17764 CMakePackageConfigHelpers: Restore undocumented PACKAGE_PREFIX_DIR variable
Revert commit 6ddf8712cd (CMakePackageConfigHelpers: Use unique variable
name for pkg prefix, 2024-03-30, v3.29.1~8^2).  It regressed existing
projects that rely on the undocumented `PACKAGE_PREFIX_DIR` variable in
package configuration files generated by `CMakePackageConfigHelpers`.

Fixes: #25873
Fixes: #25885
Issue: #25827
2024-04-11 09:23:46 -04:00
Craig Scott 6ddf8712cd CMakePackageConfigHelpers: Use unique variable name for pkg prefix
Fixes: #25827
2024-04-01 09:32:37 +11:00
Brad King 85d6d3b2e3 generate_apple_*_selection_file: Add option to capture errors
Add an option to capture error messages in a variable instead of
terminating with a fatal error.

Fixes: #25778
2024-03-19 09:52:32 -04:00
Brad King 2149dbd379 generate_apple_architecture_selection_file: Document $(ARCHS_STANDARD) support
Also add a test case.

Fixes: #25780
2024-03-19 09:52:32 -04:00
Brad King be642f6ed5 generate_apple_architecture_selection_file: Simplify signature
Allow callers to pass multiple values to list-valued arguments
instead of putting the entire list in a single quoted argument.

Fixes: #25779
2024-03-19 09:52:32 -04:00
Brad King 8959ad9db1 Tests/RunCMake/CMakePackage: Fix Apple architecture selection argument order
Call `generate_apple_architecture_selection_file` with matching order in
`SINGLE_ARCHITECTURES` and `SINGLE_ARCHITECTURE_INCLUDE_FILES`.
2024-03-19 09:51:21 -04:00
Brad King 677f3d721b Tests/RunCMake/CMakePackage: Add architecture i386 for macOS on Xcode < 10
Use every architecture each version of Xcode has in `$(ARCHS_STANDARD)`.
2024-03-19 09:46:57 -04:00
Brad King 5b5acb557a Tests: Enable RunCMake.CMakePackage visionOS cases with Xcode 15.2
Xcode 15.2 officially includes the visionOS SDKs.

Fix a typo from commit 2a398cd9b6 (CMakePackageConfigHelpers: Clarify
generate_apple_*_selection_file signatures, 2024-01-04) to make it pass.

Issue: #25266
2024-02-09 11:37:40 -05:00
Brad King 2a398cd9b6 CMakePackageConfigHelpers: Clarify generate_apple_*_selection_file signatures
The helpers added by:

* commit 37bc3400cd (CMakePackageConfigHelpers: Add
                     generate_apple_platform_selection_file(), 2023-11-03)
* commit 4ac5a2f866 (CMakePackageConfigHelpers: Add
                     generate_apple_architecture_selection_file(), 2023-12-19)

were worded in terms of including package configuration files, but the
actual functionality is to include files *from* package configuration
files.  The included files do not themselves need to be usable as
package configuration files.

Rename the options and clarify the documentation accordingly.

Issue: #25262
Issue: #25516
2024-01-04 19:01:35 -05:00
Brad King 4ac5a2f866 CMakePackageConfigHelpers: Add generate_apple_architecture_selection_file()
Add a helper to select architecture-specific implementations of a
package on an Apple-specific platform.

Fixes: #25516
2023-12-19 08:56:30 -05:00
Brad King 68a03cf3d4 generate_apple_platform_selection_file: Add INSTALL_PREFIX option
This is necessary to forward to `configure_package_config_file`.
2023-12-19 08:51:16 -05:00
Brad King ff21f0f70f Tests: Verify generate_apple_platform_selection_file file paths 2023-12-19 08:27:44 -05:00
Brad King dc5098429b CMakePackageConfigHelpers: Clarify Apple platform selection usage error
`generate_apple_platform_selection_file` requires `INSTALL_DESTINATION`.
2023-12-18 14:57:27 -05:00
Brad King 1dd4a9baff Tests: Cover generate_apple_platform_selection_file on all platforms
The test added by commit 37bc3400cd (CMakePackageConfigHelpers: Add
generate_apple_platform_selection_file(), 2023-11-03) covers importing
only on macOS, and is specific to the xcframework test case.  Add a
dedicated test for `generate_apple_platform_selection_file` that covers
export and import on all platforms.
2023-12-16 06:54:46 -05:00