Browse Source

Adding icons

Felix Turowsky 2 years ago
parent
commit
4b0276c493
5 changed files with 19 additions and 1 deletions
  1. 2 0
      .gitignore
  2. 15 0
      CMakeLists.txt
  3. 1 0
      assets/icons.qrc
  4. BIN
      assets/opl-icons/app/icon_ios.icns
  5. 1 1
      src/opl.h

+ 2 - 0
.gitignore

@@ -85,3 +85,5 @@ openPilotLog.vcxproj.user
 
 # Disable localization updates
 l10n/
+# DS files
+*.DS_Store

+ 15 - 0
CMakeLists.txt

@@ -168,14 +168,29 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
     qt_add_executable(openPilotLog
         ${PROJECT_SOURCES}
         ${QM_FILES}
+        ${app_icon_macos}
     )
 else()
     add_executable(openPilotLog
         ${PROJECT_SOURCES}
         ${QM_FILES}
+        ${app_icon_macos}
     )
 endif()
 
+
+set_target_properties(openPilotLog PROPERTIES
+    MACOSX_BUNDLE TRUE
+)
+# The MACOSX_BUNDLE_ICON_FILE variable is added to the Info.plist
+# generated by CMake. This variable contains the .icns file name,
+# without the path.
+set(MACOSX_BUNDLE_ICON_FILE icon_ios.icns)
+
+# And the following tells CMake where to find and install the file itself.
+set(app_icon_macos "${CMAKE_CURRENT_SOURCE_DIR}/assets/opl-icons/app/icon_ios.icns")
+set_source_files_properties(${app_icon_macos} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
+
 # target_link_libraries(openPilotLog PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Sql Qt${QT_VERSION_MAJOR}::Network OpenSSL::SSL)
 target_link_libraries(openPilotLog PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Sql Qt${QT_VERSION_MAJOR}::Network)
 

+ 1 - 0
assets/icons.qrc

@@ -37,5 +37,6 @@
         <file>opl-icons/logos/logo_text.png</file>
         <file>opl-icons/app/icon_main.png</file>
         <file>opl-icons/toolbar/thick/light/icon_backup.png</file>
+        <file>opl-icons/app/icon_ios.icns</file>
     </qresource>
 </RCC>

BIN
assets/opl-icons/app/icon_ios.icns


+ 1 - 1
src/opl.h

@@ -398,7 +398,7 @@ const inline auto  DATABASE_TEMPLATE_CURRENCIES  = QStringLiteral(":/database/te
 const inline auto  LOGO                          = QStringLiteral(":/icons/opl-icons/logos/logo_text.png");
 const inline auto  ICON_MAIN                     = QStringLiteral(":/icons/opl-icons/app/icon_main.png");
 const inline auto  ICON_APPICON_LINUX            = QStringLiteral(":/icons/opl-icons/app/icon_linux.svg");
-const inline auto  ICON_APPICON_IOS              = QStringLiteral(":/icons/opl-icons/app/icon_ios.svg");
+const inline auto  ICON_APPICON_IOS              = QStringLiteral(":/icons/opl-icons/app/icon_ios.icns");
 const inline auto  ICON_APPICON_WIN              = QStringLiteral(":/icons/opl-icons/app/icon_windows.ico");
 
 const inline auto  ICON_TOOLBAR_HOME             = QStringLiteral(":/icons/opl-icons/toolbar/thick/light/icon_home.svg");