Generate Licence file
[platform/core/telephony/tel-plugin-vconf.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(vconf-plugin C)
3
4 ### Global setting ###
5 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
6 SET(EXEC_PREFIX "\${prefix}")
7 SET(LIBDIR "\${prefix}/lib")
8 SET(INCLUDEDIR "\${prefix}/include")
9 SET(PKGCONFIGDIR "${PREFIX}/${LIB_INSTALL_DIR}/pkgconfig" CACHE PATH PKGCONFIGDIR)
10 SET(CMAKE_INSTALL_PREFIX "${PREFIX}")
11
12 # Set required packages
13 INCLUDE(FindPkgConfig)
14 pkg_check_modules(pkgs REQUIRED vconf glib-2.0 gthread-2.0 tcore dlog)
15
16 FOREACH(flag ${pkgs_CFLAGS})
17         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
18 ENDFOREACH(flag)
19
20
21 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/)
22
23 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wcast-align")
24
25 ADD_DEFINITIONS("-DFEATURE_DLOG_DEBUG")
26 ADD_DEFINITIONS("-DTCORE_LOG_TAG=\"TEL_PLUGIN_VCONF\"")
27 ADD_DEFINITIONS("-DPLUGIN_VERSION=${VERSION}")
28
29 MESSAGE(${CMAKE_C_FLAGS})
30 MESSAGE(${CMAKE_EXE_LINKER_FLAGS})
31
32 SET(SRCS
33                 src/desc-vconf.c
34 )
35
36
37 # library build
38 ADD_LIBRARY(vconf-plugin SHARED ${SRCS})
39 TARGET_LINK_LIBRARIES(vconf-plugin ${pkgs_LDFLAGS})
40 SET_TARGET_PROPERTIES(vconf-plugin PROPERTIES PREFIX "" OUTPUT_NAME vconf-plugin)
41
42
43
44 # install
45 INSTALL(TARGETS vconf-plugin
46         LIBRARY DESTINATION ${LIB_INSTALL_DIR}/telephony/plugins)
47 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME tel-plugin-vconf)