1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(accounts-svc C)
4 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
5 SET(EXEC_PREFIX "\${prefix}")
6 SET(LIBDIR "\${prefix}/lib")
7 SET(INCLUDEDIR "\${prefix}/include ")
9 SET(VERSION "${VERSION_MAJOR}.2.21")
13 src/account-capability-parser.c
18 src/account-capability-parser.c
22 SET(XML_PARSE_TEST_SRC
24 src/account-capability-parser.c
25 src/account-xml-verify.c
28 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
30 INCLUDE(FindPkgConfig)
31 pkg_check_modules(pkgs REQUIRED sqlite3 dlog db-util glib-2.0 capi-base-common vconf capi-appfw-application libxml-2.0)
33 FOREACH(flag ${pkgs_CFLAGS})
34 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
37 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")
38 SET(CMAKE_LDFLAGS "-Wl,-zdefs")
40 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
41 ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
42 ADD_DEFINITIONS("-DSLP_DEBUG")
44 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
45 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
46 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
48 ADD_EXECUTABLE("acctest" ${TESTSRC})
50 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
51 TARGET_LINK_LIBRARIES("acctest" ${pkgs_LDFLAGS})
53 ADD_EXECUTABLE("account-xml-verify" ${XML_PARSE_TEST_SRC})
54 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
55 TARGET_LINK_LIBRARIES("account-xml-verify" ${pkgs_LDFLAGS})
57 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
59 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib/accounts-svc)
60 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
61 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
63 INSTALL(TARGETS account-xml-verify DESTINATION bin)
65 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/account.h DESTINATION include)
66 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/account-error.h DESTINATION include)
67 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/account-types.h DESTINATION include)
69 #ADD_SUBDIRECTORY(test)