#
# Redistribution and use, with or without modification, are permitted
# provided that the following conditions are met:
#
# Redistribution and use, with or without modification, are permitted
# provided that the following conditions are met:
# 1. Redistributions must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior
# written permission.
# 1. Redistributions must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior
# written permission.
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
message(STATUS "checking for modules '${_pkg_check_modules_list}'")
endif(_pkg_check_modules_cnt EQUAL 1)
endif(NOT ${_is_silent})
message(STATUS "checking for modules '${_pkg_check_modules_list}'")
endif(_pkg_check_modules_cnt EQUAL 1)
endif(NOT ${_is_silent})
if (_pkg_check_modules_pkg_op STREQUAL "=")
list(APPEND _pkg_check_modules_exist_query --exact-version)
endif(_pkg_check_modules_pkg_op STREQUAL "=")
if (_pkg_check_modules_pkg_op STREQUAL "=")
list(APPEND _pkg_check_modules_exist_query --exact-version)
endif(_pkg_check_modules_pkg_op STREQUAL "=")
if (_pkg_check_modules_pkg_op STREQUAL "<=")
list(APPEND _pkg_check_modules_exist_query --max-version)
endif(_pkg_check_modules_pkg_op STREQUAL "<=")
# create the final query which is of the format:
# * --atleast-version <version> <pkg-name>
if (_pkg_check_modules_pkg_op STREQUAL "<=")
list(APPEND _pkg_check_modules_exist_query --max-version)
endif(_pkg_check_modules_pkg_op STREQUAL "<=")
# create the final query which is of the format:
# * --atleast-version <version> <pkg-name>
else(_pkg_check_modules_failed)
# when we are here, we checked whether requested modules
# exist. Now, go through them and set variables
else(_pkg_check_modules_failed)
# when we are here, we checked whether requested modules
# exist. Now, go through them and set variables
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION "" --modversion )
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX "" --variable=prefix )
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR "" --variable=includedir )
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION "" --modversion )
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX "" --variable=prefix )
_pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR "" --variable=includedir )
message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found")
endif(${_pkg_is_required})
endif(NOT ${_prefix}_FOUND)
message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found")
endif(${_pkg_is_required})
endif(NOT ${_prefix}_FOUND)