diff options
author | Radek Novacek <rnovacek@redhat.com> | 2012-07-23 12:56:49 +0200 |
---|---|---|
committer | Radek Novacek <rnovacek@redhat.com> | 2012-07-23 12:56:49 +0200 |
commit | fcb9f58e9ad3a2df5b9e003441f341805cebc051 (patch) | |
tree | 5737668157aaf8d379700389302f192ebbfa54ad | |
parent | 7bc4421f26954c2acd817c690cbbde03a4391878 (diff) | |
download | openlmi-providers-fcb9f58e9ad3a2df5b9e003441f341805cebc051.tar.gz openlmi-providers-fcb9f58e9ad3a2df5b9e003441f341805cebc051.tar.xz openlmi-providers-fcb9f58e9ad3a2df5b9e003441f341805cebc051.zip |
Start converting all providers to CMake
-rw-r--r-- | CMakeLists.txt | 22 | ||||
-rw-r--r-- | cmake/modules/FindCMPI.cmake | 12 | ||||
-rw-r--r-- | cmake/modules/FindKonkretCMPI.cmake | 35 | ||||
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/fan/CMakeLists.txt | 21 | ||||
-rw-r--r-- | src/power/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/service/CMakeLists.txt | 16 |
7 files changed, 110 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..29cb9bd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,22 @@ + +cmake_minimum_required(VERSION 2.6) + +# Set flags and definitions +add_definitions(-D_XOPEN_SOURCE=500 -D_GNU_SOURCE) +set(CMAKE_C_FLAGS "-std=c99 -Wall -pedantic -g -Wextra -Wno-unused-parameter -Wformat -Wparentheses -Wmaybe-uninitialized") + +# Set LIB_SUFFIX to 64 on 64bit architectures +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(LIB_SUFFIX "") +else(CMAKE_SIZEOF_VOID_P EQUAL 4) + SET(LIB_SUFFIX 64) +endif(CMAKE_SIZEOF_VOID_P EQUAL 4) + +# Set path to custom cmake modules +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) + +# Find required packages +find_package(CMPI REQUIRED) +find_package(KonkretCMPI REQUIRED) + +add_subdirectory(src) diff --git a/cmake/modules/FindCMPI.cmake b/cmake/modules/FindCMPI.cmake new file mode 100644 index 0000000..d814eef --- /dev/null +++ b/cmake/modules/FindCMPI.cmake @@ -0,0 +1,12 @@ + +find_path(CMPI_INCLUDE_DIR + NAMES cmpidt.h cmpift.h cmpimacs.h cmpios.h cmpipl.h + HINTS $ENV{CMPI_INCLUDE_DIR} + PATH_SUFFIXES include/cmpi include + PATHS /usr /usr/local +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CMPI DEFAULT_MSG CMPI_INCLUDE_DIR) + +mark_as_advanced(CMPI_INCLUDE_DIR) diff --git a/cmake/modules/FindKonkretCMPI.cmake b/cmake/modules/FindKonkretCMPI.cmake new file mode 100644 index 0000000..b888cfd --- /dev/null +++ b/cmake/modules/FindKonkretCMPI.cmake @@ -0,0 +1,35 @@ + +find_path(KONKRETCMPI_INCLUDE_DIR + NAMES konkret.h + HINTS $ENV{KONKTRETCMPI_INCLUDE_DIR} + PATH_SUFFIXES include/konkret include + PATHS /usr /usr/local +) + +find_library(KONKRETCMPI_LIBRARY + NAMES konkret + HINTS $ENV{KONKRETCMPI_LIB_DIR} + PATH_SUFFIXES lib64 lib + PATHS /usr /usr/local +) + +find_program(KONKRETCMPI_KONKRET + NAMES konkret + HINTS $ENV{KONKRETCMPI_BIN_DIR} + PATH_SUFFIXES bin + PATHS /usr/ /usr/local +) + +find_program(KONKRETCMPI_KONKRETREG + NAMES konkretreg + HINTS $ENV{KONKRETCMPI_BIN_DIR} + PATH_SUFFIXES bin + PATHS /usr/ /usr/local +) + +set(KONKRETCMPI_LIBRARIES ${KONKRETCMPI_LIBRARY}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(KonkretCMPI DEFAULT_MSG KONKRETCMPI_LIBRARIES KONKRETCMPI_INCLUDE_DIR) + +mark_as_advanced(KONKRETCMPI_INCLUDE_DIR KONKRETCMPI_LIBRARIES) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..156d7d1 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,4 @@ + +add_subdirectory(fan) +add_subdirectory(power) +add_subdirectory(service)
\ No newline at end of file diff --git a/src/fan/CMakeLists.txt b/src/fan/CMakeLists.txt new file mode 100644 index 0000000..c35ad02 --- /dev/null +++ b/src/fan/CMakeLists.txt @@ -0,0 +1,21 @@ + +set(PROVIDER_NAME Fan) +set(LIBRARY_NAME cmpi${PROVIDER_NAME}) + +set(provider_SRCS + cmpiLinux_Fan.c + cmpiLinux_FanAssociatedSensorProvider.c + cmpiLinux_FanCommon.c + cmpiLinux_FanProvider.c + cmpiLinux_FanSensor.c + cmpiLinux_FanSensorProvider.c + Linux_Fan.c +) + +#add_library(${LIBRARY_NAME} SHARED +# ${provider_SRCS} +#) + +include_directories(${CMPI_INCLUDE_DIR}) + +#install(TARGETS ${LIBRARY_NAME} DESTINATION lib${LIB_SUFFIX}/cmpi) diff --git a/src/power/CMakeLists.txt b/src/power/CMakeLists.txt index 72087b7..c6bfdad 100644 --- a/src/power/CMakeLists.txt +++ b/src/power/CMakeLists.txt @@ -1,16 +1,4 @@ -cmake_minimum_required (VERSION 2.6) - -set(CMAKE_C_FLAGS "-std=c99 -Wall -pedantic -g") - -add_subdirectory(src) - -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - set(LIB_SUFFIX "") -else(CMAKE_SIZEOF_VOID_P EQUAL 4) - SET(LIB_SUFFIX 64) -endif(CMAKE_SIZEOF_VOID_P EQUAL 4) - 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/) install(FILES provider-register.sh DESTINATION share/sblim-cmpi-power/) diff --git a/src/service/CMakeLists.txt b/src/service/CMakeLists.txt new file mode 100644 index 0000000..9d5ef6f --- /dev/null +++ b/src/service/CMakeLists.txt @@ -0,0 +1,16 @@ + +set(PROVIDER_NAME Service) +set(LIBRARY_NAME cmpi${PROVIDER_NAME}) + +set(provider_SRCS + Service.c + ServiceUtils.c +) + +add_library(${LIBRARY_NAME} SHARED + ${provider_SRCS} +) + +include_directories(${CMPI_INCLUDE_DIR}) + +install(TARGETS ${LIBRARY_NAME} DESTINATION lib${LIB_SUFFIX}/cmpi) |