5
# This module finds if PhoneNumber is installed.
7
# This is a component-based find module, which makes use of the COMPONENTS and
8
# OPTIONAL_COMPONENTS arguments to find_module. The following components are
14
# If no components are specified, this module will act as though all components
15
# were passed to OPTIONAL_COMPONENTS.
17
# This module will define the following variables, independently of the
18
# components searched for or found:
20
# ``PhoneNumber_FOUND``
21
# True if (the requestion version of) PhoneNumber is available
23
# For each searched-for components, ``PhoneNumber_<component>_FOUND`` will be set to
24
# TRUE if the corresponding library was found, and FALSE otherwise. If
25
# ``PhoneNumber_<component>_FOUND`` is TRUE, the imported target ``PhoneNumber::<component>``
30
#=============================================================================
31
# Copyright (c) 2017 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
32
# Copyright (c) 2018 Volker Krause <vkrause@kde.org>
34
# Redistribution and use in source and binary forms, with or without
35
# modification, are permitted provided that the following conditions
38
# 1. Redistributions of source code must retain the copyright
39
# notice, this list of conditions and the following disclaimer.
40
# 2. Redistributions in binary form must reproduce the copyright
41
# notice, this list of conditions and the following disclaimer in the
42
# documentation and/or other materials provided with the distribution.
43
# 3. The name of the author may not be used to endorse or promote products
44
# derived from this software without specific prior written permission.
46
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
47
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
48
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
49
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
50
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
51
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
52
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
53
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
54
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
55
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56
#=============================================================================
58
include(ECMFindModuleHelpersStub)
60
ecm_find_package_version_check(PhoneNumber)
62
set(PhoneNumber_known_components
66
set(PhoneNumber_default_components ${PhoneNumber_known_components})
68
set(PhoneNumber_PhoneNumber_lib phonenumber)
69
set(PhoneNumber_PhoneNumber_header phonenumbers/phonenumberutil.h)
70
set(PhoneNumber_GeoCoding_lib geocoding)
71
set(PhoneNumber_GeoCoding_header phonenumbers/geocoding/phonenumber_offline_geocoder.h)
73
ecm_find_package_parse_components(PhoneNumber
74
RESULT_VAR PhoneNumber_components
75
KNOWN_COMPONENTS ${PhoneNumber_known_components}
76
DEFAULT_COMPONENTS ${PhoneNumber_default_components}
78
ecm_find_package_handle_library_components(PhoneNumber
79
COMPONENTS ${PhoneNumber_components}
81
find_package_handle_standard_args(PhoneNumber
90
set(PhoneNumber_VERSION 0) # there is no observable version number in the installed files
92
include(FeatureSummary)
93
set_package_properties(PhoneNumber PROPERTIES
94
URL "https://github.com/googlei18n/libphonenumber"
95
DESCRIPTION "Library for parsing, formatting, and validating international phone numbers")