diff options
-rw-r--r-- | docs/find-module/FindPng2Ico.rst | 1 | ||||
-rw-r--r-- | find-modules/FindPng2Ico.cmake | 96 | ||||
-rw-r--r-- | modules/ECMAddAppIcon.cmake | 31 |
3 files changed, 2 insertions, 126 deletions
diff --git a/docs/find-module/FindPng2Ico.rst b/docs/find-module/FindPng2Ico.rst deleted file mode 100644 index db8aa775..00000000 --- a/docs/find-module/FindPng2Ico.rst +++ /dev/null @@ -1 +0,0 @@ -.. ecm-module:: ../../find-modules/FindPng2Ico.cmake diff --git a/find-modules/FindPng2Ico.cmake b/find-modules/FindPng2Ico.cmake deleted file mode 100644 index 52e845e8..00000000 --- a/find-modules/FindPng2Ico.cmake +++ /dev/null @@ -1,96 +0,0 @@ -#.rst: -# FindPng2Ico -# ----------- -# -# Try to find png2ico. -# -# If the png2ico executable is not in your PATH, you can provide -# an alternative name or full path location with the ``Png2Ico_EXECUTABLE`` -# variable. -# -# This will define the following variables: -# -# ``Png2Ico_FOUND`` -# True if png2ico is available. -# -# ``Png2Ico_EXECUTABLE`` -# The png2ico executable. -# -# If ``Png2Ico_FOUND`` is TRUE, it will also define the following imported -# target: -# -# ``Png2Ico::Png2Ico`` -# The png2ico executable. -# -# and the following variables: -# -# ``Png2Ico_HAS_COLORS_ARGUMENT`` -# Whether png2ico accepts a ``--colors`` argument. `Matthias Benkmann's -# tool <https://www.winterdrache.de/freeware/png2ico/>`_ does, while the -# version of png2ico from the `"KDE On Windows" (kdewin) -# <https://commits.kde.org/kdewin>`_ project does not. -# -# ``Png2Ico_HAS_RCFILE_ARGUMENT`` -# Whether png2ico accepts an ``--rcfile`` argument. The version of png2ico -# from the `"KDE On Windows" (kdewin) -# <https://commits.kde.org/kdewin>`_ project does, -# while `Matthias Benkmann's tool -# <https://www.winterdrache.de/freeware/png2ico/>`_ does not. -# -# Since 1.7.0. - -#============================================================================= -# SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org> -# -# SPDX-License-Identifier: BSD-3-Clause -#============================================================================= - -include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) - -ecm_find_package_version_check(Png2Ico) - -# Find png2ico -find_program(Png2Ico_EXECUTABLE NAMES png2ico) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Png2Ico - FOUND_VAR - Png2Ico_FOUND - REQUIRED_VARS - Png2Ico_EXECUTABLE -) - -mark_as_advanced(Png2Ico_EXECUTABLE) - -if (Png2Ico_FOUND) - execute_process( - COMMAND "${Png2Ico_EXECUTABLE}" --help - OUTPUT_VARIABLE _png2ico_help_text - ERROR_VARIABLE _png2ico_help_text - ) - if (_png2ico_help_text MATCHES ".*--rcfile .*") - set(Png2Ico_HAS_RCFILE_ARGUMENT TRUE) - else() - set(Png2Ico_HAS_RCFILE_ARGUMENT FALSE) - endif() - if (_png2ico_help_text MATCHES ".*--colors .*") - set(Png2Ico_HAS_COLORS_ARGUMENT TRUE) - else() - set(Png2Ico_HAS_COLORS_ARGUMENT FALSE) - endif() - unset(_png2ico_help_text) - - if (NOT TARGET Png2Ico::Png2Ico) - add_executable(Png2Ico::Png2Ico IMPORTED) - set_target_properties(Png2Ico::Png2Ico PROPERTIES - IMPORTED_LOCATION "${Png2Ico_EXECUTABLE}" - ) - endif() -endif() - -include(FeatureSummary) -set_package_properties(Png2Ico PROPERTIES - URL "https://www.winterdrache.de/freeware/png2ico/ or https://commits.kde.org/kdewin" - DESCRIPTION "Executable that converts a collection of PNG files into a Windows icon file" -) - diff --git a/modules/ECMAddAppIcon.cmake b/modules/ECMAddAppIcon.cmake index d252d376..c552c16b 100644 --- a/modules/ECMAddAppIcon.cmake +++ b/modules/ECMAddAppIcon.cmake @@ -39,8 +39,7 @@ # * Icons are compiled into the executable using a resource file. # * Icons may not show up in Windows Explorer if the executable # target does not have the ``WIN32_EXECUTABLE`` property set. -# * One of the tools png2ico (See :find-module:`FindPng2Ico`) or -# icotool (see :find-module:`FindIcoTool`) is required. +# * Icotool (see :find-module:`FindIcoTool`) is required. # * Supported sizes: 16, 24, 32, 48, 64, 128, 256, 512 and 1024. # # Mac OS X notes @@ -170,7 +169,6 @@ function(ecm_add_app_icon appsources) if (WIN32 AND (windows_icons_modern OR windows_icons_classic)) set(saved_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_FIND_MODULE_DIR}) - find_package(Png2Ico) find_package(IcoTool) set(CMAKE_MODULE_PATH "${saved_CMAKE_MODULE_PATH}") @@ -223,33 +221,8 @@ function(ecm_add_app_icon appsources) create_windows_icon_and_rc(IcoTool::IcoTool "${icotool_args}" "${windows_icons_modern}") set(${appsources} "${${appsources}};${_outfilename}.rc" PARENT_SCOPE) - - # standard png2ico has no rcfile argument - elseif(Png2Ico_FOUND AND NOT Png2Ico_HAS_RCFILE_ARGUMENT AND windows_icons_classic) - set(png2ico_args) - list(APPEND png2ico_args "${_outfilename}.ico") - list(APPEND png2ico_args "${windows_icons_classic}") - - create_windows_icon_and_rc(Png2Ico::Png2Ico "${png2ico_args}" "${windows_icons_classic}") - set(${appsources} "${${appsources}};${_outfilename}.rc" PARENT_SCOPE) - - # png2ico from kdewin provides rcfile argument - elseif(Png2Ico_FOUND AND windows_icons_classic) - add_custom_command( - OUTPUT "${_outfilename}.rc" "${_outfilename}.ico" - COMMAND Png2Ico::Png2Ico - ARGS - --rcfile "${_outfilename}.rc" - "${_outfilename}.ico" - ${windows_icons_classic} - DEPENDS ${windows_icons_classic} - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - ) - - set(${appsources} "${${appsources}};${_outfilename}.rc" PARENT_SCOPE) - # else none of the supported tools was found else() - message(WARNING "Unable to find the png2ico or icotool utilities or icons in matching sizes - application will not have an application icon!") + message(WARNING "Unable to find the icotool utilities or icons in matching sizes - application will not have an application icon!") endif() elseif (APPLE AND (mac_icons OR mac_sidebar_icons)) # first generate .iconset directory structure, then convert to .icns format using the Mac OS X "iconutil" utility, |