diff options
-rw-r--r-- | src/power/CMakeLists.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/power/CMakeLists.txt b/src/power/CMakeLists.txt index b362d7f..12cfeb0 100644 --- a/src/power/CMakeLists.txt +++ b/src/power/CMakeLists.txt @@ -25,7 +25,19 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMPI_INCLUDE_DIR} ${GLIB_INCLU target_link_libraries(${LIBRARY_NAME} ${KONKRETCMPI_LIBRARIES} ${GLIB_LIBRARIES}) install(TARGETS ${LIBRARY_NAME} DESTINATION lib${LIB_SUFFIX}/cmpi) - +# 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}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/Linux_PowerManagement.registration DESTINATION share/sblim-cmpi-power/) install(FILES Linux_PowerManagement.mof DESTINATION share/sblim-cmpi-power/) |