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 /Source | |
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 'Source')
-rw-r--r-- | Source/cmFileCommand.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 00a68a8..45fba8b 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -30,7 +30,6 @@ #include "cmArgumentParser.h" #include "cmArgumentParserTypes.h" -#include "cmCMakePath.h" #include "cmCryptoHash.h" #include "cmELF.h" #include "cmExecutionStatus.h" @@ -1278,9 +1277,9 @@ bool HandleRealPathCommand(std::vector<std::string> const& args, } } - cmCMakePath path(input, cmCMakePath::auto_format); - path = path.Absolute(*arguments.BaseDirectory).Normal(); - auto realPath = cmSystemTools::GetRealPath(path.GenericString()); + auto realPath = + cmSystemTools::CollapseFullPath(input, *arguments.BaseDirectory); + realPath = cmSystemTools::GetRealPath(realPath); status.GetMakefile().AddDefinition(args[2], realPath); |