1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(livebox-viewer C)
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}")
10 SET(VERSION "${VERSION_MAJOR}.0.1")
12 set(CMAKE_SKIP_BUILD_RPATH true)
14 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
16 INCLUDE(FindPkgConfig)
17 pkg_check_modules(pkgs REQUIRED
30 FOREACH(flag ${pkgs_CFLAGS})
31 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
34 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror -Winline -g")
36 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
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
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")
61 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
62 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc")
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}")