mirror of
https://github.com/reactos/CMake.git
synced 2024-12-15 15:48:52 +00:00
ccd29b9af8
When the primary source tree path named by a DATA{} reference does not exist, produce an AUTHOR_WARNING instead of a FATAL_ERROR. This is useful when writing a new DATA{} reference to a test reference output that has not been created yet. This way the developer can run the test, manually verify the output, and then copy it into place to provide the reference and eliminate the warning. If the named source tree path is expected to be a file but exists as a directory, we still need to produce a FATAL_ERROR.
11 lines
376 B
CMake
11 lines
376 B
CMake
include(ExternalData)
|
|
|
|
set(output "${CMAKE_BINARY_DIR}/MissingData.txt")
|
|
ExternalData_Expand_Arguments(Data args DATA{MissingData.txt,Data.txt})
|
|
if("x${args}" STREQUAL "x${output}")
|
|
message(STATUS "Missing data reference correctly transformed!")
|
|
else()
|
|
message(FATAL_ERROR "Missing data reference transformed to:\n ${args}\n"
|
|
"but we expected:\n ${output}")
|
|
endif()
|