blob: e27ea72218873c9fb1db7b59e91379b65f310790 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
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-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)
|