Add client pause/resume API
[platform/framework/web/livebox-viewer.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(livebox-viewer C)
3
4 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
5 SET(EXEC_PREFIX "\${prefix}")
6 SET(PROJECT_NAME "${PROJECT_NAME}")
7 SET(LIBDIR "\${exec_prefix}/lib")
8 SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
9 SET(VERSION_MAJOR 0)
10 SET(VERSION "${VERSION_MAJOR}.0.1")
11
12 set(CMAKE_SKIP_BUILD_RPATH true)
13
14 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
15
16 INCLUDE(FindPkgConfig)
17 pkg_check_modules(pkgs REQUIRED
18         dlog
19         aul
20         glib-2.0
21         gio-2.0
22         com-core
23         x11
24         xext
25         sqlite3
26         db-util
27         livebox-service
28 )
29
30 FOREACH(flag ${pkgs_CFLAGS})
31         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
32 ENDFOREACH(flag)
33
34 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror -Winline -g")
35
36 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
37
38 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
39 ADD_DEFINITIONS("-DLOG_TAG=\"LIVEBOX_VIEWER\"")
40 ADD_DEFINITIONS("-DNDEBUG")
41 #ADD_DEFINITIONS("-DFLOG")
42 ADD_DEFINITIONS("-DMASTER_PKGNAME=\"org.tizen.data-provider-master\"")
43 ADD_DEFINITIONS("-DINFO_SOCKET=\"/opt/usr/share/live_magazine/.live.socket\"")
44 ADD_DEFINITIONS("-DCLIENT_SOCKET=\"/opt/usr/share/live_magazine/.client.socket\"")
45 ADD_DEFINITIONS("-DSLAVE_SOCKET=\"/opt/usr/share/live_magazine/.slave.socket\"")
46 ADD_DEFINITIONS("-DSERVICE_SOCKET=\"/opt/usr/share/live_magazine/.service.socket\"")
47 ADD_LIBRARY(${PROJECT_NAME} SHARED
48         src/dlist.c
49         src/livebox.c
50         src/util.c
51         src/fb.c
52         src/desc_parser.c
53         src/master_rpc.c
54         src/client.c
55         src/critical_log.c
56 )
57 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
58 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
59 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-lpthread")
60
61 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
62 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc")
63
64 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
65 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
66 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox.h DESTINATION include/${PROJECT_NAME})
67 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox-viewer_PG.h DESTINATION /usr/share/doc/${PROJECT_NAME})
68 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}")