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 ) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(GeneratedHeader main.cpp)