1 # Copyright (c) 2014 Samsung Electronics Co., Ltd
3 # Licensed under the Apache License, Version 2.0 (the License);
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an AS IS BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 cmake_minimum_required (VERSION 2.8.3)
19 option(USE_FUNCTION_FS "Use FunctionFS" NO)
20 option(BUILD_UNIT_TESTS "Build unit tests" NO)
30 src/file_sync_service.c
32 src/socket_inaddr_any_server.c
33 src/socket_local_client.c
34 src/socket_local_server.c
35 src/socket_loopback_client.c
36 src/socket_loopback_server.c
37 src/socket_network_client.c
43 src/commandline_sdbd.c
44 src/usb_linux_client.c
45 src/usb_funcfs_client.c
48 include_directories(src)
50 add_executable(sdbd ${sdbd_SRCS})
54 PROPERTY COMPILE_DEFINITIONS
62 APPEND PROPERTY COMPILE_DEFINITIONS
71 APPEND PROPERTY COMPILE_DEFINITIONS
76 ADD_DEFINITIONS("-fPIE")
78 include(FindPkgConfig)
80 # Get capi-system-info
81 pkg_check_modules(CAPI_SYSTEM_INFO REQUIRED capi-system-info libtzplatform-config)
82 include_directories(${CAPI_SYSTEM_INFO_INCLUDE_DIRS})
85 find_package(Threads REQUIRED)
87 # Add libraries (-l...)
88 target_link_libraries (sdbd -pie -lsmack ${CMAKE_THREAD_LIBS_INIT} ${CAPI_SYSTEM_INFO_LDFLAGS})
90 install(TARGETS sdbd DESTINATION /usr/sbin)
91 install(FILES script/sdbd DESTINATION /etc/init.d)
94 # Optionally build unit tests binary -- could be helpful during further development
97 add_subdirectory(test)