cmake/Tests/RunCMake/GeneratorInstance/DefaultInstance.cmake

15 lines
596 B
CMake
Raw Normal View History

2018-04-23 21:13:27 +02:00
if("x${CMAKE_GENERATOR_INSTANCE}" STREQUAL "x")
message(FATAL_ERROR "CMAKE_GENERATOR_INSTANCE is empty but should have a value.")
elseif("x${CMAKE_GENERATOR_INSTANCE}" MATCHES [[\\]])
message(FATAL_ERROR
"CMAKE_GENERATOR_INSTANCE is\n"
" ${CMAKE_GENERATOR_INSTANCE}\n"
"which contains a backslash.")
elseif(NOT IS_DIRECTORY "${CMAKE_GENERATOR_INSTANCE}")
message(FATAL_ERROR
"CMAKE_GENERATOR_INSTANCE is\n"
" ${CMAKE_GENERATOR_INSTANCE}\n"
"which is not an existing directory.")
endif()
2022-03-29 21:10:50 +02:00
file(WRITE "${CMAKE_BINARY_DIR}/instance.txt" "${CMAKE_GENERATOR_INSTANCE}")