mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 03:39:43 -06:00
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
367 B
CMake
11 lines
367 B
CMake
include(ExternalData)
|
|
|
|
set(output "${CMAKE_SOURCE_DIR}/MissingData.txt")
|
|
ExternalData_Expand_Arguments(Data args DATA{MissingData.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()
|