summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRadek Novacek <rnovacek@redhat.com>2012-07-24 10:04:34 +0200
committerRadek Novacek <rnovacek@redhat.com>2012-07-24 10:04:34 +0200
commitf2c2ecd1f432dc0c40a9ddce43781962ef02712b (patch)
treeea36c4c88ee13d2a24a3cf7e6915b8e0a4ae3612 /cmake
parent2930a506e474f7316f39e18be83cdf8eda863d05 (diff)
downloadopenlmi-providers-f2c2ecd1f432dc0c40a9ddce43781962ef02712b.tar.gz
openlmi-providers-f2c2ecd1f432dc0c40a9ddce43781962ef02712b.tar.xz
openlmi-providers-f2c2ecd1f432dc0c40a9ddce43781962ef02712b.zip
Add target for manual registration of each provider
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/CuraMacros.cmake22
1 files changed, 16 insertions, 6 deletions
diff --git a/cmake/modules/CuraMacros.cmake b/cmake/modules/CuraMacros.cmake
index 6c80c7f..ffd9d32 100644
--- a/cmake/modules/CuraMacros.cmake
+++ b/cmake/modules/CuraMacros.cmake
@@ -76,16 +76,26 @@ endmacro(konkretcmpi_generate MOF PROVIDERS HEADERS)
# This macro creates registration file from shared library
#
-# @param[in] PROVIDER name of the library without lib and .so (same as for add_library)
+# @param[in] PROVIDER_NAME human-readable name of the provider
+# @param[in] LIBRARY_NAME name of the library without lib prefix and .so suffix (same as for add_library)
+# @param[in] MOF name of the MOF file
#
-macro(cim_registration PROVIDER)
+macro(cim_registration PROVIDER_NAME LIBRARY_NAME MOF)
# Create registration out of shared library
- add_custom_command(TARGET ${PROVIDER}
+ add_custom_command(TARGET ${LIBRARY_NAME}
POST_BUILD
- COMMAND ${KONKRETCMPI_KONKRETREG} -r lib${PROVIDER}.so > ${PROVIDER}.registration
- COMMENT "Generating .reg file from library for ${PROVIDER}"
+ COMMAND ${KONKRETCMPI_KONKRETREG} -r lib${LIBRARY_NAME}.so > ${PROVIDER_NAME}.registration
+ COMMENT "Generating .reg file from library for ${PROVIDER_NAME}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
# Install it
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER}.registration DESTINATION share/cura-providers/)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_NAME}.registration DESTINATION share/cura-providers/)
+
+ # Add custom target for registration
+ find_file(MOF_FILE
+ ${MOF}
+ PATHS ${CMAKE_SOURCE_DIR}/mof/
+ )
+ add_custom_target(register-${PROVIDER_NAME}
+ ${CMAKE_SOURCE_DIR}/provider-register.sh -m ${MOF_FILE} -r ${CMAKE_CURRENT_BINARY_DIR}/${PROVIDER_NAME}.registration)
endmacro(cim_registration)