Changeset View
Changeset View
Standalone View
Standalone View
cmake/FindPhoneNumber.cmake
- This file was added.
1 | #.rst: | ||||
---|---|---|---|---|---|
2 | # FindPhoneNumber | ||||
3 | # --------------- | ||||
4 | # | ||||
5 | # This module finds if PhoneNumber is installed. | ||||
6 | # If found, this will define the following variables: | ||||
7 | # | ||||
8 | # ``PhoneNumber_FOUND`` | ||||
9 | # Set to TRUE if PhoneNumber was found. | ||||
10 | # ``PhoneNumber_LIBRARIES`` | ||||
11 | # Path to PhoneNumber libraries. | ||||
12 | # ``PhoneNumber_INCLUDE_DIR`` | ||||
svuorela: "the bsd license" is unfortunately a bit too unspecific, so copying over the full license text… | |||||
I am not finding any additional license terms at the source unfortunately. @dfaure This is your file from https://github.com/KDAB/FatCRM/blob/master/cmake/FindPhoneNumber.cmake, what license is meant there exactly? vkrause: I am not finding any additional license terms at the source unfortunately. @dfaure This is your… | |||||
13 | # Path to the PhoneNumber include directory. | ||||
14 | # ``PhoneNumberGeoCoding_LIBRARIES`` | ||||
15 | # Path to PhoneNumber GeoCodeing libraries. | ||||
16 | # | ||||
17 | # If ``PhoneNumber_FOUND`` is TRUE the following imported targets | ||||
18 | # will be defined: | ||||
19 | # | ||||
20 | # ``PhoneNumber::PhoneNumber`` | ||||
21 | # The PhoneNumber library | ||||
22 | # ``PhoneNumber::GeoCoding`` | ||||
23 | # The PhoneNumber geo coding library | ||||
24 | # | ||||
25 | | ||||
26 | #============================================================================= | ||||
27 | # Copyright (c) 2017 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com | ||||
28 | # Copyright (c) 2018 Volker Krause <vkrause@kde.org> | ||||
29 | # | ||||
30 | # Redistribution and use in source and binary forms, with or without | ||||
31 | # modification, are permitted provided that the following conditions | ||||
32 | # are met: | ||||
33 | # | ||||
svuorela: Doing something with targets would be nice. | |||||
34 | # 1. Redistributions of source code must retain the copyright | ||||
35 | # notice, this list of conditions and the following disclaimer. | ||||
36 | # 2. Redistributions in binary form must reproduce the copyright | ||||
37 | # notice, this list of conditions and the following disclaimer in the | ||||
38 | # documentation and/or other materials provided with the distribution. | ||||
39 | # 3. The name of the author may not be used to endorse or promote products | ||||
40 | # derived from this software without specific prior written permission. | ||||
41 | # | ||||
42 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||||
43 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||||
44 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||||
45 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||||
46 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||||
47 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||||
48 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||||
49 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||||
50 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
51 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
52 | #============================================================================= | ||||
53 | | ||||
54 | include(FindPackageHandleStandardArgs) | ||||
55 | | ||||
56 | find_library(PhoneNumber_LIBRARIES | ||||
57 | NAMES phonenumber | ||||
58 | PATH_SUFFIXES lib | ||||
59 | HINTS ENV PHONENUMBERDIR) | ||||
60 | | ||||
61 | find_path(PhoneNumber_INCLUDE_DIR | ||||
62 | NAMES phonenumbers/phonenumberutil.h | ||||
63 | HINTS ENV PHONENUMBERDIR) | ||||
64 | | ||||
65 | find_library(PhoneNumberGeoCoding_LIBRARIES | ||||
66 | NAMES geocoding | ||||
67 | PATH_SUFFIXES lib | ||||
68 | HINTS ENV PHONENUMBERDIR) | ||||
69 | | ||||
70 | mark_as_advanced(PhoneNumber_LIBRARIES PhoneNumber_INCLUDE_DIR) | ||||
71 | mark_as_advanced(PhoneNumberGeoCoding_LIBRARIES) | ||||
72 | | ||||
73 | find_package_handle_standard_args(PhoneNumber DEFAULT_MSG PhoneNumber_LIBRARIES PhoneNumber_INCLUDE_DIR PhoneNumberGeoCoding_LIBRARIES) | ||||
74 | | ||||
75 | if(PhoneNumber_FOUND AND NOT TARGET PhoneNumber::PhoneNumber) | ||||
76 | add_library(PhoneNumber::PhoneNumber UNKNOWN IMPORTED) | ||||
77 | set_target_properties(PhoneNumber::PhoneNumber PROPERTIES | ||||
78 | IMPORTED_LOCATION "${PhoneNumber_LIBRARIES}" | ||||
79 | INTERFACE_INCLUDE_DIRECTORIES "${PhoneNumber_INCLUDE_DIR}") | ||||
80 | add_library(PhoneNumber::GeoCoding UNKNOWN IMPORTED) | ||||
81 | set_target_properties(PhoneNumber::GeoCoding PROPERTIES | ||||
82 | IMPORTED_LOCATION "${PhoneNumberGeoCoding_LIBRARIES}" | ||||
83 | INTERFACE_INCLUDE_DIRECTORIES "${PhoneNumber_INCLUDE_DIR}") | ||||
84 | endif() | ||||
85 | | ||||
86 | include(FeatureSummary) | ||||
87 | set_package_properties(PhoneNumber PROPERTIES | ||||
88 | URL "https://github.com/googlei18n/libphonenumber" | ||||
89 | DESCRIPTION "Library for parsing, formatting, and validating international phone numbers") |
"the bsd license" is unfortunately a bit too unspecific, so copying over the full license text and placing it next to it is what we in general have done.