find_package: Search within frameworks and xcframeworks
How can I embed CMake configuration files in xcframework's? The currently supported search procedures only contain regular directory structures, macos apps and frameworks.
It would be useful to embed configuration files so to be able to use find_package
for xcframework's as well.
Internally, xcframeworks are a collection of frameworks.
For reference, this is the tree of a SDL3 xcframework (limited to depth 3):
SDL3.xcframework/
├── Info.plist
├── ios-arm64
│ └── SDL3.framework
│ ├── default.metallib
│ ├── Headers
│ ├── Info.plist
│ ├── License.txt
│ ├── ReadMe.txt
│ └── SDL3
├── ios-arm64_x86_64-simulator
│ └── SDL3.framework
│ ├── _CodeSignature
│ ├── default.metallib
│ ├── Headers
│ ├── Info.plist
│ ├── License.txt
│ ├── ReadMe.txt
│ └── SDL3
├── macos-arm64_x86_64
│ └── SDL3.framework
│ ├── Headers -> Versions/Current/Headers
│ ├── Resources -> Versions/Current/Resources
│ ├── SDL3 -> Versions/Current/SDL3
│ └── Versions
├── tvos-arm64
│ └── SDL3.framework
│ ├── default.metallib
│ ├── Headers
│ ├── Info.plist
│ ├── License.txt
│ ├── ReadMe.txt
│ └── SDL3
└── tvos-arm64_x86_64-simulator
└── SDL3.framework
├── _CodeSignature
├── default.metallib
├── Headers
├── Info.plist
├── License.txt
├── ReadMe.txt
└── SDL3
I believe CMake should, when e.g. targeting macos on arm64, look into the following additional directories when doing find_package(SDL3)
:
-
SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Resources
(depends on the current target) SDL3.xcframework/Resources
Edited by Maarten