In [SDL_mixer](https://github.com/libsdl-org/SDL_mixer), we submodule'd opus and opusfile through our forks and attempted cmake build relying on the submodules. Issues we had: - The git tree, obviously, is missing a `package_version` file. We added to both opus and opusfile. However: - If everything fails opusfile cmake'ry sets `OPUSFILE_PROJECT_VERSION` to 0, as in integer: https://github.com/xiph/opusfile/blob/master/cmake/OpusFilePackageVersion.cmake#L63 ... But the caller expects a version instead, and fails: https://github.com/xiph/opusfile/blob/master/CMakeLists.txt#L6-L9 Should you change the fallback `OPUSFILE_PROJECT_VERSION` to `0.0` instead? (Same is true in Opus project.) - Opusfile cmake'ry doesn't look for `package_version` file if it finds git, because the `package_version` case is an `elseif` case which seems wrong: https://github.com/xiph/opusfile/blob/master/cmake/OpusFilePackageVersion.cmake#L31 Finalizing the `git` case with an `endif` changing `package_version` case to an `if` fixes things for us. - Opus: Going from v1.3.1 to git master, the issue described above is present in opus too: https://github.com/xiph/opus/blob/master/cmake/OpusPackageVersion.cmake#L31 The 1.3.1 release was good: https://github.com/xiph/opus/blob/e85ed7726db5d677c9c0677298ea0cb9c65bdd23/opus_functions.cmake#L45 (Note that `get_package_version` used to return only if git case succeeded.) So the same suggestion as in the opusfile case above.
In SDL_mixer, we submodule'd opus and opusfile through our forks
and attempted cmake build relying on the submodules. Issues we had:
The git tree, obviously, is missing a
package_versionfile. Weadded to both opus and opusfile. However:
If everything fails opusfile cmake'ry sets
OPUSFILE_PROJECT_VERSIONto 0, as in integer:
https://github.com/xiph/opusfile/blob/master/cmake/OpusFilePackageVersion.cmake#L63
... But the caller expects a version instead, and fails:
https://github.com/xiph/opusfile/blob/master/CMakeLists.txt#L6-L9
Should you change the fallback
OPUSFILE_PROJECT_VERSIONto0.0instead? (Same is true in Opus project.)
Opusfile cmake'ry doesn't look for
package_versionfile if itfinds git, because the
package_versioncase is anelseifcasewhich seems wrong:
https://github.com/xiph/opusfile/blob/master/cmake/OpusFilePackageVersion.cmake#L31
Finalizing the
gitcase with anendifchangingpackage_versioncase to an
iffixes things for us.Opus: Going from v1.3.1 to git master, the issue described above is
present in opus too:
https://github.com/xiph/opus/blob/master/cmake/OpusPackageVersion.cmake#L31
The 1.3.1 release was good:
https://github.com/xiph/opus/blob/e85ed7726db5d677c9c0677298ea0cb9c65bdd23/opus_functions.cmake#L45
(Note that
get_package_versionused to return only if git case succeeded.)So the same suggestion as in the opusfile case above.