2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 SET(fw_name "capi-system-info")
7 SET(CMAKE_INSTALL_PREFIX /usr)
8 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
11 INCLUDE_DIRECTORIES(${INC_DIR})
13 SET(requires "dlog capi-base-common capi-network-wifi capi-media-sound-manager capi-uix-stt wifi-direct vconf iniparser x11 xi xrandr tapi devman xproto openssl nfc location bluetooth-api mm-radio sensor")
14 SET(pc_requires "capi-base-common")
16 INCLUDE(FindPkgConfig)
17 pkg_check_modules(${fw_name} REQUIRED ${requires})
18 FOREACH(flag ${${fw_name}_CFLAGS})
19 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
22 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
23 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
25 IF("${ARCH}" STREQUAL "arm")
26 ADD_DEFINITIONS("-DTARGET")
27 ENDIF("${ARCH}" STREQUAL "arm")
29 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
30 ADD_DEFINITIONS("-DSLP_DEBUG")
32 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
34 aux_source_directory(src SOURCES)
35 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
37 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
39 SET_TARGET_PROPERTIES(${fw_name}
46 INSTALL(TARGETS ${fw_name} DESTINATION lib)
48 DIRECTORY ${INC_DIR}/ DESTINATION include/system
50 PATTERN "*_private.h" EXCLUDE
51 PATTERN "${INC_DIR}/*.h"
54 SET(PC_NAME ${fw_name})
55 SET(PC_REQUIRED ${pc_requires})
56 SET(PC_LDFLAGS -l${fw_name})
57 SET(PC_CFLAGS -I\${includedir}/system)
61 ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
64 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig)
68 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
71 COMMENT "distribution clean"
74 -not -name config.cmake -and \(
78 -name cmake.depends -or
79 -name cmake.check_depends -or
80 -name CMakeCache.txt -or
81 -name cmake.check_cache -or
87 -name install_manifest.txt -or
90 | grep -v TC | xargs rm -rf