]>
Commit | Line | Data |
---|---|---|
0ca16147 AM |
1 | From 0325d51c4a2a05fb11b93f0c99d1d08976aac47d Mon Sep 17 00:00:00 2001 |
2 | From: Konstantin Tokarev <annulen@yandex.ru> | |
3 | Date: Thu, 28 Dec 2017 02:22:58 +0300 | |
4 | Subject: [PATCH 111/143] [ECM] Update ECMGeneratePkgConfigFile to latest | |
5 | version, fill in DESCRIPTION | |
6 | ||
7 | Change-Id: Ib9252a02badeb2be4d8da74c9ab38195ded92afd | |
8 | --- | |
9 | Source/WebKit/PlatformQt.cmake | 2 + | |
10 | Source/cmake/ECMGeneratePkgConfigFile.cmake | 60 ++++++++++++++++----- | |
11 | 2 files changed, 50 insertions(+), 12 deletions(-) | |
12 | ||
13 | diff --git a/Source/WebKit/PlatformQt.cmake b/Source/WebKit/PlatformQt.cmake | |
14 | index cf5f3670040..909efc00dba 100644 | |
15 | --- a/Source/WebKit/PlatformQt.cmake | |
16 | +++ b/Source/WebKit/PlatformQt.cmake | |
17 | @@ -502,6 +502,7 @@ endif () | |
18 | if (NOT MACOS_BUILD_FRAMEWORKS) | |
19 | ecm_generate_pkgconfig_file( | |
20 | BASE_NAME Qt5WebKit | |
21 | + DESCRIPTION "Qt WebKit module" | |
22 | DEPS "${WEBKIT_PKGCONGIG_DEPS}" | |
23 | FILENAME_VAR WebKit_PKGCONFIG_FILENAME | |
24 | ) | |
25 | @@ -726,6 +727,7 @@ install( | |
26 | if (NOT MACOS_BUILD_FRAMEWORKS) | |
27 | ecm_generate_pkgconfig_file( | |
28 | BASE_NAME Qt5WebKitWidgets | |
29 | + DESCRIPTION "Qt WebKitWidgets module" | |
30 | DEPS "${WEBKITWIDGETS_PKGCONFIG_DEPS}" | |
31 | FILENAME_VAR WebKitWidgets_PKGCONFIG_FILENAME | |
32 | ) | |
33 | diff --git a/Source/cmake/ECMGeneratePkgConfigFile.cmake b/Source/cmake/ECMGeneratePkgConfigFile.cmake | |
34 | index b4e68663038..09d7e2b476d 100644 | |
35 | --- a/Source/cmake/ECMGeneratePkgConfigFile.cmake | |
36 | +++ b/Source/cmake/ECMGeneratePkgConfigFile.cmake | |
37 | @@ -16,6 +16,7 @@ | |
38 | # [INCLUDE_INSTALL_DIR <dir>] | |
39 | # [LIB_INSTALL_DIR <dir>] | |
40 | # [DEFINES -D<variable=value>...] | |
41 | +# [DESCRIPTION <library description>] | |
42 | # [INSTALL]) | |
43 | # | |
44 | # ``BASE_NAME`` is the name of the module. It's the name projects will use to | |
45 | @@ -42,6 +43,10 @@ | |
46 | # ``DEFINES`` is a list of preprocessor defines that it is recommended users of | |
47 | # the library pass to the compiler when using it. | |
48 | # | |
49 | +# ``DESCRIPTION`` describes what this library is. If it's not specified, CMake | |
50 | +# will first try to get the description from the metainfo.yaml file or will | |
51 | +# create one based on ``LIB_NAME``. | |
52 | +# | |
53 | # ``INSTALL`` will cause the module to be installed to the ``pkgconfig`` | |
54 | # subdirectory of ``LIB_INSTALL_DIR``, unless the ``ECM_PKGCONFIG_INSTALL_DIR`` | |
55 | # cache variable is set to something different. Note that the first call to | |
56 | @@ -66,24 +71,39 @@ | |
57 | # ) | |
58 | # | |
59 | # Since 1.3.0. | |
60 | +# ``DESCRIPTION`` available since 5.1.41 | |
61 | +# | |
62 | ||
63 | #============================================================================= | |
64 | # Copyright 2014 Aleix Pol Gonzalez <aleixpol@kde.org> | |
65 | # Copyright 2014 David Faure <faure@kde.org> | |
66 | # | |
67 | -# Distributed under the OSI-approved BSD License (the "License"); | |
68 | -# see accompanying file COPYING-CMAKE-SCRIPTS for details. | |
69 | -# | |
70 | -# This software is distributed WITHOUT ANY WARRANTY; without even the | |
71 | -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
72 | -# See the License for more information. | |
73 | -#============================================================================= | |
74 | -# (To distribute this file outside of extra-cmake-modules, substitute the full | |
75 | -# License text for the above reference.) | |
76 | +# Redistribution and use in source and binary forms, with or without | |
77 | +# modification, are permitted provided that the following conditions | |
78 | +# are met: | |
79 | +# | |
80 | +# 1. Redistributions of source code must retain the copyright | |
81 | +# notice, this list of conditions and the following disclaimer. | |
82 | +# 2. Redistributions in binary form must reproduce the copyright | |
83 | +# notice, this list of conditions and the following disclaimer in the | |
84 | +# documentation and/or other materials provided with the distribution. | |
85 | +# 3. The name of the author may not be used to endorse or promote products | |
86 | +# derived from this software without specific prior written permission. | |
87 | +# | |
88 | +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
89 | +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
90 | +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
91 | +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
92 | +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
93 | +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
94 | +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
95 | +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
96 | +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
97 | +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
98 | ||
99 | function(ECM_GENERATE_PKGCONFIG_FILE) | |
100 | set(options INSTALL) | |
101 | - set(oneValueArgs BASE_NAME LIB_NAME FILENAME_VAR INCLUDE_INSTALL_DIR LIB_INSTALL_DIR) | |
102 | + set(oneValueArgs BASE_NAME LIB_NAME FILENAME_VAR INCLUDE_INSTALL_DIR LIB_INSTALL_DIR DESCRIPTION) | |
103 | set(multiValueArgs DEPS DEFINES) | |
104 | ||
105 | cmake_parse_arguments(EGPF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | |
106 | @@ -119,6 +139,17 @@ function(ECM_GENERATE_PKGCONFIG_FILE) | |
107 | set(EGPF_LIB_INSTALL_DIR "lib") | |
108 | endif() | |
109 | endif() | |
110 | + if(NOT EGPF_DESCRIPTION) | |
111 | + if(EXISTS ${CMAKE_SOURCE_DIR}/metainfo.yaml) | |
112 | + file(STRINGS "${CMAKE_SOURCE_DIR}/metainfo.yaml" _EGPF_METAINFO_DESCRIPTION_STRING REGEX "^description:.*$") | |
113 | + if(_EGPF_METAINFO_DESCRIPTION_STRING) | |
114 | + string(REGEX REPLACE "^description:[ ]*(.*)" "\\1" EGPF_DESCRIPTION ${_EGPF_METAINFO_DESCRIPTION_STRING}) | |
115 | + endif() | |
116 | + endif() | |
117 | + if("${EGPF_DESCRIPTION}" STREQUAL "") | |
118 | + set(EGPF_DESCRIPTION "${EGPF_LIB_NAME} library.") | |
119 | + endif() | |
120 | + endif() | |
121 | ||
122 | set(PKGCONFIG_TARGET_BASENAME ${EGPF_BASE_NAME}) | |
123 | set(PKGCONFIG_TARGET_LIBNAME ${EGPF_LIB_NAME}) | |
124 | @@ -135,6 +166,7 @@ function(ECM_GENERATE_PKGCONFIG_FILE) | |
125 | else() | |
126 | set(PKGCONFIG_TARGET_LIBS "${CMAKE_INSTALL_PREFIX}/${EGPF_LIB_INSTALL_DIR}") | |
127 | endif() | |
128 | + set(PKGCONFIG_TARGET_DESCRIPTION "${EGPF_DESCRIPTION}") | |
129 | set(PKGCONFIG_TARGET_DEFINES "") | |
130 | if(EGPF_DEFINES) | |
131 | set(PKGCONFIG_TARGET_DEFINES "${EGPF_DEFINE}") | |
132 | @@ -148,6 +180,7 @@ function(ECM_GENERATE_PKGCONFIG_FILE) | |
133 | file(WRITE ${PKGCONFIG_FILENAME} | |
134 | " | |
135 | Name: ${PKGCONFIG_TARGET_LIBNAME} | |
136 | +Description: ${PKGCONFIG_TARGET_DESCRIPTION} | |
137 | Version: ${PROJECT_VERSION} | |
138 | Libs: -L${CMAKE_INSTALL_PREFIX}/${EGPF_LIB_INSTALL_DIR} -l${PKGCONFIG_TARGET_LIBNAME} | |
139 | Cflags: ${PKGCONFIG_TARGET_INCLUDES} ${PKGCONFIG_TARGET_DEFINES} | |
140 | @@ -156,8 +189,11 @@ Requires: ${PKGCONFIG_TARGET_DEPS} | |
141 | ) | |
142 | ||
143 | if(EGPF_INSTALL) | |
144 | - set(ECM_PKGCONFIG_INSTALL_DIR "${EGPF_LIB_INSTALL_DIR}/pkgconfig" CACHE PATH "The directory where pkgconfig will be installed to.") | |
145 | + if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") | |
146 | + set(ECM_PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig" CACHE PATH "The directory where pkgconfig will be installed to.") | |
147 | + else() | |
148 | + set(ECM_PKGCONFIG_INSTALL_DIR "${EGPF_LIB_INSTALL_DIR}/pkgconfig" CACHE PATH "The directory where pkgconfig will be installed to.") | |
149 | + endif() | |
150 | install(FILES ${PKGCONFIG_FILENAME} DESTINATION ${ECM_PKGCONFIG_INSTALL_DIR}) | |
151 | endif() | |
152 | endfunction() | |
153 | - | |
154 | -- | |
155 | 2.17.1 | |
156 |