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
This commit is contained in:
Seppe Stas 2019-06-05 22:39:27 +02:00 committed by Seth Hillbrand
parent 2d29f76c49
commit 455ee4c08c
17 changed files with 58 additions and 24 deletions

10
.gitignore vendored
View File

@ -59,6 +59,16 @@ demos/**/*-bak
demos/**/_autosave-* demos/**/_autosave-*
demos/**/fp-info-cache 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 # editor/OS fluff
.*.swp .*.swp
*~ *~

View File

@ -56,6 +56,9 @@ target_link_libraries( bitmap2component
) )
if( APPLE ) 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 set_target_properties( bitmap2component PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
) )

View File

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

View File

@ -94,6 +94,9 @@ if( false ) # no CVPCB exe any more, only the *.kiface
endif() endif()
if( APPLE ) 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 set_target_properties( cvpcb PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
) )

View File

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

View File

@ -383,6 +383,9 @@ endif()
# these 2 binaries are a matched set, keep them together: # these 2 binaries are a matched set, keep them together:
if( APPLE ) 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 set_target_properties( eeschema PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
) )

View File

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

View File

@ -154,6 +154,9 @@ add_dependencies( gerbview gerbview_kiface )
# these 2 binaries are a matched set, keep them together # these 2 binaries are a matched set, keep them together
if( APPLE ) 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 set_target_properties( gerbview PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
) )

View File

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

View File

@ -65,6 +65,9 @@ if( UNIX )
endif() endif()
if( APPLE ) 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 set_target_properties( kicad PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
) )

View File

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

View File

@ -122,6 +122,9 @@ add_dependencies( pl_editor pl_editor_kiface )
# these 2 binaries are a matched set, keep them together: # these 2 binaries are a matched set, keep them together:
if( APPLE ) 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 set_target_properties( pl_editor PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist 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>CFBundleIconFile</key> <string>pl_editor.icns</string>
<key>CFBundleIdentifier</key> <string>org.kicad-pcb.pl_editor</string> <key>CFBundleIdentifier</key> <string>org.kicad-pcb.pl_editor</string>
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</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>CFBundleName</key> <string>Page Layout Editor</string>
<key>CFBundlePackageType</key> <string>APPL</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>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string></string> <key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key> <true/> <key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/> <key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/> <key>NSRequiresAquaSystemAppearance</key> <true/>

View File

@ -106,6 +106,9 @@ add_dependencies( pcb_calculator pcb_calculator_kiface )
# these 2 binaries are a matched set, keep them together # these 2 binaries are a matched set, keep them together
if( APPLE ) 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 set_target_properties( pcb_calculator PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
) )

View File

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

View File

@ -674,6 +674,9 @@ add_dependencies( pcbnew_kiface_objects specctra_lexer_source_files )
# these 2 binaries are a matched set, keep them together: # these 2 binaries are a matched set, keep them together:
if( APPLE ) 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 set_target_properties( pcbnew PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
) )

View File

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