Warning, /multimedia/amarok/cmake/modules/FindMtp.cmake is written in an unsupported language. File is not indexed.
0001 # - Try to find the libmtp library 0002 # Once done this will define 0003 # 0004 # MTP_FOUND - system has libmtp 0005 # MTP_INCLUDE_DIR - the libmtp include directory 0006 # MTP_LIBRARIES - Link these to use libmtp 0007 # MTP_DEFINITIONS - Compiler switches required for using libmtp 0008 # 0009 0010 find_package(PkgConfig QUIET) 0011 pkg_check_modules(PC_MTP QUIET libmtp>=${Mtp_FIND_VERSION}) 0012 0013 set(MTP_DEFINITIONS ${PC_MTP_CFLAGS}) 0014 0015 find_path(MTP_INCLUDE_DIR 0016 NAMES libmtp.h 0017 HINTS ${PC_MTP__INCLUDEDIR} ${PC_MTP_INCLUDE_DIRS} 0018 ) 0019 0020 find_library(MTP_LIBRARIES 0021 NAMES mtp 0022 HINTS ${PC_MTP_LIBDIR} ${PC_MTP_LIBRARY_DIRS} 0023 ) 0024 0025 if(PC_MTP_VERSION) 0026 set(MTP_VERSION_STRING ${PC_MTP_VERSION}) 0027 elseif(MTP_INCLUDE_DIR AND EXISTS "${MTP_INCLUDE_DIR}/libmtp.h") 0028 file(STRINGS "${MTP_INCLUDE_DIR}/libmtp.h" mtp_version_str 0029 REGEX "^#define[\t ]+LIBMTP_VERSION_STRING[\t ]+\".*\"") 0030 0031 string(REGEX REPLACE "^#define[\t ]+LIBMTP_VERSION_STRING[\t ]+\"([^\"]*)\".*" "\\1" 0032 MTP_VERSION_STRING "${mtp_version_str}") 0033 unset(mtp_version_str) 0034 endif() 0035 0036 include(FindPackageHandleStandardArgs) 0037 find_package_handle_standard_args(Mtp 0038 REQUIRED_VARS MTP_LIBRARIES MTP_INCLUDE_DIR 0039 VERSION_VAR MTP_VERSION_STRING 0040 ) 0041 0042 if(MTP_FOUND AND NOT TARGET Mtp::Mtp) 0043 add_library(Mtp::Mtp UNKNOWN IMPORTED) 0044 set_target_properties(Mtp::Mtp PROPERTIES 0045 IMPORTED_LOCATION "${MTP_LIBRARIES}" 0046 INTERFACE_INCLUDE_DIRECTORIES "${MTP_INCLUDE_DIR}") 0047 endif() 0048 0049 mark_as_advanced(MTP_INCLUDE_DIR MTP_LIBRARIES) 0050 set_package_properties(Mtp PROPERTIES 0051 URL "http://libmtp.sourceforge.net/" 0052 DESCRIPTION "An implementation of Microsoft's Media Transfer Protocol (MTP)" 0053 )