cmake: make generated headers a real target with dependecies

This commit is contained in:
Michael Gehring 2008-06-21 00:24:12 +02:00 committed by Julien Danjou
parent 0ec46b99b9
commit 94c0b483fb
2 changed files with 25 additions and 9 deletions

View File

@ -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}

View File

@ -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")