1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 SET(project_prefix "capi")
6 SET(maintainer "ByungWoo Lee <bw1212.lee@samsung.com>")
7 SET(description "Telephony Network Information Framework")
8 SET(service "telephony")
9 SET(submodule "network-info")
10 SET(dependents "dlog vconf glib-2.0 capi-base-common")
11 SET(pc_dependents "capi-base-common")
12 SET(deb_dependents "dlog-dev libvconf-dev libglib2.0-dev capi-base-common-dev")
27 #FILE(STRINGS config.cfg configs REGEX "^ *[^#]")
28 FOREACH(lines ${configs})
30 IF(${lines} MATCHES "([^=]*)=['\"](.*)['\"]")
31 SET(key ${CMAKE_MATCH_1})
32 SET(value ${CMAKE_MATCH_2})
33 # MESSAGE("${key} -> ${value}")
34 SET(${key} "${value}")
36 ENDFOREACH(lines ${configs})
38 LIST(FIND Services ${service} sfind)
40 IF( ${sfind} EQUAL -1 )
41 MESSAGE(FATAL_ERROR "Service must be one of ")
42 FOREACH( s IN ${Services} )
43 MESSAGE(FATAL_ERROR "[${s}]")
44 ENDFOREACH( s IN ${Services} )
45 ENDIF( ${sfind} EQUAL -1 )
47 SET(fw_name "${project_prefix}-${service}-${submodule}")
51 SET(CMAKE_INSTALL_PREFIX ${prefix})
52 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
53 SET(VERSION ${version})
56 INCLUDE_DIRECTORIES(${INC_DIR})
58 INCLUDE(FindPkgConfig)
59 pkg_check_modules(${fw_name} REQUIRED ${dependents})
60 FOREACH(flag ${${fw_name}_CFLAGS})
61 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
64 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
65 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
67 IF("${ARCH}" STREQUAL "arm")
68 ADD_DEFINITIONS("-DTARGET")
69 ENDIF("${ARCH}" STREQUAL "arm")
71 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
72 ADD_DEFINITIONS("-DTIZEN_DEBUG")
74 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
76 aux_source_directory(src SOURCES)
77 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
79 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
81 SET_TARGET_PROPERTIES(${fw_name}
88 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
90 DIRECTORY ${INC_DIR}/ DESTINATION include/${service}
92 PATTERN "*_private.h" EXCLUDE
93 PATTERN "${INC_DIR}/*.h"
96 SET(PC_NAME ${fw_name})
97 SET(PC_REQUIRED ${pc_dependents})
98 SET(PC_LDFLAGS -l${fw_name})
101 capi-telephony-network-info.pc.in
102 ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
105 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
109 ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
112 COMMENT "distribution clean"
115 -not -name config.cmake -and \(
119 -name cmake.depends -or
120 -name cmake.check_depends -or
121 -name CMakeCache.txt -or
122 -name cmake.check_cache -or
128 -name install_manifest.txt -or
131 | grep -v TC | xargs rm -rf