-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
39 lines (31 loc) · 1.43 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.9)
PROJECT(mtp-responder)
INCLUDE(FindPkgConfig)
SET(EXTRA_FLAGS "-Wall -Werror -fvisibility=hidden")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS} -std=c++11")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
SET(REQUIRED_PKGS capi-content-media-content capi-media-metadata-extractor
capi-system-info dlog glib-2.0 libsystemd storage tapi vconf
)
PKG_CHECK_MODULES(PKGS REQUIRED ${REQUIRED_PKGS})
INCLUDE_DIRECTORIES(${PKGS_INCLUDE_DIRS})
LINK_DIRECTORIES(${PKGS_LIBRARY_DIRS})
IF(BUILD_GCOV)
ADD_DEFINITIONS("-DTIZEN_TEST_GCOV")
ENDIF(BUILD_GCOV)
FILE(GLOB SRCS src/*.c)
ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LIBRARIES} pthread gcrypt)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BIN_INSTALL_DIR})
CONFIGURE_FILE(conf/${PROJECT_NAME}.service.in ${PROJECT_NAME}.service @ONLY)
INSTALL(FILES ${PROJECT_NAME}.service DESTINATION ${SYSTEMD_DIR})
INSTALL(FILES conf/${PROJECT_NAME}.socket DESTINATION ${SYSTEMD_DIR})
INSTALL(FILES conf/${PROJECT_NAME}.conf DESTINATION /opt/var/lib/misc)
INSTALL(FILES conf/99-${PROJECT_NAME}.rules DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d/)
ADD_SUBDIRECTORY(ffs_tool)
IF(BUILD_GTESTS)
ADD_SUBDIRECTORY(tests)
ENDIF(BUILD_GTESTS)