summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/OpenLMIMacros.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/cmake/modules/OpenLMIMacros.cmake b/cmake/modules/OpenLMIMacros.cmake
index 874b517..4eeb994 100644
--- a/cmake/modules/OpenLMIMacros.cmake
+++ b/cmake/modules/OpenLMIMacros.cmake
@@ -154,3 +154,23 @@ macro(cim_registration PROVIDER_NAME LIBRARY_NAME MOF DEST)
add_custom_target(unregister-${PROVIDER_NAME}
${OPENLMI_MOF_REGISTER} unregister ${MOF_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${REG})
endmacro(cim_registration)
+
+
+# This macro creates mof file with instances to profile registration
+#
+# @param[in] CIM_CLASS array of classes for which generate instances
+# @param[in] SKEL_MOF filename where is skeleton for instances
+# @param[out] OUT_MOF filename where to write generated instances
+#
+# todo:
+# check file exists
+#
+macro(profile_mof_generate SKEL_MOF OUT_MOF CIM_CLASSES)
+ SET(INSTANCE_SKEL "")
+ file(READ "${SKEL_MOF}" INSTANCE_SKEL)
+ foreach(CLASS ${CIM_CLASSES})
+ string(REPLACE "\@CLASS\@" ${CLASS} INSTANCE "${INSTANCE_SKEL}")
+ file(APPEND "${OUT_MOF}" "${INSTANCE}")
+ endforeach(CLASS ${CIM_CLASSES})
+ message(STATUS "Generated profile mof ${OUT_MOF}")
+endmacro(profile_mof_generate)