Changeset View
Changeset View
Standalone View
Standalone View
find-modules/FindIcoTool.cmake
- This file was added.
1 | #.rst: | ||||
---|---|---|---|---|---|
2 | # FindIcoTool | ||||
kropUnsubmitted Done
krop: - Missing doc
- Missing license
| |||||
@vpinon Can you let me know what you want here? dschmidt: @vpinon Can you let me know what you want here? | |||||
Hello, vpinon: Hello,
FindIcoTool.cmake is largely copied from FindPng2Ico.cmake, I'm even not sure I can… | |||||
krop: FindPng2Ico uses the BSD license. FindIcoTool shall use the same one. | |||||
3 | # ----------- | ||||
4 | # | ||||
5 | # Try to find icotool. | ||||
6 | # | ||||
7 | # If the icotool executable is not in your PATH, you can provide | ||||
8 | # an alternative name or full path location with the ``IcoTool_EXECUTABLE`` | ||||
9 | # variable. | ||||
10 | # | ||||
11 | # This will define the following variables: | ||||
12 | # | ||||
13 | # ``IcoTool_FOUND`` | ||||
14 | # True if icotool is available. | ||||
15 | # | ||||
16 | # ``IcoTool_EXECUTABLE`` | ||||
17 | # The icotool executable. | ||||
18 | # | ||||
19 | # If ``IcoTool_FOUND`` is TRUE, it will also define the following imported | ||||
20 | # target: | ||||
21 | # | ||||
22 | # ``IcoTool::IcoTool`` | ||||
23 | # The icotool executable. | ||||
24 | # | ||||
25 | # Since 5.48. | ||||
26 | | ||||
krop: The next release will be 5.48 | |||||
27 | #============================================================================= | ||||
28 | # Copyright 2017 Vincent Pinon <vpinon@kde.org> | ||||
29 | # Copyright 2014 Alex Merry <alex.merry@kde.org> | ||||
30 | # | ||||
31 | # Redistribution and use in source and binary forms, with or without | ||||
32 | # modification, are permitted provided that the following conditions | ||||
33 | # are met: | ||||
34 | # | ||||
35 | # 1. Redistributions of source code must retain the copyright | ||||
36 | # notice, this list of conditions and the following disclaimer. | ||||
37 | # 2. Redistributions in binary form must reproduce the copyright | ||||
38 | # notice, this list of conditions and the following disclaimer in the | ||||
39 | # documentation and/or other materials provided with the distribution. | ||||
40 | # 3. The name of the author may not be used to endorse or promote products | ||||
41 | # derived from this software without specific prior written permission. | ||||
42 | # | ||||
43 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||||
44 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||||
45 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||||
46 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||||
47 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||||
48 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||||
49 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
50 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
51 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
52 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
53 | #============================================================================= | ||||
54 | | ||||
55 | include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) | ||||
56 | ecm_find_package_version_check(IcoTool) | ||||
57 | find_program(IcoTool_EXECUTABLE NAMES icotool) | ||||
58 | include(FindPackageHandleStandardArgs) | ||||
59 | find_package_handle_standard_args(IcoTool | ||||
60 | FOUND_VAR | ||||
61 | IcoTool_FOUND | ||||
62 | REQUIRED_VARS | ||||
63 | IcoTool_EXECUTABLE | ||||
64 | ) | ||||
65 | mark_as_advanced(IcoTool_EXECUTABLE) | ||||
66 | | ||||
67 | if (IcoTool_FOUND) | ||||
68 | if (NOT TARGET IcoTool::IcoTool) | ||||
69 | add_executable(IcoTool::IcoTool IMPORTED) | ||||
70 | set_target_properties(IcoTool::IcoTool PROPERTIES | ||||
71 | IMPORTED_LOCATION "${IcoTool_EXECUTABLE}" | ||||
72 | ) | ||||
73 | endif() | ||||
74 | endif() | ||||
75 | | ||||
76 | include(FeatureSummary) | ||||
77 | set_package_properties(IcoTool PROPERTIES | ||||
78 | URL "http://www.nongnu.org/icoutils/" | ||||
79 | DESCRIPTION "Executable that converts a collection of PNG files into a Windows icon file" | ||||
80 | ) |