diff options
author | Roman Rakus <rrakus@redhat.com> | 2013-07-24 11:32:34 +0200 |
---|---|---|
committer | Roman Rakus <rrakus@redhat.com> | 2013-07-24 11:32:34 +0200 |
commit | 99f551607ff6c0f7f941873766e1533f0ce41245 (patch) | |
tree | 538f590eb8a1899a5899985dd2b569308b310713 /cmake/modules | |
parent | 563748abc86a7121aebfd963e628c08c7cc56646 (diff) | |
download | openlmi-providers-99f551607ff6c0f7f941873766e1533f0ce41245.tar.gz openlmi-providers-99f551607ff6c0f7f941873766e1533f0ce41245.tar.xz openlmi-providers-99f551607ff6c0f7f941873766e1533f0ce41245.zip |
Common: Macro for generating profile registration mof
Signed-off-by: Roman Rakus <rrakus@redhat.com>
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/OpenLMIMacros.cmake | 20 |
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) |