Backported #6865: Disable websockets command line option
[platform/upstream/freerdp.git] / cmake / FindDbusGlib.cmake
1 # DbusGlib library detection
2 #
3 # Copyright 2013 Thincast Technologies GmbH
4 # Copyright 2013 Armin Novak <armin.novak@thincast.com>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17
18 find_package(PkgConfig)
19 pkg_check_modules(PC_DBUS_GLIB QUIET dbus-glib-1)
20 set(DBUS_GLIB_DEFINITIONS ${PC_DBUS_GLIB_CFLAGS_OTHER})
21
22 find_path(DBUS_GLIB_INCLUDE_DIR dbus/dbus-glib.h
23           HINTS ${PC_DBUS_GLIB_INCLUDEDIR} ${PC_DBUS_GLIB_INCLUDE_DIRS}
24           PATH_SUFFIXES dbus-glib-1 )
25
26 find_library(DBUS_GLIB_LIBRARY NAMES dbus-glib-1 dbus-glib
27              HINTS ${PC_DBUS_GLIB_LIBDIR} ${PC_DBUS_GLIB_LIBRARY_DIRS} )
28
29 set(DBUS_GLIB_LIBRARIES ${DBUS_GLIB_LIBRARY} )
30 set(DBUS_GLIB_INCLUDE_DIRS ${DBUS_GLIB_INCLUDE_DIR} )
31
32 include(FindPackageHandleStandardArgs)
33 # handle the QUIETLY and REQUIRED arguments and set DBUS_GLIB_FOUND to TRUE
34 # if all listed variables are TRUE
35 find_package_handle_standard_args(dbus-glib  DEFAULT_MSG
36                                   DBUS_GLIB_LIBRARY DBUS_GLIB_INCLUDE_DIR)
37
38 if(DBUS_GLIB_LIBRARIES AND DBUS_GLIB_INCLUDE_DIRS)
39           set(DBUS_GLIB_FOUND TRUE)
40 endif()
41                                   
42 mark_as_advanced(DBUS_GLIB_INCLUDE_DIR DBUS_GLIB_LIBRARY)