# TelepathyQt5Config.cmake is generated by CMake from TelepathyQt/TelepathyQtConfig.cmake.in.
# Any changed value in this file will be overwritten by CMake.

if(NOT TelepathyQt5_FOUND)

    
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was TelepathyQtConfig.cmake.in                            ########

get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)

macro(set_and_check _var _file)
  set(${_var} "${_file}")
  if(NOT EXISTS "${_file}")
    message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
  endif()
endmacro()

####################################################################################

    # set the version number
    set(TELEPATHY_QT5_VERSION_MAJOR 0)
    set(TELEPATHY_QT5_VERSION_MINOR 9)
    set(TELEPATHY_QT5_VERSION_MICRO 8)
    set(TELEPATHY_QT5_VERSION_NANO 0)
    set(TELEPATHY_QT5_VERSION 0.9.8)

    # Find the dependencies
    include(CMakeFindDependencyMacro)

    # Base Qt components set
    set(_QT_COMPONENTS Core DBus Network)

    if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.9)
        find_dependency(Qt5  COMPONENTS ${_QT_COMPONENTS})
    else()
        # Old CMake versions do not support COMPONENTS in find_dependency
        foreach(_QT_MODULE ${_QT_COMPONENTS})
            find_dependency(Qt5${_QT_MODULE} )
        endforeach()
    endif()
    unset(_QT_COMPONENTS)

    # attempt to find the generated Targets file in the same directory
    get_filename_component(_TPQT5_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
    find_file(_TPQT5_TARGETS_FILE TelepathyQt5Targets.cmake PATHS ${_TPQT5_CONFIG_DIR} NO_DEFAULT_PATH)

    include(${_TPQT5_TARGETS_FILE})

    set(_TelepathyQt5_NOTFOUND_MESSAGE)
    set(_WANTED_COMPONENTS "${TelepathyQt5_FIND_COMPONENTS}")
    list (FIND _WANTED_COMPONENTS "Core" _CORE_INDEX)
    if (${_CORE_INDEX} LESS 0)
        list(APPEND _WANTED_COMPONENTS Core)
    endif()
    foreach(_MODULE ${_WANTED_COMPONENTS})
        if(NOT TARGET TelepathyQt5::${_MODULE})
            if (TelepathyQt5_FIND_REQUIRED_${_MODULE})
                set(_TelepathyQt5_NOTFOUND_MESSAGE
                    "${_TelepathyQt5_NOTFOUND_MESSAGE}Failed to find TelepathyQt5 component \"${_MODULE}\"\n")
            elseif(NOT TelepathyQt5_FIND_QUIETLY)
                message(WARNING "Failed to find TelepathyQt5 component \"${_MODULE}\"")
            endif()
        endif()
    endforeach()

    if (_TelepathyQt5_NOTFOUND_MESSAGE)
        set(TelepathyQt5_NOT_FOUND_MESSAGE "${_TelepathyQt5_NOTFOUND_MESSAGE}")
        set(TelepathyQt5_FOUND False)
    endif()

    # Legacy stuff for old-style import

    # set the LIBRARIES variable
    get_target_property(TELEPATHY_QT5_LIBRARIES
        TelepathyQt5::Core
        IMPORTED_LOCATION
    )

    if(NOT TELEPATHY_QT5_LIBRARIES)
        # If there is no default IMPORTED_LOCATION then get all configurations...
        get_target_property(_IMPORTED_CONFIGURATIONS
            TelepathyQt5::Core
            IMPORTED_CONFIGURATIONS
        )
        # ... and pick up the first one
        list(GET _IMPORTED_CONFIGURATIONS 0 _SELECTED_CONFIGURATION)
        get_target_property(TELEPATHY_QT5_LIBRARIES
            TelepathyQt5::Core
            IMPORTED_LOCATION_${_SELECTED_CONFIGURATION}
        )
        unset(_IMPORTED_CONFIGURATIONS)
        unset(_SELECTED_CONFIGURATION)
    endif()

    get_target_property(TELEPATHY_QT5_INCLUDE_DIR
        TelepathyQt5::Core
        INTERFACE_INCLUDE_DIRECTORIES
    )
endif()
