2 # Copyright (c) 2017 TOYOTA MOTOR CORPORATION
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 cmake_minimum_required(VERSION 3.0)
19 set(TARGETS_SMBINDER soundmanager-binding)
24 pkg_check_modules(sm_binding_depends afb-daemon glib-2.0 gio-2.0 gio-unix-2.0 json-c)
25 set(binding_sm_sources
28 dbus/audio_manager_interface.c)
30 include_directories(dbus)
31 link_libraries(-Wl,--as-needed -Wl,--gc-sections -Wl,--no-undefined)
33 add_library(${TARGETS_SMBINDER} MODULE ${binding_sm_sources})
35 target_compile_options(${TARGETS_SMBINDER} PRIVATE ${sm_binding_depends_CFLAGS})
37 target_compile_options(${TARGETS_SMBINDER} PRIVATE -g -O0)
38 else(DEFINED DEBUGMODE)
39 target_compile_options(${TARGETS_SMBINDER} PRIVATE -g -O2)
40 endif(DEFINED DEBUGMODE)
42 target_include_directories(${TARGETS_SMBINDER} PRIVATE ${sm_binding_depends_INCLUDE_DIRS})
43 target_link_libraries(${TARGETS_SMBINDER} ${CMAKE_THREAD_LIBS_INIT} ${link_libraries} ${sm_binding_depends_LIBRARIES})
45 # Binder exposes a unique public entry point
47 set_target_properties(${TARGETS_SMBINDER} PROPERTIES
49 LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map"
52 # installation directory
53 INSTALL(TARGETS ${TARGETS_SMBINDER}
54 LIBRARY DESTINATION ${binding_install_dir})