Warning, /frameworks/solid/cmake/FindIMobileDevice.cmake is written in an unsupported language. File is not indexed.

0001 #.rst:
0002 # FindIMobileDevice
0003 # --------
0004 #
0005 # Try to find the imobiledevice library, once done this will define:
0006 #
0007 #  ``IMobileDevice_FOUND``
0008 #      System has libimobiledevice.
0009 #
0010 #  ``IMobileDevice_INCLUDE_DIRS``
0011 #      The libimobiledevice include directory.
0012 #
0013 # ``IMobileDevice_LIBRARIES``
0014 #     The libimobiledevice libraries.
0015 #
0016 # ``IMobileDevice_VERSION``
0017 #     The libimobiledevice version.
0018 #
0019 # If ``IMobileDevice_FOUND`` is TRUE, the following imported target
0020 # will be available:
0021 #
0022 # ``IMobileDevice::IMobileDevice``
0023 #     The libimobiledevice library
0024 
0025 #=============================================================================
0026 # SPDX-FileCopyrightText: 2020 MBition GmbH
0027 # SPDX-FileContributor: Kai Uwe Broulik <kai_uwe.broulik@mbition.io>
0028 #
0029 # SPDX-License-Identifier: BSD-3-Clause
0030 #=============================================================================
0031 
0032 find_package(PkgConfig QUIET)
0033 pkg_check_modules(PC_libimobiledevice QUIET libimobiledevice-1.0)
0034 
0035 find_path(IMobileDevice_INCLUDE_DIRS NAMES libimobiledevice/libimobiledevice.h HINTS ${PC_libimobiledevice_INCLUDE_DIRS})
0036 find_library(IMobileDevice_LIBRARIES NAMES imobiledevice-1.0 imobiledevice HINTS ${PC_libimobiledevice_LIBRARY_DIRS})
0037 
0038 set(IMobileDevice_VERSION ${PC_libimobiledevice_VERSION})
0039 
0040 include(FindPackageHandleStandardArgs)
0041 find_package_handle_standard_args(IMobileDevice
0042     FOUND_VAR IMobileDevice_FOUND
0043     REQUIRED_VARS IMobileDevice_INCLUDE_DIRS IMobileDevice_LIBRARIES
0044     VERSION_VAR IMobileDevice_VERSION
0045 )
0046 
0047 mark_as_advanced(IMobileDevice_INCLUDE_DIRS IMobileDevice_LIBRARIES)
0048 
0049 if(IMobileDevice_FOUND AND NOT TARGET IMobileDevice::IMobileDevice)
0050     # Handle API variations, follow QT_VERSION_CHECK conventions
0051     set(_imobile_version "0x00000")
0052     if (IMobileDevice_VERSION VERSION_GREATER_EQUAL 1.3.0)
0053         set(_imobile_version "0x10300")
0054     elseif(IMobileDevice_VERSION VERSION_GREATER_EQUAL 1.2.0)
0055         set(_imobile_version "0x10200")
0056     endif()
0057 
0058     # Imported target
0059     add_library(IMobileDevice::IMobileDevice UNKNOWN IMPORTED)
0060     set_target_properties(IMobileDevice::IMobileDevice PROPERTIES
0061         IMPORTED_LOCATION "${IMobileDevice_LIBRARIES}"
0062         INTERFACE_INCLUDE_DIRECTORIES "${IMobileDevice_INCLUDE_DIRS}"
0063         INTERFACE_COMPILE_OPTIONS "${PC_libimobiledevice_CFLAGS_OTHER}"
0064         INTERFACE_COMPILE_DEFINITIONS "IMOBILEDEVICE_API=${_imobile_version}"
0065     )
0066 endif()
0067 
0068 include(FeatureSummary)
0069 set_package_properties(IMobileDevice PROPERTIES
0070     DESCRIPTION "library to communicate with iOS devices"
0071     URL "https://www.libimobiledevice.org/"
0072 )