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
44 src/commandline_sdbd.c
47 include_directories(src)
50 list(APPEND sdbd_SRCS src/usb_funcfs_client.c)
52 list(APPEND sdbd_SRCS src/usb_linux_client.c)
55 add_executable(sdbd ${sdbd_SRCS})
59 PROPERTY COMPILE_DEFINITIONS
67 APPEND PROPERTY COMPILE_DEFINITIONS
76 APPEND PROPERTY COMPILE_DEFINITIONS
81 include(FindPkgConfig)
83 # Get capi-system-info
84 pkg_check_modules(CAPI_SYSTEM_INFO REQUIRED capi-system-info)
85 include_directories(${CAPI_SYSTEM_INFO_INCLUDE_DIRS})
88 find_package(Threads REQUIRED)
90 # Add libraries (-l...)
91 target_link_libraries (sdbd ${CMAKE_THREAD_LIBS_INIT} ${CAPI_SYSTEM_INFO_LDFLAGS})
93 install(TARGETS sdbd DESTINATION /usr/sbin)
94 install(FILES script/sdbd DESTINATION /etc/init.d)
97 # Optionally build unit tests binary -- could be helpful during further development
100 add_subdirectory(test)