Icon provider. do not sucide.
[platform/framework/web/data-provider-slave.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(data-provider-slave C)
3
4 INCLUDE(FindPkgConfig)
5 pkg_check_modules(pkg REQUIRED
6         capi-appfw-application
7         capi-appfw-app-manager
8         ail
9         dlog
10         aul
11         vconf
12         sqlite3
13         db-util
14         glib-2.0
15         gio-2.0
16         bundle
17         ecore-x
18         ecore
19         provider
20         livebox-service
21         edje
22         evas
23         livebox
24         elementary
25         capi-system-system-settings
26         com-core
27         shortcut
28         appsvc
29         appcore-efl
30 )
31
32 SET(PACKAGE "${PROJECT_NAME}")
33 SET(LOCALEDIR "/usr/apps/org.tizen.${PROJECT_NAME}/res/locale")
34 SET(ICON_PROVIDER "icon-provider-slave")
35 SET(EXE_LOADER "${PROJECT_NAME}")
36
37 SET(EXTRA_CFLAGS "-Wall -Winline -g -fno-builtin-malloc")
38 SET(EXTRA_CXXFLAGS "-Wall -Winline -g -fno-builtin-malloc")
39 FOREACH(flag ${pkg_CFLAGS})
40         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
41         SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} ${flag}")
42 ENDFOREACH(flag)
43
44 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
45 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -Wall")
46
47 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
48
49 #SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
50
51 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
52 ADD_DEFINITIONS("-DPATH_MAX=256")
53 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
54 ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
55 ADD_DEFINITIONS("-DEXEC_NAME=\"${PROJECT_NAME}.loader\"")
56
57 ADD_DEFINITIONS("-DMASTER_PKGNAME=\"data-provider-master\"")
58 ADD_DEFINITIONS("-DSLAVE_PKGNAME=\"org.tizen.data-provider-slave\"")
59 ADD_DEFINITIONS("-DSOCKET_FILE=\"/opt/usr/share/live_magazine/.live.socket\"")
60 ADD_DEFINITIONS("-DCONF_FILE=\"/usr/share/data-provider-master/conf.ini\"")
61
62 ADD_DEFINITIONS("-DNDEBUG")
63 #ADD_DEFINITIONS("-D_ENABLE_MCHECK")
64 ADD_DEFINITIONS("-DLOG_TAG=\"DATA_PROVIDER_SLAVE\"")
65 ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET")
66 #ADD_DEFINITIONS(${pkg_CFLAGS})
67
68 SET(EXTRA_LDFLAGS "-ldl")
69 FOREACH(flag ${pkg_LDFLAGS})
70         IF (flag STREQUAL -L)
71                 MESSAGE("Ignore -L")
72         ELSE()
73                 SET(EXTRA_LDFLAGS "${EXTRA_LDFLAGS} ${flag}")
74         ENDIF()
75 ENDFOREACH(flag)
76
77 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTRA_LDFLAGS}")
78 # "${CMAKE_EXE_LINKER_FLAGS} -pie")
79
80 ADD_EXECUTABLE("${PROJECT_NAME}.loader"
81         src/main.c
82         src/so_handler.c
83         src/fault.c
84         src/update_monitor.c
85         src/conf.c
86         src/util.c
87         src/lb.c
88         src/client.c
89         src/critical_log.c
90 )
91 TARGET_LINK_LIBRARIES("${PROJECT_NAME}.loader" "${EXTRA_LDFLAGS}")
92
93 ADD_EXECUTABLE(${ICON_PROVIDER}
94         icon_src/main.c
95         icon_src/script_handler.c
96         src/util.c
97 )
98 TARGET_LINK_LIBRARIES(${ICON_PROVIDER} "${EXTRA_LDFLAGS}")
99
100 ADD_EXECUTABLE(${EXE_LOADER}
101         stub/main.c
102 )
103 TARGET_LINK_LIBRARIES(${EXE_LOADER} "${EXTRA_LDFLAGS}")
104
105 #INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.data-provider-slave.desktop DESTINATION /usr/share/applications)
106 INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.data-provider-slave.xml DESTINATION /usr/share/packages)
107 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "org.tizen.${PROJECT_NAME}")
108 INSTALL(TARGETS "${PROJECT_NAME}.loader" DESTINATION /usr/apps/org.tizen.${PROJECT_NAME}/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
109 INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.data-provider-slave.rule DESTINATION /etc/smack/accesses.d)
110 INSTALL(TARGETS ${ICON_PROVIDER} DESTINATION /usr/apps/org.tizen.${PROJECT_NAME}/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
111 INSTALL(TARGETS ${EXE_LOADER} DESTINATION /usr/apps/org.tizen.${PROJECT_NAME}/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
112
113 # INCLUDE FOR BUILD & INSTALL .PO FILES
114 ADD_SUBDIRECTORY(res)
115 ADD_SUBDIRECTORY(data)