mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 05:45:38 +00:00
CMake: Fill version in bundle info plist
This commit is contained in:
parent
6e795c8977
commit
d862043f1d
|
@ -200,3 +200,24 @@ int main() {
|
|||
set(HOST_CACHE_LINE_SIZE ${detect_cache_line_size_output} CACHE STRING "Reported host cache line size")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(get_scm_version)
|
||||
if(SCM_VERSION)
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(Git)
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/.git" AND GIT_FOUND)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --dirty
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE LOCAL_SCM_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
if(NOT LOCAL_SCM_VERSION)
|
||||
set(SCM_VERSION "unknown" PARENT_SCOPE)
|
||||
else()
|
||||
set(SCM_VERSION ${LOCAL_SCM_VERSION} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
|
@ -225,6 +225,7 @@ if(WIN32)
|
|||
elseif(APPLE)
|
||||
# Don't generate a bundle for XCode, it makes code signing fail...
|
||||
if(NOT CMAKE_GENERATOR MATCHES "Xcode")
|
||||
get_scm_version()
|
||||
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DuckStation.app)
|
||||
set_target_properties(duckstation-qt PROPERTIES
|
||||
MACOSX_BUNDLE true
|
||||
|
|
|
@ -33,8 +33,12 @@
|
|||
<string>English</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${SCM_VERSION}</string>
|
||||
<key>CFBundleVersionString</key>
|
||||
<string>${SCM_VERSION}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>2019-2023 Connor McLaughlin <stenzek@gmail.com></string>
|
||||
<string>2019-2024 Connor McLaughlin <stenzek@gmail.com></string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
|
|
Loading…
Reference in a new issue