mirror of
https://github.com/reactos/CMake.git
synced 2024-12-13 22:58:41 +00:00
82be694c7a
Previously `file(GENERATE)` did not define any behavior for relative paths given to the `OUTPUT` or `INPUT` arguments. Define behavior consistent with CMake conventions and add a policy to provide compatibility for projects that relied on the old accidental behavior. Fixes: #16786
14 lines
435 B
CMake
14 lines
435 B
CMake
foreach(f
|
|
"${RunCMake_TEST_SOURCE_DIR}/relative-input-NEW.txt"
|
|
"${RunCMake_TEST_BINARY_DIR}/relative-output-NEW.txt"
|
|
)
|
|
if(EXISTS "${f}")
|
|
file(READ "${f}" content)
|
|
if(NOT content MATCHES "^relative-input-NEW[\r\n]*$")
|
|
string(APPEND RunCMake_TEST_FAILED "File\n ${f}\ndoes not have expected content.\n")
|
|
endif()
|
|
else()
|
|
string(APPEND RunCMake_TEST_FAILED "Missing\n ${f}\n")
|
|
endif()
|
|
endforeach()
|