2 # SYSTEM_SETTINGS_UTIL - setting-common
4 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
5 PROJECT(${SYSTEM_SETTINGS_UTIL})
7 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
9 SET(requires "elementary ecore dlog vconf fontconfig libxml-2.0 pkgmgr pkgmgr-info libsystemd efl-extension")
11 PKG_CHECK_MODULES(system_settings_util REQUIRED ${requires})
13 FOREACH(flag ${system_settings_util_CFLAGS})
14 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
17 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Werror-implicit-function-declaration ${COVERAGE_TEST_FLAGS}")
19 IF (CMAKE_BUILD_TYPE STREQUAL "UNITTEST")
20 SET(COVERAGE_TEST_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage --coverage")
21 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_TEST_FLAGS} ${EXTRA_CFLAGS}")
22 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
23 ADD_DEFINITIONS("-DUNIT_TEST")
24 ENDIF() #CMAKE_BUILD_TYPE STREQUAL "UNITTEST"
29 IF("${ARCH}" STREQUAL "arm")
30 ADD_DEFINITIONS("-DTARGET")
31 MESSAGE("add -DTARGET")
32 ENDIF("${ARCH}" STREQUAL "arm")
34 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
35 ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"")
36 ADD_DEFINITIONS("-DSLP_DEBUG")
37 ADD_DEFINITIONS("-shared")
39 #SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl, --rpath=/usr/lib")
41 #make lib-${LIB_SYSTEM_SETTINGS_UTIL}.so files
42 ADD_LIBRARY(${LIB_SYSTEM_SETTINGS_UTIL} SHARED
43 ./src/system_settings_util.c
46 TARGET_LINK_LIBRARIES(${LIB_SYSTEM_SETTINGS_UTIL} ${system_settings_util_LDFLAGS})
47 SET_TARGET_PROPERTIES(${LIB_SYSTEM_SETTINGS_UTIL} PROPERTIES VERSION 0.1.0 SOVERSION 1)
48 INSTALL(TARGETS ${LIB_SYSTEM_SETTINGS_UTIL} DESTINATION ${CMAKE_LIBDIR})
50 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/system_settings_util.h DESTINATION ${CMAKE_INCLUDEDIR})
51 IF (CMAKE_BUILD_TYPE STREQUAL "UNITTEST")
53 DIRECTORY "CMakeFiles" DESTINATION /usr/src/packages/BUILD/capi-system-system-settings-${FULLVER}/system-settings-util/
57 ENDIF() #CMAKE_BUILD_TYPE STREQUAL "UNITTEST"