mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 21:18:53 +00:00
Teach CMake Mac App build to dynamically derive the version
Populate CFBundleShortVersionString with the fish version from git_version_gen.sh. Note this happens at build generation time, not at build time.
This commit is contained in:
parent
0f5dc0b4e2
commit
b952606430
2 changed files with 13 additions and 2 deletions
|
@ -18,7 +18,17 @@ ADD_EXECUTABLE(fish_macapp EXCLUDE_FROM_ALL
|
||||||
${OSX_DIR}/osx_fish_launcher.m
|
${OSX_DIR}/osx_fish_launcher.m
|
||||||
${RESOURCE_FILES}
|
${RESOURCE_FILES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Compute the version. Note this is done at generation time, not build time,
|
||||||
|
# so cmake must be re-run after version changes for the app to be updated. But
|
||||||
|
# generally this will be run by make_pkg.sh which always re-runs cmake.
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build_tools/git_version_gen.sh --stdout
|
||||||
|
COMMAND cut -d- -f1
|
||||||
|
OUTPUT_VARIABLE FISH_SHORT_VERSION
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
|
||||||
# Note CMake appends .app, so the real output name will be fish.app.
|
# Note CMake appends .app, so the real output name will be fish.app.
|
||||||
# This target does not include the 'base' resource.
|
# This target does not include the 'base' resource.
|
||||||
SET_TARGET_PROPERTIES(fish_macapp PROPERTIES OUTPUT_NAME "fish")
|
SET_TARGET_PROPERTIES(fish_macapp PROPERTIES OUTPUT_NAME "fish")
|
||||||
|
@ -30,6 +40,7 @@ SET_TARGET_PROPERTIES(fish_macapp PROPERTIES
|
||||||
MACOSX_BUNDLE TRUE
|
MACOSX_BUNDLE TRUE
|
||||||
MACOSX_BUNDLE_INFO_PLIST ${OSX_DIR}/CMakeMacAppInfo.plist.in
|
MACOSX_BUNDLE_INFO_PLIST ${OSX_DIR}/CMakeMacAppInfo.plist.in
|
||||||
MACOSX_BUNDLE_GUI_IDENTIFIER "com.ridiculousfish.fish-shell"
|
MACOSX_BUNDLE_GUI_IDENTIFIER "com.ridiculousfish.fish-shell"
|
||||||
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${FISH_SHORT_VERSION}
|
||||||
RESOURCE "${RESOURCE_FILES}"
|
RESOURCE "${RESOURCE_FILES}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.0.0</string>
|
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>0.1</string>
|
<string>0.1</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
|
|
Loading…
Reference in a new issue