-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
103 lines (82 loc) · 3.54 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Copyright (c) 2019-2024 LG Electronics, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 2.8.7)
project(physical-device-manager)
include(webOS/webOS)
webos_modules_init(1 0 0 QUALIFIER RC4)
webos_component(1 0 1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall")
# add include files
include_directories(${CMAKE_SOURCE_DIR}/inc)
include_directories(${CMAKE_SOURCE_DIR}/inc/private)
include_directories(${CMAKE_SOURCE_DIR}/inc/public)
# find required packages
include(FindPkgConfig)
pkg_check_modules(PBNJSON_CPP REQUIRED pbnjson_cpp)
include_directories(${PBNJSON_CPP_INCLUDE_DIRS})
webos_add_compiler_flags(ALL ${PBNJSON_CPP_CFLAGS_OTHER})
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
#include_directories(${GLIB2_INCLUDE_DIRS})
webos_add_compiler_flags(ALL ${GLIB2_CFLAGS})
pkg_check_modules(LUNASERVICE REQUIRED luna-service2)
include_directories(${LUNASERVICE_INCLUDE_DIR})
webos_add_compiler_flags(ALL ${LUNASERVICE_CFLAGS})
pkg_check_modules(LS2 REQUIRED luna-service2++)
include_directories(${LS2_INCLUDE_DIRS})
webos_add_compiler_flags(ALL ${LS2_CFLAGS})
pkg_check_modules(PMLOG REQUIRED PmLogLib)
include_directories(${PMLOG_INCLUDE_DIRS})
webos_add_compiler_flags(ALL ${PMLOG_CFLAGS_OTHER})
pkg_check_modules(WEBOSI18N REQUIRED webosi18n)
include_directories(${WEBOSI18N_INCLUDE_DIRS})
webos_add_compiler_flags(ALL ${WEBOSI18N_CFLAGS_OTHER})
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
include_directories(${LIBUSB_INCLUDE_DIRS})
webos_add_compiler_flags(ALL ${LIBUSB_CFLAGS_OTHER})
if(EXTENSION_WEBOS_AUTO)
add_definitions(-DWEBOS_SESSION)
webos_build_system_bus_files(files/sysbus_auto)
webos_build_configured_file(files/systemd/auto/physical-device-manager.service SYSCONFDIR systemd/system)
else()
webos_build_system_bus_files()
webos_build_configured_file(files/systemd/physical-device-manager.service SYSCONFDIR systemd/system)
endif()
pkg_check_modules(UDEV REQUIRED libudev)
add_subdirectory(snd-ctl)
set(BIN_NAME physical-device-manager)
file(GLOB_RECURSE SRC_FILES ${CMAKE_SOURCE_DIR}/src/*.cpp)
add_executable(${BIN_NAME} ${SRC_FILES})
set(LIB_LIST
${UDEV_LDFLAGS}
${PBNJSON_CPP_LDFLAGS}
${GLIB2_LDFLAGS}
${LUNASERVICE_LDFLAGS}
${PMLOG_LDFLAGS}
${WEBOSI18N_LDFLAGS}
${LIBUSB_LDFLAGS}
${LS2_LDFLAGS}
pthread
-lstdc++fs
dl
)
target_link_libraries (${BIN_NAME} ${LIB_LIST})
webos_include_install_paths()
webos_build_db8_files()
install(TARGETS ${BIN_NAME} DESTINATION sbin)
install(FILES @CMAKE_SOURCE_DIR@/files/rules/39-usb-auto-port.rules DESTINATION @WEBOS_INSTALL_SYSCONFDIR@/udev/rules.d/)
install(DIRECTORY @CMAKE_SOURCE_DIR@/files/rules/ DESTINATION @WEBOS_INSTALL_SYSCONFDIR@/udev/rules.d/ FILES_MATCHING PATTERN "*.rules*" PATTERN ".*" EXCLUDE)
install(DIRECTORY @CMAKE_SOURCE_DIR@/files/icon/ DESTINATION @WEBOS_INSTALL_DATADIR@/@CMAKE_PROJECT_NAME@ FILES_MATCHING PATTERN "*.png*" PATTERN ".*" EXCLUDE)
install(DIRECTORY "inc/public/" DESTINATION @WEBOS_INSTALL_INCLUDEDIR@ FILES_MATCHING PATTERN "*.h*" PATTERN ".*" EXCLUDE)