1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 #SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
10 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
11 SET(EXEC_PREFIX "\${prefix}")
12 SET(INCLUDEDIR "\${prefix}/include")
14 set(CMAKE_SKIP_BUILD_RPATH true)
16 ### Local include directories
17 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/parser)
20 INCLUDE(FindPkgConfig)
21 pkg_check_modules(pkgs REQUIRED glib-2.0 dlog vconf sqlite3 db-util libxml-2.0)
23 FOREACH(flag ${pkgs_CFLAGS})
24 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
28 pkg_check_modules(libpkgs REQUIRED glib-2.0 dlog vconf sqlite3 db-util libxml-2.0)
30 FOREACH(flag ${libpkgs_CFLAGS})
31 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
35 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
38 SET(debug_type "-DPM_CONSOLE_USE") # for debug - use console window
41 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
42 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -Wall")
43 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
45 ################## ## build comm libraries
46 add_subdirectory(parser)
48 ## build pkgmgr-info library
49 add_library(pkgmgr-info SHARED src/pkgmgr-info.c src/pkgmgr-info-internal.c)
52 SET_TARGET_PROPERTIES(pkgmgr-info PROPERTIES SOVERSION ${VERSION_MAJOR})
53 SET_TARGET_PROPERTIES(pkgmgr-info PROPERTIES VERSION ${VERSION})
54 TARGET_LINK_LIBRARIES(pkgmgr-info pkgmgr_parser ${libpkgs_LDFLAGS})
56 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/pkgmgr-info.pc.in ${CMAKE_BINARY_DIR}/pkgmgr-info.pc @ONLY)
57 configure_file(parser_path.conf.in parser_path.conf @ONLY)
58 configure_file(pkgmgr-info.manifest.in pkgmgr-info.manifest @ONLY)
59 configure_file(pkgmgr-parser.manifest.in pkgmgr-parser.manifest @ONLY)
60 INSTALL(TARGETS pkgmgr-info DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
61 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgmgr-info.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
62 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/pkgmgr-info.h DESTINATION include)
63 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/parser_path.conf DESTINATION ${SYSCONFDIR}/package-manager/)