Add default Smack manifest for contacts.spec
[pkgs/c/contacts.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(contacts C)
3
4 SET(PACKAGE ${PROJECT_NAME})
5 SET(PKGNAME "org.tizen.${PACKAGE}")
6 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
7 SET(BINDIR "${PREFIX}/bin")
8 SET(RESDIR "${PREFIX}/res")
9 SET(DATADIR "${PREFIX}/data")
10 SET(LOCALEDIR "/opt/ug/res/locale")
11 SET(EDC_SRC_DIR "${CMAKE_SOURCE_DIR}/edc")
12 SET(EDJDIR "/opt/ug/res/edje/ug-${PACKAGE}")
13 SET(IMGDIR "/opt/ug/res/images/ug-${PACKAGE}")
14 SET(CMAKE_SKIP_BUILD_RPATH true)
15 SET(VERSION_MAJOR 0)
16 SET(VERSION "${VERSION_MAJOR}.3.1")
17
18 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
19         SET(CMAKE_BUILD_TYPE "Release")
20 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
21 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
22
23 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
24
25 INCLUDE(FindPkgConfig)
26 pkg_check_modules(pkgs REQUIRED appcore-efl ui-gadget contacts-service ecore-x evas ecore ecore-input edje eina appsvc)
27
28 FOREACH(flag ${pkgs_CFLAGS})
29         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
30 ENDFOREACH(flag)
31
32 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
33 SET(CMAKE_C_FLAGS_DEBUG "")
34 SET(CMAKE_C_FLAGS_RELEASE "")
35
36 FIND_PROGRAM(UNAME NAMES uname)
37 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
38 IF("${ARCH}" STREQUAL "arm")
39         ADD_DEFINITIONS("-DTARGET")
40         MESSAGE("add -DTARGET")
41 ENDIF("${ARCH}" STREQUAL "arm")
42
43 ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
44 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
45 ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
46 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
47 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
48 ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
49 ADD_DEFINITIONS("-DIMGDIR=\"${IMGDIR}\"")
50 ADD_DEFINITIONS("-DUGDATADIR=\"${UGDATADIR}\"")
51
52 # install desktop file & icon
53 CONFIGURE_FILE(${PROJECT_NAME}.desktop.in ${PKGNAME}.desktop)
54 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PKGNAME}.desktop DESTINATION "/opt/share/applications")
55 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/images/ DESTINATION ${IMGDIR})
56 INSTALL(DIRECTORY DESTINATION ${DATADIR})
57
58 ADD_SUBDIRECTORY(lib)
59 ADD_SUBDIRECTORY(app)
60 ADD_SUBDIRECTORY(viewer)
61
62 # i18n
63 ADD_SUBDIRECTORY(po)
64