cmake/Tests/RunCMake/Codegen/exclude-from-all.cmake
2024-11-11 15:18:55 +01:00

12 lines
365 B
CMake

add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/generated.h
COMMAND
${CMAKE_COMMAND} -E false
CODEGEN
)
# We don't want codegen to drive parts of the project that are EXCLUDE_FROM_ALL.
# This tests that foobar is properly excluded from the codegen build.
add_executable(foobar EXCLUDE_FROM_ALL error.c ${CMAKE_CURRENT_BINARY_DIR}/generated.h)