mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-08 15:20:45 +01:00
e05b033dd2
Some generators (like Unix Makefiles and Xcode) copy an app's Info.plist at configure time. This causes a problem when we need to generate the Info.plist at build time, like how we currently do it with ScmRevGen. Instead of generating the Info.plist directly in ScmRevGen, provide an Info.plist without any version information to CMake at configure time, have ScmRevGen generate a separate plist file with the version information at build time, and then merge the two together to create the final Info.plist.
25 lines
660 B
CMake
25 lines
660 B
CMake
function(dolphin_inject_version_info target)
|
|
set(INFO_PLIST_PATH "$<TARGET_BUNDLE_DIR:${target}>/Contents/Info.plist")
|
|
add_custom_command(TARGET ${target}
|
|
POST_BUILD
|
|
|
|
COMMAND /usr/libexec/PlistBuddy -c
|
|
"Delete :CFBundleShortVersionString"
|
|
"${INFO_PLIST_PATH}"
|
|
|| true
|
|
|
|
COMMAND /usr/libexec/PlistBuddy -c
|
|
"Delete :CFBundleLongVersionString"
|
|
"${INFO_PLIST_PATH}"
|
|
|| true
|
|
|
|
COMMAND /usr/libexec/PlistBuddy -c
|
|
"Delete :CFBundleVersion"
|
|
"${INFO_PLIST_PATH}"
|
|
|| true
|
|
|
|
COMMAND /usr/libexec/PlistBuddy -c
|
|
"Merge '${CMAKE_BINARY_DIR}/Source/Core/VersionInfo.plist'"
|
|
"${INFO_PLIST_PATH}")
|
|
endfunction()
|