CMake: Use custom package name #763
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When refactoring packaging with CPack in #745, I wrongly assumed that the default names would be enough. With the default name, the most glaring issue is that both x64 and arm64 packages for macOS have the same name, meaning when a release is made, whichever finishes last overwrites the first.
This PR manually sets the
CPACK_PACKAGE_FILE_NAME
todsda-doom-<version>-<platform>-<arch>
.The arch part has a few caveats that need to be worked around:
CMAKE_SYSTEM_PROCESSOR
is enough.CMAKE_SYSTEM_PROCESSOR
holds the architecture of the host. InsteadCMAKE_VS_PLATFORM_NAME
holds the target architecture.CMAKE_OSX_ARCHITECTURES
, similar to Visual Studio,CMAKE_SYSTEM_PROCESSOR
still refers to the host.The platform name is also manually defined. The default
CPACK_PACKAGE_FILE_NAME
usesCPACK_SYSTEM_NAME
, but this has the following caveats:Darwin
which may not be obvious to some user that this is meant for mac.win32
when targeting x86 andwin64
when targeting any other architecture, including arm.After this change, here is what release artifacts would look like: https://github.com/FtZPetruska/dsda-doom/releases/tag/custom-package-name-test-release