summaryrefslogtreecommitdiff
path: root/helper/CMakeLists.txt
blob: 1de94832fe1eb0405690a98f78828af3fbaa390f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
LINK_DIRECTORIES(${CMAKE_BINARY_DIR})

SET(TARGET contacts-svc-helper)

FILE(GLOB SRCS *.c)
#SET(SRCS main.c schema-recovery.c)

pkg_check_modules(helper_pkgs REQUIRED tapi icu-i18n libsystemd-daemon)

UNSET(EXTRA_CFLAGS)
FOREACH(flag ${helper_pkgs_CFLAGS})
	SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)

#SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")

ADD_EXECUTABLE(${TARGET} ${SRCS})
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS})
TARGET_LINK_LIBRARIES(${TARGET} ${PROJECT_NAME} ${helper_pkgs_LDFLAGS})

INSTALL(TARGETS ${TARGET} DESTINATION bin)
INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/contacts-svc-helper.sh DESTINATION /etc/rc.d/init.d)