Update source from tizen 2.3
[platform/core/base/bundle.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(bundle C)
3 set (VERSION "0.1.31")
4
5 ### Required packages
6 INCLUDE(FindPkgConfig)
7 pkg_check_modules(pkgs REQUIRED glib-2.0 dlog capi-base-common)
8 FOREACH(flag ${pkgs_CFLAGS})
9         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
10 ENDFOREACH(flag)
11
12 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
13
14 ### Local include directories
15 include_directories(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
16
17 ### Build
18 add_library(bundle SHARED 
19                 src/bundle.c
20                 src/keyval_type.c
21                 src/keyval.c
22                 src/keyval_array.c
23                 )
24 set_target_properties(bundle PROPERTIES SOVERSION "0")
25 set_target_properties(bundle PROPERTIES VERSION "${VERSION}")
26 message(STATUS "Version from debian/changelog: ${VERSION},  Major version: ${VERSION_MAJOR}")
27 target_link_libraries(bundle ${pkgs_LDFLAGS})
28
29
30 ### Make pkgconfig file
31 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
32 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/bundle.pc.in ${CMAKE_BINARY_DIR}/bundle.pc @ONLY)
33
34
35 ### Install
36 install(TARGETS bundle
37     DESTINATION ${LIB_INSTALL_DIR}
38         )
39 install(FILES 
40         ${CMAKE_SOURCE_DIR}/include/bundle.h 
41         ${CMAKE_SOURCE_DIR}/include/SLP_bundle_PG.h 
42         DESTINATION include/
43                 )
44 install(FILES ${CMAKE_BINARY_DIR}/bundle.pc 
45     DESTINATION ${LIB_INSTALL_DIR}/pkgconfig/
46                 )
47
48
49 ### Test
50 add_subdirectory(test)
51