From 94c0b483fbb422c283ffead6f4e82c4a1fd7a13e Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Sat, 21 Jun 2008 00:24:12 +0200 Subject: [PATCH] cmake: make generated headers a real target with dependecies --- CMakeLists.txt | 25 +++++++++++++++++++++++++ awesomeConfig.cmake | 9 --------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 771471d40..27f941cd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,31 @@ TARGET_LINK_LIBRARIES(${PROJECT_AWECLIENT_NAME} ${LIB_READLINE} ${LIB_NCURSES}) +# {{{ Generated headers +FILE(GLOB LAYOUTGEN_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/layouts/*.h) +ADD_CUSTOM_COMMAND(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/layoutgen.sh + ARGS > layoutgen.h + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/layoutgen.h + WORKING_DIRECTORY ${CURRENT_SOURCE_DIR} + DEPENDS ${LAYOUTGEN_DEPS} + COMMENT "Generating layoutgen.h." + VERBATIM) + +ADD_CUSTOM_COMMAND(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/widgetgen.sh + ARGS > widgetgen.h + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/widgetgen.h + WORKING_DIRECTORY ${CURRENT_SOURCE_DIR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/widget.h + COMMENT "Generating widgetgen.h." + VERBATIM) + +ADD_CUSTOM_TARGET(generated_headers + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/widgetgen.h + ${CMAKE_CURRENT_SOURCE_DIR}/layoutgen.h) + +ADD_DEPENDENCIES(${PROJECT_AWE_NAME} generated_headers) +# }}} + IF(GENERATE_MANPAGES) # Create luadoc file EXECUTE_PROCESS(COMMAND ${CAT_EXECUTABLE} ${AWE_SRCS} diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index 1c5305945..8f5682ede 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -197,15 +197,6 @@ FOREACH(file ${AWESOME_CONFIGURE_FILES}) ENDFOREACH() #}}} -# Execute some header generator -EXECUTE_PROCESS(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/layoutgen.sh - OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/layoutgen.h - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - -EXECUTE_PROCESS(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/widgetgen.sh - OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/widgetgen.h - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - # {{{ CPack configuration SET(CPACK_PACKAGE_NAME "${PROJECT_AWE_NAME}") SET(CPACK_GENERATOR "TBZ2")