This repository has been archived by the owner on Oct 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
67 lines (53 loc) · 1.78 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.0)
project(hfd-service)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include(FindPkgConfig)
include(GNUInstallDirs)
pkg_check_modules(UDEV REQUIRED libudev)
option(ENABLE_LIBHYBRIS "Enable libhybris support" ON)
if (ENABLE_LIBHYBRIS)
pkg_check_modules(ANDROID_HEADERS android-headers)
pkg_check_modules(ANDROID_HARDWARE libhardware)
if(ANDROID_HEADERS_FOUND AND ANDROID_HARDWARE_FOUND)
message(STATUS "Bulding with libhybris support")
set(HAVE_LIBHYBRIS true)
else()
message(WARNING "Bulding without libhybris support, missing required dependencies!")
endif()
else()
message(STATUS "Bulding without libhybris support")
endif()
option(ENABLE_LIBGBINDER "Enable libgbinder support" ON)
if (ENABLE_LIBGBINDER)
pkg_check_modules(GLIB_UTIL libglibutil)
pkg_check_modules(GBINDER libgbinder)
if(GLIB_UTIL_FOUND AND GBINDER_FOUND)
message(STATUS "Bulding with libgbinder support")
set(HAVE_LIBGBINDER true)
else()
message(WARNING "Bulding without libgbinder support, missing required dependencies!")
endif()
else()
message(STATUS "Bulding without libgbinder support")
endif()
find_package(Qt5Core REQUIRED)
find_package(Qt5DBus REQUIRED)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
add_subdirectory(src)
add_subdirectory(tools)
add_subdirectory(qt)
# Dbus file
install(FILES data/hfd-service.conf
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/init
)
# Dbus policy
install(FILES data/com.lomiri.hfd.conf
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/dbus-1/system.d
)
# Dbus service file
configure_file(data/com.lomiri.hfd.service.in com.lomiri.hfd.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/com.lomiri.hfd.service
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/system-services
)