cmake: move gperf commands to generated_sources
This commit is contained in:
parent
138895317c
commit
3b2848f00b
|
@ -26,25 +26,6 @@ SET(AWE_DOC_FILES
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/README
|
${CMAKE_CURRENT_SOURCE_DIR}/README
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
|
${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
|
||||||
|
|
||||||
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/common)
|
|
||||||
ADD_CUSTOM_COMMAND(
|
|
||||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gperf.sh
|
|
||||||
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/common/tokenize.gperf
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.h
|
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.h
|
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/common/tokenize.gperf
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gperf.sh
|
|
||||||
COMMENT "Generating common/tokenize.h"
|
|
||||||
)
|
|
||||||
ADD_CUSTOM_COMMAND(
|
|
||||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gperf.sh
|
|
||||||
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/common/tokenize.gperf
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.c
|
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.c
|
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/common/tokenize.gperf
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gperf.sh
|
|
||||||
COMMENT "Generating common/tokenize.c"
|
|
||||||
)
|
|
||||||
SET(AWE_SRCS
|
SET(AWE_SRCS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/awesome.c
|
${CMAKE_CURRENT_SOURCE_DIR}/awesome.c
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/client.c
|
${CMAKE_CURRENT_SOURCE_DIR}/client.c
|
||||||
|
@ -103,9 +84,8 @@ SET(AWE_MAN_SRCS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/awesomerc.5.txt)
|
${CMAKE_CURRENT_SOURCE_DIR}/awesomerc.5.txt)
|
||||||
|
|
||||||
ADD_EXECUTABLE(${PROJECT_AWE_NAME} ${AWE_SRCS}
|
ADD_EXECUTABLE(${PROJECT_AWE_NAME} ${AWE_SRCS}
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.c
|
${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.c)
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.h
|
|
||||||
)
|
|
||||||
ADD_EXECUTABLE(${PROJECT_AWECLIENT_NAME} ${AWE_CLIENT_SRCS})
|
ADD_EXECUTABLE(${PROJECT_AWECLIENT_NAME} ${AWE_CLIENT_SRCS})
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(${PROJECT_AWE_NAME}
|
TARGET_LINK_LIBRARIES(${PROJECT_AWE_NAME}
|
||||||
|
@ -116,29 +96,54 @@ TARGET_LINK_LIBRARIES(${PROJECT_AWECLIENT_NAME}
|
||||||
${LIB_READLINE}
|
${LIB_READLINE}
|
||||||
${LIB_NCURSES})
|
${LIB_NCURSES})
|
||||||
|
|
||||||
# {{{ Generated headers
|
# {{{ Generated sources
|
||||||
FILE(GLOB LAYOUTGEN_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/layouts/*.h)
|
FILE(GLOB LAYOUTGEN_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/layouts/*.h)
|
||||||
ADD_CUSTOM_COMMAND(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/layoutgen.sh
|
ADD_CUSTOM_COMMAND(
|
||||||
ARGS > ${CMAKE_CURRENT_BINARY_DIR}/layoutgen.h
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/layoutgen.sh
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/layoutgen.h
|
ARGS > ${CMAKE_CURRENT_BINARY_DIR}/layoutgen.h
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/layoutgen.h
|
||||||
DEPENDS ${LAYOUTGEN_DEPS}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
COMMENT "Generating layoutgen.h."
|
DEPENDS ${LAYOUTGEN_DEPS}
|
||||||
VERBATIM)
|
COMMENT "Generating layoutgen.h."
|
||||||
|
VERBATIM)
|
||||||
|
|
||||||
ADD_CUSTOM_COMMAND(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/widgetgen.sh
|
ADD_CUSTOM_COMMAND(
|
||||||
ARGS > ${CMAKE_CURRENT_BINARY_DIR}/widgetgen.h
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/widgetgen.sh
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/widgetgen.h
|
ARGS > ${CMAKE_CURRENT_BINARY_DIR}/widgetgen.h
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/widgetgen.h
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/widget.h
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
COMMENT "Generating widgetgen.h."
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/widget.h
|
||||||
VERBATIM)
|
COMMENT "Generating widgetgen.h."
|
||||||
|
VERBATIM)
|
||||||
|
|
||||||
ADD_CUSTOM_TARGET(generated_headers
|
# gperf
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/widgetgen.h
|
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/common)
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/layoutgen.h)
|
|
||||||
|
|
||||||
ADD_DEPENDENCIES(${PROJECT_AWE_NAME} generated_headers)
|
ADD_CUSTOM_COMMAND(
|
||||||
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gperf.sh
|
||||||
|
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/common/tokenize.gperf
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.h
|
||||||
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.h
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/common/tokenize.gperf
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gperf.sh
|
||||||
|
COMMENT "Generating common/tokenize.h")
|
||||||
|
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gperf.sh
|
||||||
|
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/common/tokenize.gperf
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.c
|
||||||
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.c
|
||||||
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/common/tokenize.gperf
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/build-utils/gperf.sh
|
||||||
|
COMMENT "Generating common/tokenize.c")
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(generated_sources
|
||||||
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/widgetgen.h
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/layoutgen.h
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.c
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/common/tokenize.h)
|
||||||
|
|
||||||
|
ADD_DEPENDENCIES(${PROJECT_AWE_NAME} generated_sources)
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# {{{ version stamp
|
# {{{ version stamp
|
||||||
|
|
Loading…
Reference in New Issue