summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Novacek <rnovacek@redhat.com>2012-07-24 10:08:50 +0200
committerRadek Novacek <rnovacek@redhat.com>2012-07-24 10:08:50 +0200
commitdf1a8e7f10910032c66ebd81017fe0aacf8b9e44 (patch)
tree79980f50ed84dd99dc461d8d2ec7268a5f8dcc59
parent4d2e61789348c6af3c91e531f292a1341dde85ca (diff)
downloadopenlmi-providers-df1a8e7f10910032c66ebd81017fe0aacf8b9e44.tar.gz
openlmi-providers-df1a8e7f10910032c66ebd81017fe0aacf8b9e44.tar.xz
openlmi-providers-df1a8e7f10910032c66ebd81017fe0aacf8b9e44.zip
power: check if upower and systemctl are installed
-rw-r--r--src/power/CMakeLists.txt14
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/)