summaryrefslogtreecommitdiffstats
path: root/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt
blob: f7308e89056b5465b6918c173564c08a5957e940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Simulate in-source build include-file behavior for out-of-source
# builds.
set(CMAKE_INCLUDE_CURRENT_DIR 1)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h
  COMMAND
  ${CMAKE_COMMAND} ARGS -E
  copy ${CMAKE_CURRENT_SOURCE_DIR}/generated.h.in
  ${CMAKE_CURRENT_BINARY_DIR}/generated.h
)

add_library(GeneratedHeader main.cpp ${CMAKE_CURRENT_BINARY_DIR}/generated.h)