summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Novacek <rnovacek@redhat.com>2012-07-30 13:08:04 +0200
committerRadek Novacek <rnovacek@redhat.com>2012-07-30 14:57:58 +0200
commit0826d3ff487b5ce5fece56767e6cf88f81059c03 (patch)
tree1e878863571143c0b724e57c889571b475a36c0a
parent2034a2140dc0908476ee83a9825c0dbad7d9a32a (diff)
downloadopenlmi-providers-0826d3ff487b5ce5fece56767e6cf88f81059c03.tar.gz
openlmi-providers-0826d3ff487b5ce5fece56767e6cf88f81059c03.tar.xz
openlmi-providers-0826d3ff487b5ce5fece56767e6cf88f81059c03.zip
Make provider optional using cmake options
-rw-r--r--CMakeLists.txt9
-rw-r--r--README2
-rw-r--r--src/CMakeLists.txt14
-rw-r--r--src/power/CMakeLists.txt3
4 files changed, 21 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 552894c..d642b24 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,18 +12,21 @@ else(CMAKE_SIZEOF_VOID_P EQUAL 4)
SET(LIB_SUFFIX 64)
endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+option(WITH-FAN "Build fan provider" ON)
+option(WITH-POWER "Build power provider" ON)
+option(WITH-SERVICE "Build service provider" ON)
+
# Set path to custom cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
include(CuraMacros)
+find_package(PkgConfig)
+
# Find required packages
find_package(CMPI REQUIRED)
find_package(KonkretCMPI REQUIRED)
-find_package(PkgConfig)
-pkg_check_modules(GLIB REQUIRED glib-2.0)
-
add_subdirectory(src)
add_subdirectory(mof)
diff --git a/README b/README
index 3d474d3..46adb4e 100644
--- a/README
+++ b/README
@@ -71,7 +71,7 @@ Provider specific dependencies:
*******************************************************************************
-* Installation *
+* Compilation and installation *
*******************************************************************************
$ mkdir build && cd build
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b794abc..89b859e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,6 +4,14 @@ add_library(curacommon SHARED
globals.c
)
-add_subdirectory(fan)
-add_subdirectory(power)
-add_subdirectory(service) \ No newline at end of file
+if (WITH-FAN)
+ add_subdirectory(fan)
+endif (WITH-FAN)
+
+if (WITH-POWER)
+ add_subdirectory(power)
+endif (WITH-POWER)
+
+if (WITH-SERVICE)
+ add_subdirectory(service)
+endif (WITH-SERVICE)
diff --git a/src/power/CMakeLists.txt b/src/power/CMakeLists.txt
index 606c1f3..f30cb87 100644
--- a/src/power/CMakeLists.txt
+++ b/src/power/CMakeLists.txt
@@ -18,6 +18,9 @@ add_library(${LIBRARY_NAME} SHARED
${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})