2 # Communication modules for pkg-mgr client lib and server process
3 # By Youmin Ha <youmin.ha@samsung.com>
5 cmake_minimum_required(VERSION 2.6)
6 #set(CMAKE_SKIP_BUILD_RPATH true)
7 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
12 if(DEFINED ${VERSION})
13 message("VERSION: ${VERSION}")
15 message("VERSION is not defined. set it as 0.1.0")
18 if(DEFINED ${VERSION_MAJOR})
19 message("VERSION_MAJOR: ${VERSION_MAJOR}")
21 message( "VERSION_MAJOR is not defined. set it as 0")
24 message(STATUS "version/major : ${VERSION} / ${VERSION_MAJOR}")
26 ### Get required CFLAGS, LDFLAGS from pkg-config
28 include(FindPkgConfig)
29 pkg_check_modules(parser_pkgs REQUIRED dlog libxml-2.0 glib-2.0 sqlite3 db-util vconf)
31 foreach(flag ${parser_pkgs_CFLAGS})
32 set(parser_pkgs_CFLAGS_str "${parser_pkgs_CFLAGS_str} ${flag}")
34 ADD_DEFINITIONS("-DLIB_PATH=\"${LIB_INSTALL_DIR}\"")
36 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
37 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -Wall")
38 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
40 add_definitions("-DSYSCONFDIR=\"${SYSCONFDIR}\"")
41 ### Set current binary dir to be included (for generated *.h files)
42 include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
46 ## pkgmgr_parser object (by sewook.park)
47 # This library is for installer backend
48 add_library(pkgmgr_parser SHARED pkgmgr_parser.c pkgmgr_parser_db.c)
49 #add_library(pkgmgr_parser SHARED pkgmgr_parser.c)
50 set_target_properties(pkgmgr_parser PROPERTIES SOVERSION ${VERSION_MAJOR})
51 set_target_properties(pkgmgr_parser PROPERTIES VERSION ${VERSION})
52 set_target_properties(pkgmgr_parser PROPERTIES COMPILE_FLAGS "${parser_pkgs_CFLAGS_str}")
53 target_link_libraries(pkgmgr_parser ${parser_pkgs_LDFLAGS})
56 configure_file(pkgmgr-parser.pc.in ${CMAKE_CURRENT_BINARY_DIR}/pkgmgr-parser.pc @ONLY)
57 configure_file(preload_list.txt.in preload_list.txt @ONLY)
58 configure_file(manifest.xsd.in manifest.xsd @ONLY)
59 configure_file(xml.xsd.in xml.xsd @ONLY)
64 DESTINATION ${LIB_INSTALL_DIR}
65 COMPONENT RuntimeLibraries)
68 DESTINATION include/pkgmgr)
71 DESTINATION include/pkgmgr)
74 ${CMAKE_CURRENT_BINARY_DIR}/pkgmgr-parser.pc
75 DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
77 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/preload_list.txt DESTINATION ${SYSCONFDIR}/package-manager/preload/)
78 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.xsd DESTINATION ${SYSCONFDIR}/package-manager/preload/)
79 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/xml.xsd DESTINATION ${SYSCONFDIR}/package-manager/preload/)