Blame cmake/FindDbusGlib.cmake

Packit 1fb8d4
# DbusGlib library detection
Packit 1fb8d4
#
Packit 1fb8d4
# Copyright 2013 Thincast Technologies GmbH
Packit 1fb8d4
# Copyright 2013 Armin Novak <armin.novak@thincast.com>
Packit 1fb8d4
#
Packit 1fb8d4
# Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
# you may not use this file except in compliance with the License.
Packit 1fb8d4
# You may obtain a copy of the License at
Packit 1fb8d4
#
Packit 1fb8d4
#     http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
#
Packit 1fb8d4
# Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
# distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
# See the License for the specific language governing permissions and
Packit 1fb8d4
# limitations under the License.
Packit 1fb8d4
Packit 1fb8d4
find_package(PkgConfig)
Packit 1fb8d4
pkg_check_modules(PC_DBUS_GLIB QUIET dbus-glib-1)
Packit 1fb8d4
set(DBUS_GLIB_DEFINITIONS ${PC_DBUS_GLIB_CFLAGS_OTHER})
Packit 1fb8d4
Packit 1fb8d4
find_path(DBUS_GLIB_INCLUDE_DIR dbus/dbus-glib.h
Packit 1fb8d4
          HINTS ${PC_DBUS_GLIB_INCLUDEDIR} ${PC_DBUS_GLIB_INCLUDE_DIRS}
Packit 1fb8d4
          PATH_SUFFIXES dbus-glib-1 )
Packit 1fb8d4
Packit 1fb8d4
find_library(DBUS_GLIB_LIBRARY NAMES dbus-glib-1 dbus-glib
Packit 1fb8d4
             HINTS ${PC_DBUS_GLIB_LIBDIR} ${PC_DBUS_GLIB_LIBRARY_DIRS} )
Packit 1fb8d4
Packit 1fb8d4
set(DBUS_GLIB_LIBRARIES ${DBUS_GLIB_LIBRARY} )
Packit 1fb8d4
set(DBUS_GLIB_INCLUDE_DIRS ${DBUS_GLIB_INCLUDE_DIR} )
Packit 1fb8d4
Packit 1fb8d4
include(FindPackageHandleStandardArgs)
Packit 1fb8d4
# handle the QUIETLY and REQUIRED arguments and set DBUS_GLIB_FOUND to TRUE
Packit 1fb8d4
# if all listed variables are TRUE
Packit 1fb8d4
find_package_handle_standard_args(dbus-glib  DEFAULT_MSG
Packit 1fb8d4
                                  DBUS_GLIB_LIBRARY DBUS_GLIB_INCLUDE_DIR)
Packit 1fb8d4
Packit 1fb8d4
if(DBUS_GLIB_LIBRARIES AND DBUS_GLIB_INCLUDE_DIRS)
Packit 1fb8d4
          set(DBUS_GLIB_FOUND TRUE)
Packit 1fb8d4
endif()
Packit 1fb8d4
                                  
Packit 1fb8d4
mark_as_advanced(DBUS_GLIB_INCLUDE_DIR DBUS_GLIB_LIBRARY)