From a35a5394b0eb3978bd114afe8f1b7ff69ad6af62 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Mon, 13 May 2013 18:01:41 +0200 Subject: Provide a macro for generating the enums --- src/CMakeLists.txt | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 443025d..6d4d6b9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,29 +11,9 @@ set(uca_HDRS uca-camera.h uca-plugin-manager.h) -# --- Generate enum file -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/uca-enums.h - COMMAND ${GLIB2_MKENUMS} - ARGS - --template uca-enums.h.template - ${UCA_ENUM_HDRS} > ${CMAKE_CURRENT_BINARY_DIR}/uca-enums.h - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${UCA_ENUM_HDRS} - ${CMAKE_CURRENT_SOURCE_DIR}/uca-enums.h.template) - -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/uca-enums.c - COMMAND ${GLIB2_MKENUMS} - ARGS - --template uca-enums.c.template - ${UCA_ENUM_HDRS} > ${CMAKE_CURRENT_BINARY_DIR}/uca-enums.c - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${UCA_ENUM_HDRS} - ${CMAKE_CURRENT_BINARY_DIR}/uca-enums.h - ${CMAKE_CURRENT_SOURCE_DIR}/uca-enums.c.template - ) - +create_enums(uca-enums + ${CMAKE_CURRENT_SOURCE_DIR}/uca-enums + ${uca_HDRS}) # --- Configure --------------------------------------------------------------- -- cgit v1.2.3