You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
723 B

add_custom_target(foobar
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/generated.h.in
${CMAKE_CURRENT_BINARY_DIR}/generated.h
BYPRODUCTS
${CMAKE_CURRENT_BINARY_DIR}/generated.h
)
# This codegen step relies on the BYPRODUCTS of the previous command.
# If foobar isn't properly accounted for as a dependency it will fail.
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.hpp
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/generated.h
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/generated.h
${CMAKE_CURRENT_BINARY_DIR}/generated.hpp
CODEGEN
)
add_custom_target(hpp_creator ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/generated.hpp)