Set KiCad version in MacOS apps

Uses CMake's configure_file function [1] to automaticaly set the
CFBundleShortVersionString [2] value in every app's Info.plist file.

Also updates the CFBundleLongVersionString and CFBundleVersion with the
extended KiCad Version

[1]: https://cmake.org/cmake/help/latest/command/configure_file.html
[2]: https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring

(cherry picked from commit 455ee4c08c)
This commit is contained in:
Seppe Stas 2019-06-05 22:39:27 +02:00 committed by Seth Hillbrand
parent 0ee38653f7
commit 9233ae97d0
17 changed files with 58 additions and 24 deletions

10
.gitignore vendored
View File

@ -59,6 +59,16 @@ demos/**/*-bak
demos/**/_autosave-*
demos/**/fp-info-cache
# MacOS package info created by CMake
bitmap2component/Info.plist
cvpcb/Info.plist
eeschema/Info.plist
gerbview/Info.plist
kicad/Info.plist
pagelayout_editor/Info.plist
pcb_calculator/Info.plist
pcbnew/Info.plist
# editor/OS fluff
.*.swp
*~

View File

@ -54,6 +54,9 @@ target_link_libraries( bitmap2component
)
if( APPLE )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
set_target_properties( bitmap2component PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)

View File

@ -17,17 +17,17 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string></string>
<string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key>
<string>Bitmap 2 Component</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string></string>
<string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>

View File

@ -96,6 +96,9 @@ if( false ) # no CVPCB exe any more, only the *.kiface
endif()
if( APPLE )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
set_target_properties( cvpcb PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)

View File

@ -31,17 +31,17 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string></string>
<string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key>
<string>CvPcb</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string></string>
<string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>

View File

@ -394,6 +394,9 @@ endif()
# these 2 binaries are a matched set, keep them together:
if( APPLE )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
set_target_properties( eeschema PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)

View File

@ -21,12 +21,12 @@
<key>CFBundleIconFile</key> <string>eeschema.icns</string>
<key>CFBundleIdentifier</key> <string>org.kicad-pcb.eeschema</string>
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>
<key>CFBundleLongVersionString</key> <string></string>
<key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key> <string>Eeschema</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleShortVersionString</key> <string></string>
<key>CFBundleShortVersionString</key> <string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string></string>
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>

View File

@ -168,6 +168,9 @@ add_dependencies( gerbview gerbview_kiface )
# these 2 binaries are a matched set, keep them together
if( APPLE )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
set_target_properties( gerbview PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)

View File

@ -41,12 +41,12 @@
<key>CFBundleIconFile</key> <string>gerbview.icns</string>
<key>CFBundleIdentifier</key> <string>org.kicad-pcb.gerbview</string>
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>
<key>CFBundleLongVersionString</key> <string></string>
<key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key> <string>GerbView</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleShortVersionString</key> <string></string>
<key>CFBundleShortVersionString</key> <string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string></string>
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>

View File

@ -66,6 +66,9 @@ if( UNIX )
endif()
if( APPLE )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
set_target_properties( kicad PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)

View File

@ -20,12 +20,12 @@
<key>CFBundleIconFile</key> <string>kicad.icns</string>
<key>CFBundleIdentifier</key> <string>org.kicad-pcb.kicad</string>
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>
<key>CFBundleLongVersionString</key> <string></string>
<key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key> <string>KiCad</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleShortVersionString</key> <string></string>
<key>CFBundleShortVersionString</key> <string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string></string>
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>

View File

@ -140,6 +140,9 @@ add_dependencies( pl_editor pl_editor_kiface )
# these 2 binaries are a matched set, keep them together:
if( APPLE )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
set_target_properties( pl_editor PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)

View File

@ -21,12 +21,12 @@
<key>CFBundleIconFile</key> <string>pl_editor.icns</string>
<key>CFBundleIdentifier</key> <string>org.kicad-pcb.pl_editor</string>
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>
<key>CFBundleLongVersionString</key> <string></string>
<key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key> <string>Page Layout Editor</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleShortVersionString</key> <string></string>
<key>CFBundleShortVersionString</key> <string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string></string>
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>

View File

@ -104,6 +104,9 @@ add_dependencies( pcb_calculator pcb_calculator_kiface )
# these 2 binaries are a matched set, keep them together
if( APPLE )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
set_target_properties( pcb_calculator PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)

View File

@ -15,17 +15,17 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string></string>
<string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key>
<string>PCB Calculator</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string></string>
<string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>

View File

@ -708,6 +708,9 @@ add_dependencies( pcbnew_kiface_objects specctra_lexer_source_files )
# these 2 binaries are a matched set, keep them together:
if( APPLE )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist @ONLY )
set_target_properties( pcbnew PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
)

View File

@ -23,12 +23,12 @@
<key>CFBundleIconFile</key> <string>pcbnew.icns</string>
<key>CFBundleIdentifier</key> <string>org.kicad-pcb.pcbnew</string>
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>
<key>CFBundleLongVersionString</key> <string></string>
<key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key> <string>Pcbnew</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleShortVersionString</key> <string></string>
<key>CFBundleShortVersionString</key> <string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string></string>
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>