CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(livebox-viewer C) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "\${prefix}") SET(PROJECT_NAME "${PROJECT_NAME}") SET(LIBDIR ${LIB_INSTALL_DIR}) SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}") SET(VERSION_MAJOR 0) SET(VERSION "${VERSION_MAJOR}.0.1") SET(CMAKE_SKIP_BUILD_RPATH true) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE(FindPkgConfig) pkg_check_modules(pkgs REQUIRED dlog aul glib-2.0 gio-2.0 com-core sqlite3 db-util livebox-service vconf libtzplatform-config ) SET(BUILD_SOURCE src/dlist.c src/livebox.c src/util.c src/desc_parser.c src/master_rpc.c src/client.c src/file_service.c src/conf.c ) IF (X11_SUPPORT) pkg_check_modules(pkgs_extra REQUIRED x11 xext ) SET(BUILD_SOURCE ${BUILD_SOURCE} src/fb.c ) ADD_DEFINITIONS("-DHAVE_X11") ENDIF (X11_SUPPORT) IF (WAYLAND_SUPPORT) SET(BUILD_SOURCE ${BUILD_SOURCE} src/fb_wayland.c ) ADD_DEFINITIONS("-DHAVE_WAYLAND") ENDIF (WAYLAND_SUPPORT) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) FOREACH(flag ${pkgs_extra_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror -Winline -g") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") ADD_DEFINITIONS("-DLOG_TAG=\"LIVEBOX_VIEWER\"") ADD_DEFINITIONS("-DNDEBUG") ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET") #ADD_DEFINITIONS("-DFLOG") ADD_DEFINITIONS("-DMASTER_PKGNAME=\"data-provider-master\"") ADD_DEFINITIONS("-DINFO_SOCKET=\"/opt/usr/share/live_magazine/.live.socket\"") ADD_DEFINITIONS("-DCLIENT_SOCKET=\"/opt/usr/share/live_magazine/.client.socket\"") ADD_DEFINITIONS("-DSLAVE_SOCKET=\"/opt/usr/share/live_magazine/.slave.socket\"") ADD_DEFINITIONS("-DSERVICE_SOCKET=\"/opt/usr/share/live_magazine/.service.socket\"") ADD_LIBRARY(${PROJECT_NAME} SHARED ${BUILD_SOURCE}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-lpthread") CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc") INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/livebox.h DESTINATION include/${PROJECT_NAME}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "lib${PROJECT_NAME}")