summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRadek Novacek <rnovacek@redhat.com>2013-07-23 16:09:49 +0200
committerRadek Novacek <rnovacek@redhat.com>2013-07-23 16:11:22 +0200
commit563748abc86a7121aebfd963e628c08c7cc56646 (patch)
treea77687ddfb6b39022538a3059dd73eadfe83034a /cmake
parentdda30ae620d52d444d6b79c22d87b2587308e3c0 (diff)
downloadopenlmi-providers-563748abc86a7121aebfd963e628c08c7cc56646.tar.gz
openlmi-providers-563748abc86a7121aebfd963e628c08c7cc56646.tar.xz
openlmi-providers-563748abc86a7121aebfd963e628c08c7cc56646.zip
Return list of CIM classes from konkretcmpi_generate macro
This list will be used by profile registration.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/OpenLMIMacros.cmake16
1 files changed, 9 insertions, 7 deletions
diff --git a/cmake/modules/OpenLMIMacros.cmake b/cmake/modules/OpenLMIMacros.cmake
index 30bdb69..874b517 100644
--- a/cmake/modules/OpenLMIMacros.cmake
+++ b/cmake/modules/OpenLMIMacros.cmake
@@ -8,14 +8,15 @@
# of the project root (Note: list is semi-colon separated, enclosed in quotes)
# @param[out] CIM_PROVIDERS list of sources of the provider generated from the MOFS
# @param[out] CIM_HEADERS list of header files generated from the MOFS
+# @param[out] CIM_CLASSES list of CIM classes defined in the MOFS
# @param[in] the rest of the argument are mof files that should be included
# in konkret header generation but are not scanned for classes
#
-macro(konkretcmpi_generate MOFS CIM_PROVIDERS CIM_HEADERS)
+macro(konkretcmpi_generate MOFS CIM_PROVIDERS CIM_HEADERS CIM_CLASSES)
# Create list of MOF files for konkret generator and
# list of classes defined in the MOF files
set(KONKRET_MOF_FILES "")
- set(CIM_CLASSES "")
+ set(CIM_CLASS_NAMES "")
# Add includes first (needs to be parsed before others)
foreach(MOF ${ARGN})
@@ -57,12 +58,12 @@ macro(konkretcmpi_generate MOFS CIM_PROVIDERS CIM_HEADERS)
string(REGEX MATCHALL "class [A-Za-z0-9_]+" CIM_CLASSESX ${MOF_CONTENT})
foreach(CLASSX ${CIM_CLASSESX})
string(REPLACE "class " "" CLASS ${CLASSX})
- set(CIM_CLASSES ${CIM_CLASSES} ${CLASS})
+ set(CIM_CLASS_NAMES ${CIM_CLASS_NAMES} ${CLASS})
endforeach(CLASSX ${CIM_CLASSESX})
endforeach(MOF in LISTS MOFS)
- list(LENGTH CIM_CLASSES LEN)
+ list(LENGTH CIM_CLASS_NAMES LEN)
if (${LEN} EQUAL 0)
message(FATAL_ERROR "No class found in the MOF files ${MOFS}")
else (${LEN} EQUAL 0)
@@ -71,7 +72,7 @@ macro(konkretcmpi_generate MOFS CIM_PROVIDERS CIM_HEADERS)
set(PROVIDERS "")
set(GENERATE_PROVIDERS "")
set(NEW_PROVIDERS "")
- foreach(CLASS ${CIM_CLASSES})
+ foreach(CLASS ${CIM_CLASS_NAMES})
# Add generated header to the list
set(HEADERS ${HEADERS} ${CLASS}.h)
# Get name of the source file
@@ -85,14 +86,14 @@ macro(konkretcmpi_generate MOFS CIM_PROVIDERS CIM_HEADERS)
endif (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROVIDER})
# Add provider source to the list
set(PROVIDERS ${PROVIDERS} ${PROVIDER})
- endforeach(CLASS ${CIM_CLASSES})
+ endforeach(CLASS ${CIM_CLASS_NAMES})
# Generate headers for CIM classes
set(ENV{KONKRET_SCHEMA_DIR} "/usr/share/mof/cim-current")
execute_process(COMMAND ${KONKRETCMPI_KONKRET}
${KONKRET_MOF_FILES}
${GENERATE_PROVIDERS}
- ${CIM_CLASSES}
+ ${CIM_CLASS_NAMES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
RESULT_VARIABLE RES
OUTPUT_VARIABLE OUT
@@ -112,6 +113,7 @@ macro(konkretcmpi_generate MOFS CIM_PROVIDERS CIM_HEADERS)
# Return to caller
set(${CIM_HEADERS} ${HEADERS})
set(${CIM_PROVIDERS} ${PROVIDERS})
+ set(${CIM_CLASSES} ${CIM_CLASS_NAMES})
endif (${LEN} EQUAL 0)
endmacro(konkretcmpi_generate MOF PROVIDERS HEADERS)