1d4afb5ceSopenharmony_ci#
2d4afb5ceSopenharmony_ci# libwebsockets - small server side websockets and web server implementation
3d4afb5ceSopenharmony_ci#
4d4afb5ceSopenharmony_ci# Copyright (C) 2010 - 2020 Andy Green <andy@warmcat.com>
5d4afb5ceSopenharmony_ci#
6d4afb5ceSopenharmony_ci# Permission is hereby granted, free of charge, to any person obtaining a copy
7d4afb5ceSopenharmony_ci# of this software and associated documentation files (the "Software"), to
8d4afb5ceSopenharmony_ci# deal in the Software without restriction, including without limitation the
9d4afb5ceSopenharmony_ci# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10d4afb5ceSopenharmony_ci# sell copies of the Software, and to permit persons to whom the Software is
11d4afb5ceSopenharmony_ci# furnished to do so, subject to the following conditions:
12d4afb5ceSopenharmony_ci#
13d4afb5ceSopenharmony_ci# The above copyright notice and this permission notice shall be included in
14d4afb5ceSopenharmony_ci# all copies or substantial portions of the Software.
15d4afb5ceSopenharmony_ci#
16d4afb5ceSopenharmony_ci# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17d4afb5ceSopenharmony_ci# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18d4afb5ceSopenharmony_ci# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19d4afb5ceSopenharmony_ci# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20d4afb5ceSopenharmony_ci# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21d4afb5ceSopenharmony_ci# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22d4afb5ceSopenharmony_ci# IN THE SOFTWARE.
23d4afb5ceSopenharmony_ci#
24d4afb5ceSopenharmony_ci# The strategy is to only export to PARENT_SCOPE
25d4afb5ceSopenharmony_ci#
26d4afb5ceSopenharmony_ci#  - changes to LIB_LIST
27d4afb5ceSopenharmony_ci#  - changes to SOURCES
28d4afb5ceSopenharmony_ci#  - includes via include_directories
29d4afb5ceSopenharmony_ci#
30d4afb5ceSopenharmony_ci# and keep everything else private
31d4afb5ceSopenharmony_ci
32d4afb5ceSopenharmony_ciinclude_directories(.)
33d4afb5ceSopenharmony_ci
34d4afb5ceSopenharmony_cilist(APPEND SOURCES
35d4afb5ceSopenharmony_ci	roles/dbus/dbus.c)
36d4afb5ceSopenharmony_ci	
37d4afb5ceSopenharmony_ciif (NOT LWS_DBUS_LIB)
38d4afb5ceSopenharmony_ci	set(LWS_DBUS_LIB "dbus-1")
39d4afb5ceSopenharmony_ciendif()
40d4afb5ceSopenharmony_ci
41d4afb5ceSopenharmony_cifind_package(PkgConfig QUIET)
42d4afb5ceSopenharmony_cipkg_check_modules(PC_DBUS1 dbus-1 QUIET)
43d4afb5ceSopenharmony_cilist(APPEND LWS_DBUS_INCLUDE1 ${PC_DBUS1_INCLUDE_DIRS})
44d4afb5ceSopenharmony_cilist(APPEND LWS_DBUS_LIB ${PC_DBUS1_LIBRARIES})
45d4afb5ceSopenharmony_cilist(APPEND LWS_DEPS_LIB_PATHS ${PC_DBUS1_LIBRARY_DIRS})
46d4afb5ceSopenharmony_ci
47d4afb5ceSopenharmony_ciset(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${LWS_DBUS_INCLUDE1})
48d4afb5ceSopenharmony_ci
49d4afb5ceSopenharmony_ciCHECK_C_SOURCE_COMPILES("#include <dbus/dbus.h>
50d4afb5ceSopenharmony_ciint main(void) {
51d4afb5ceSopenharmony_ci	return 0;
52d4afb5ceSopenharmony_ci}" LWS_DBUS_CHECK_OK)
53d4afb5ceSopenharmony_ci
54d4afb5ceSopenharmony_cimessage("dbus include dir 1: ${LWS_DBUS_INCLUDE1}")
55d4afb5ceSopenharmony_ciif (LWS_DBUS_INCLUDE1)
56d4afb5ceSopenharmony_ciinclude_directories("${LWS_DBUS_INCLUDE1}")
57d4afb5ceSopenharmony_ciendif()
58d4afb5ceSopenharmony_cilist(APPEND LIB_LIST ${LWS_DBUS_LIB})
59d4afb5ceSopenharmony_ci
60d4afb5ceSopenharmony_ci#
61d4afb5ceSopenharmony_ci# Keep explicit parent scope exports at end
62d4afb5ceSopenharmony_ci#
63d4afb5ceSopenharmony_ci
64d4afb5ceSopenharmony_ciexports_to_parent_scope()
65d4afb5ceSopenharmony_ciset(LWS_DBUS_CHECK_OK ${LWS_DBUS_CHECK_OK} PARENT_SCOPE)
66d4afb5ceSopenharmony_ciset(LWS_DEPS_LIB_PATHS ${LWS_DEPS_LIB_PATHS} PARENT_SCOPE)
67d4afb5ceSopenharmony_ci
68