summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/target_sources/FileSetGeneratedDependency.cmake
blob: 9e9192901b16a551b1d286f3b01db146be0a2ff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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)