Fix macos plist version string generation

Generate these resource files similar to how it is done one Linux.

Fixes mac-builder issue https://gitlab.com/kicad/packaging/kicad-mac-builder/issues/275

(Cherry-picked from 25a302758e)
This commit is contained in:
Ian McInerney 2019-12-26 12:42:25 +00:00
parent 9e6b56d783
commit fcb6f814de
20 changed files with 159 additions and 206 deletions

View File

@ -897,7 +897,9 @@ add_custom_target( uninstall
#################################################
# Generate platform metadata files
#################################################
if( UNIX AND NOT APPLE )
if( APPLE )
include( ${CMAKE_MODULE_PATH}/WritePlatformMetadata_macos.cmake )
elseif( UNIX )
include( ${CMAKE_MODULE_PATH}/WritePlatformMetadata_linux.cmake )
endif()

View File

@ -0,0 +1,63 @@
#
# This program source code file is part of KICAD, a free EDA CAD application.
#
# Copyright (C) 2019 Ian McInerney <Ian.S.McInerney@ieee.org>
# Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you may find one here:
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# or you may search the http://www.gnu.org website for the version 2 license,
# or you may write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# This file will configure the MacOS info.plist files to include the version
# and build date.
message( STATUS "Creating MacOS metadata" )
# Create the KiCad version strings
set( SRC_PATH ${PROJECT_SOURCE_DIR} )
include( ${CMAKE_MODULE_PATH}/KiCadVersion.cmake )
include( ${CMAKE_MODULE_PATH}/KiCadFullVersion.cmake )
# Configure each plist file from the respurces directory and store it in the build directory
configure_file( ${PROJECT_SOURCE_DIR}/resources/macos/plist/bitmap2component.Info.plist.in
${PROJECT_BINARY_DIR}/bitmap2component/Info.plist
@ONLY )
configure_file( ${PROJECT_SOURCE_DIR}/resources/macos/plist/eeschema.Info.plist.in
${PROJECT_BINARY_DIR}/eeschema/Info.plist
@ONLY )
configure_file( ${PROJECT_SOURCE_DIR}/resources/macos/plist/gerbview.Info.plist.in
${PROJECT_BINARY_DIR}/gerbview/Info.plist
@ONLY )
configure_file( ${PROJECT_SOURCE_DIR}/resources/macos/plist/kicad.Info.plist.in
${PROJECT_BINARY_DIR}/kicad/Info.plist
@ONLY )
configure_file( ${PROJECT_SOURCE_DIR}/resources/macos/plist/pcb_calculator.Info.plist.in
${PROJECT_BINARY_DIR}/pcb_calculator/Info.plist
@ONLY )
configure_file( ${PROJECT_SOURCE_DIR}/resources/macos/plist/pcbnew.Info.plist.in
${PROJECT_BINARY_DIR}/pcbnew/Info.plist
@ONLY )
configure_file( ${PROJECT_SOURCE_DIR}/resources/macos/plist/pleditor.Info.plist.in
${PROJECT_BINARY_DIR}/pagelayout_editor/Info.plist
@ONLY )

View File

@ -54,11 +54,8 @@ 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
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/bitmap2component/Info.plist
)
# put individual bundle outside of main bundle as a first step

View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>bitmap2component</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string>bitmap2component.icns</string>
<key>CFBundleIdentifier</key>
<string>org.kicad-pcb.bitmap2component</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key>
<string>Bitmap 2 Component</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSHighResolutionCapable</key>
<string>True</string>
</dict>
</plist>

View File

@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFile</key>
<string>cvpcb_doc.icns</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>net</string>
<string>cmp</string>
</array>
<key>CFBundleTypeName</key>
<string>cvpcb document</string>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>cvpcb</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string>cvpcb.icns</string>
<key>CFBundleIdentifier</key>
<string>org.kicad-pcb.cvpcb</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key>
<string>CvPcb</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSHighResolutionCapable</key>
<string>True</string>
</dict>
</plist>

View File

@ -394,11 +394,8 @@ 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
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/eeschema/Info.plist
)
# puts binaries into the *.app bundle while linking

View File

@ -168,11 +168,8 @@ 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
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/gerbview/Info.plist
)
# puts binaries into the *.app bundle while linking

View File

