summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/File_Generate/GenerateSource.cmake
blob: 147a7f66a651a6a454725789516cfae02b11bc0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12

enable_language(CXX)

# Ensure re-generation
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")

file(GENERATE
  OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
  CONTENT "int main() { return 0; }\n"
)

add_executable(mn "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")