diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2023-03-19 12:32:02 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2023-03-20 13:14:11 (GMT) |
commit | 1d12853ed3c2b3307714c8556f261df70350a980 (patch) | |
tree | e629c5aa7ba667d581f67d5f27bf475e2cafe000 /Tests | |
parent | c3110a500e6ff66775976680d36500b4919ec37e (diff) | |
download | CMake-1d12853ed3c2b3307714c8556f261df70350a980.zip CMake-1d12853ed3c2b3307714c8556f261df70350a980.tar.gz CMake-1d12853ed3c2b3307714c8556f261df70350a980.tar.bz2 |
file(REAL_PATH): Ensure same behavior as get_filename_component(REALPATH)
Fixes: #24605
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/file/REAL_PATH.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/file/REAL_PATH.cmake b/Tests/RunCMake/file/REAL_PATH.cmake index 0b5d3c0..9c5d4ea 100644 --- a/Tests/RunCMake/file/REAL_PATH.cmake +++ b/Tests/RunCMake/file/REAL_PATH.cmake @@ -34,3 +34,19 @@ file(REAL_PATH "~/test.txt" real_path EXPAND_TILDE) if (NOT real_path STREQUAL "${HOME_DIR}/test.txt") message(SEND_ERROR "real path is \"${real_path}\", should be \"${HOME_DIR}/test.txt\"") endif() + +if (WIN32) + cmake_policy(SET CMP0139 NEW) + + set(in "${CMAKE_CURRENT_BINARY_DIR}/AbC.TxT") + + file(REMOVE "${in}") + file(TOUCH "${in}") + + string(TOLOWER "${in}" low) + file(REAL_PATH "${low}" out) + + if(NOT "${out}" PATH_EQUAL "${in}") + message(SEND_ERROR "real path is \"${out}\", should be \"${in}\"") + endif() +endif() |