CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(sysman C) SET(SRCS sysnoti.c sysconf.c sysman-util.c ) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "\${prefix}") SET(LIBDIR "\${prefix}/lib") SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}") SET(VERSION_MAJOR 0) SET(VERSION "${VERSION_MAJOR}.2.0") INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE(FindPkgConfig) pkg_check_modules(pkgs REQUIRED vconf devman_plugin dlog) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -fvisibility=hidden") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") MESSAGE("FLAGS: ${CMAKE_C_FLAGS}") ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"") ADD_DEFINITIONS("-DSLP_DEBUG -DENABLE_DLOG_OUT") SET(CMAKE_LDFLAGS "-Wl,zdefs") ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -ldl) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries) INSTALL(FILES ${CMAKE_SOURCE_DIR}/sysman.h DESTINATION include/${PROJECT_NAME}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/sysman_managed.h DESTINATION include/${PROJECT_NAME}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/sysman-internal.h DESTINATION include/${PROJECT_NAME}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/SLP_sysman_PG.h DESTINATION include/${PROJECT_NAME}) INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig) ADD_SUBDIRECTORY(set_pmon)