Remove SMACK rule file(.rule) according three domain model
[apps/core/preloaded/email.git] / viewer / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(ug-email-viewer-efl C)
3
4 SET(SRCS
5         ./src/email-viewer.c
6         ./src/email-viewer-webview.c
7         ./src/email-viewer-logic.c
8         ./src/email-viewer-utils.c)
9 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
10
11 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
12         SET(CMAKE_BUILD_TYPE "Release")
13 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
14 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
15
16 SET(CMAKE_MAILVIEWER_SOURCE_DIR "${CMAKE_SOURCE_DIR}/viewer")
17 SET(CMAKE_MAILVIEWER_BINARY_DIR "${CMAKE_BINARY_DIR}/viewer")
18 INCLUDE_DIRECTORIES(${CMAKE_MAILVIEWER_SOURCE_DIR}/include)
19 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include)
20
21 INCLUDE(FindPkgConfig)
22 pkg_check_modules(pkgs-viewer REQUIRED appcore-efl ui-gadget-1 x11 elementary ecore glib-2.0 gobject-2.0
23                 status capi-media-metadata-extractor capi-media-image-util capi-content-media-content
24                 email-service edbus capi-appfw-application vconf ewebkit2
25                 contacts-service2 sysman bundle dlog efreet-mime calendar-service2 ethumb)
26
27 FOREACH(flag ${pkgs-viewer_CFLAGS})
28         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
29 ENDFOREACH(flag)
30 #SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -finstrument-functions")
31
32 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
33 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
34 SET(CMAKE_LDFLAGS "-Wl,-z,nodelete")
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         SET(CMAKE_C_FLAGS_RELEASE "-mabi=aapcs-linux -msoft-float -O2")
42 ENDIF("${ARCH}" STREQUAL "arm")
43
44 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
45 ADD_DEFINITIONS("-DDEBUG")
46 ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
47 ADD_DEFINITIONS("-DDATAFS=\"$ENV{DATAFS}\"")
48
49 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
50 TARGET_LINK_LIBRARIES(${PROJECT_NAME} email-common ${CMAKE_LDFLAGS} ${pkgs-viewer_LDFLAGS})
51
52 ADD_CUSTOM_TARGET(email-viewer-theme.edj
53                 COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images
54                 ${CMAKE_MAILVIEWER_SOURCE_DIR}/theme/email-viewer-theme.edc ${CMAKE_MAILVIEWER_BINARY_DIR}/email-viewer-theme.edj
55                 DEPENDS ${CMAKE_MAILVIEWER_SOURCE_DIR}/theme/email-viewer-theme.edc
56 )
57 ADD_DEPENDENCIES(${PROJECT_NAME} email-viewer-theme.edj)
58
59 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${UGDIR})
60 INSTALL(FILES ${CMAKE_MAILVIEWER_BINARY_DIR}/email-viewer-theme.edj DESTINATION ${EDJDIR})
61 INSTALL(FILES ${CMAKE_MAILVIEWER_SOURCE_DIR}/theme/_email_default.html DESTINATION ${DATADIR})
62