blob: f30cb87bdb5c15e9973970232a2e7d811a9e2cfc (
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
|
set(PROVIDER_NAME PowerManagement)
set(LIBRARY_NAME cmpi${PROVIDER_NAME})
set(MOF Linux_PowerManagement.mof)
set(provider_SRCS
power.c
)
konkretcmpi_generate(${MOF}
CIM_PROVIDERS
CIM_HEADERS
)
add_library(${LIBRARY_NAME} SHARED
${provider_SRCS}
${CIM_PROVIDERS}
${CIM_HEADERS}
)
# Require GLib
pkg_check_modules(GLIB REQUIRED glib-2.0)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMPI_INCLUDE_DIR} ${GLIB_INCLUDE_DIRS})
target_link_libraries(${LIBRARY_NAME} curacommon ${KONKRETCMPI_LIBRARIES} ${GLIB_LIBRARIES})
# Check if we have upower and link it
pkg_check_modules(UPOWER upower-glib)
if (${UPOWER_FOUND})
add_definitions(-DHAS_UPOWER)
target_link_libraries(${LIBRARY_NAME} ${UPOWER_LIBRARIES})
include_directories(${UPOWER_INCLUDE_DIRS})
endif (${UPOWER_FOUND})
# Check if we have systemctl
find_program(SYSTEMCTL NAMES systemctl)
if (${SYSTEMCTL_FOUND})
add_definitions(-DHAS_SYSTEMCTL)
endif (${SYSTEMCTL_FOUND})
# Create registration file
cim_registration(${PROVIDER_NAME} ${LIBRARY_NAME} ${MOF})
install(TARGETS ${LIBRARY_NAME} DESTINATION lib${LIB_SUFFIX}/cmpi/)
|