diff options
author | Brad King <brad.king@kitware.com> | 2023-03-21 13:05:47 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-03-21 13:05:56 (GMT) |
commit | 926501c42ae9d4c17a988412e570a1cf99eee5af (patch) | |
tree | 53c5a5d1895b41afeac3da7f7549d14a6c23a025 /Tests | |
parent | e05dcdf246233fcaefe520846a0b353d13d78463 (diff) | |
parent | 1d12853ed3c2b3307714c8556f261df70350a980 (diff) | |
download | CMake-926501c42ae9d4c17a988412e570a1cf99eee5af.zip CMake-926501c42ae9d4c17a988412e570a1cf99eee5af.tar.gz CMake-926501c42ae9d4c17a988412e570a1cf99eee5af.tar.bz2 |
Merge topic 'file-REAL_PATH'
1d12853ed3 file(REAL_PATH): Ensure same behavior as get_filename_component(REALPATH)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !8348
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() |