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.
cmake/Tests/RunCMake/target_sources/FileSetGeneratedDependency....

13 lines
470 B

enable_language(C)
add_library(lib INTERFACE)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dependency.h
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/FileSetGeneratedDependency.h.in ${CMAKE_CURRENT_BINARY_DIR}/dependency.h
VERBATIM
)
target_sources(lib PUBLIC FILE_SET HEADERS BASE_DIRS ${CMAKE_CURRENT_BINARY_DIR} FILES ${CMAKE_CURRENT_BINARY_DIR}/dependency.h)
add_executable(exe dependency.c)
target_link_libraries(exe PRIVATE lib)