@ -66,11 +66,8 @@ 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
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/kicad/Info.plist
)
target_link_libraries( kicad
common

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key> <string>Editor</string>
<key>CFBundleTypeIconFile</key> <string>kicad_doc.icns</string>
<key>CFBundleTypeExtensions</key> <array>
<string>pro</string>
</array>
<key>CFBundleTypeName</key> <string>kicad project files</string>
<key>LSHandlerRank</key> <string>Owner</string>
</dict>
</array>
<key>CFBundleDevelopmentRegion</key> <string>English</string>
<key>CFBundleExecutable</key> <string>kicad</string>
<key>CFBundleGetInfoString</key> <string></string>
<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>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key> <string>KiCad</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleShortVersionString</key> <string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>
<key>NSHumanReadableCopyright</key> <string></string>
<key>NSHighResolutionCapable</key> <string>True</string>
</dict>
</plist>

View File

@ -140,11 +140,8 @@ 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
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/pagelayout_editor/Info.plist
)
# puts binaries into the *.app bundle while linking

View File

@ -104,11 +104,8 @@ 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
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/pcb_calculator/Info.plist
)
# puts binaries into the *.app bundle while linking

View File

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array/>
<key>CFBundleExecutable</key>
<string>pcb_calculator</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string>pcb_calculator.icns</string>
<key>CFBundleIdentifier</key>
<string>org.kicad-pcb.pcb_calculator</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key>
<string>PCB Calculator</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSHighResolutionCapable</key>
<string>True</string>
</dict>
</plist>

View File

@ -708,11 +708,8 @@ 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
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/pcbnew/Info.plist
)
# puts binaries into the *.app bundle while linking

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key> <array/>
<key>CFBundleDevelopmentRegion</key> <string>English</string>
<key>CFBundleExecutable</key> <string>bitmap2component</string>
<key>CFBundleGetInfoString</key> <string></string>
<key>CFBundleIconFile</key> <string>bitmap2component.icns</string>
<key>CFBundleIdentifier</key> <string>org.kicad-pcb.bitmap2component</string>
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>
<key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key> <string>Bitmap 2 Component</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleShortVersionString</key> <string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
<key>NSHighResolutionCapable</key> <string>True</string>
</dict>
</plist>

View File

@ -30,7 +30,7 @@
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>
<key>NSHumanReadableCopyright</key> <string></string>
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
<key>NSHighResolutionCapable</key> <string>True</string>
</dict>
</plist>

View File

@ -50,7 +50,7 @@
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>
<key>NSHumanReadableCopyright</key> <string></string>
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
<key>NSHighResolutionCapable</key> <string>True</string>
</dict>
</plist>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key> <string>Editor</string>
<key>CFBundleTypeIconFile</key> <string>kicad_doc.icns</string>
<key>CFBundleTypeExtensions</key> <array>
<string>pro</string>
</array>
<key>CFBundleTypeName</key> <string>kicad project files</string>
<key>LSHandlerRank</key> <string>Owner</string>
</dict>
</array>
<key>CFBundleDevelopmentRegion</key> <string>English</string>
<key>CFBundleExecutable</key> <string>kicad</string>
<key>CFBundleGetInfoString</key> <string></string>
<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>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key> <string>KiCad</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleShortVersionString</key> <string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
<key>NSHighResolutionCapable</key> <string>True</string>
</dict>
</plist>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key> <array/>
<key>CFBundleExecutable</key> <string>pcb_calculator</string>
<key>CFBundleGetInfoString</key> <string></string>
<key>CFBundleIconFile</key> <string>pcb_calculator.icns</string>
<key>CFBundleIdentifier</key> <string>org.kicad-pcb.pcb_calculator</string>
<key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>
<key>CFBundleLongVersionString</key> <string>@KICAD_VERSION_FULL@</string>
<key>CFBundleName</key> <string>PCB Calculator</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleShortVersionString</key> <string>@KICAD_VERSION@</string>
<key>CFBundleSignature</key> <string>????</string>
<key>CFBundleVersion</key> <string>@KICAD_VERSION_FULL@</string>
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
<key>NSHighResolutionCapable</key> <string>True</string>
</dict>
</plist>

View File

@ -32,7 +32,7 @@
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>
<key>NSHumanReadableCopyright</key> <string></string>
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
<key>NSHighResolutionCapable</key> <string>True</string>
</dict>
</plist>

View File

@ -30,7 +30,7 @@
<key>CSResourcesFileMapped</key> <true/>
<key>LSRequiresCarbon</key> <true/>
<key>NSRequiresAquaSystemAppearance</key> <true/>
<key>NSHumanReadableCopyright</key> <string></string>
<key>NSHumanReadableCopyright</key> <string>Copyright The KiCad Developers</string>
<key>NSHighResolutionCapable</key> <string>True</string>
</dict>
</plist>