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.41")
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 pkgmgr-info aul)
33 FOREACH(flag ${pkgs_CFLAGS})
34 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
37 FIND_PROGRAM(UNAME NAMES uname)
38 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
39 IF ("${ARCH}" STREQUAL "arm")
40 ADD_DEFINITIONS("-DTARGET_ARM")
41 MESSAGE("[TARGET] Compile")
42 ELSE ("${ARCH}" STREQUAL "arm")
43 ADD_DEFINITIONS("-DTARGET_I386")
44 MESSAGE("[i386] Compile")
45 ENDIF ("${ARCH}" STREQUAL "arm")
47 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
48 SET(CMAKE_LDFLAGS "-Wl,-zdefs")
50 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
51 ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
52 ADD_DEFINITIONS("-DSLP_DEBUG")
54 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
55 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
56 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
58 ADD_EXECUTABLE("acctest" ${TESTSRC})
60 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
61 TARGET_LINK_LIBRARIES("acctest" ${pkgs_LDFLAGS})
63 ADD_EXECUTABLE("account-xml-verify" ${XML_PARSE_TEST_SRC})
64 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
65 TARGET_LINK_LIBRARIES("account-xml-verify" ${pkgs_LDFLAGS})
67 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
69 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib/accounts-svc)
70 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
71 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
73 INSTALL(TARGETS account-xml-verify DESTINATION bin)
75 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/account.h DESTINATION include)
76 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/account-error.h DESTINATION include)
77 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/account-types.h DESTINATION include)
79 #ADD_SUBDIRECTORY(test)