diff options
author | Brad King <brad.king@kitware.com> | 2016-08-12 14:18:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-12 14:24:48 (GMT) |
commit | a2d5c25a7a2b344ba7cf74d44c43bd6054263f59 (patch) | |
tree | 97a551dfa510cb2d7920921af4af0c503839e5f2 /Modules/GetPrerequisites.cmake | |
parent | f59513140bf086eda2029c5b4e950fc58216c06e (diff) | |
download | CMake-a2d5c25a7a2b344ba7cf74d44c43bd6054263f59.zip CMake-a2d5c25a7a2b344ba7cf74d44c43bd6054263f59.tar.gz CMake-a2d5c25a7a2b344ba7cf74d44c43bd6054263f59.tar.bz2 |
GetPrerequisites: Fix regression in gp_resolved_file_type
Since commit v3.6.0-rc1~287^2 (GetPrerequisites: Fix
gp_resolved_file_type on non-canonical paths, 2016-03-08) we
accidentally convert relative paths (e.g. system dll file names) to
absolute paths even when we do not know the base directory. Fix this by
canonicalizing only paths that are already absolute.
Closes: #16240
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r-- | Modules/GetPrerequisites.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index aa5bf28..fb7bf93 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -500,7 +500,9 @@ function(gp_resolved_file_type original_file file exepath dirs type_var) if(NOT IS_ABSOLUTE "${original_file}") message(STATUS "warning: gp_resolved_file_type expects absolute full path for first arg original_file") endif() - get_filename_component(original_file "${original_file}" ABSOLUTE) # canonicalize path + if(IS_ABSOLUTE "${original_file}") + get_filename_component(original_file "${original_file}" ABSOLUTE) # canonicalize path + endif() set(is_embedded 0) set(is_local 0) @@ -516,7 +518,9 @@ function(gp_resolved_file_type original_file file exepath dirs type_var) if(NOT IS_ABSOLUTE "${file}") gp_resolve_item("${original_file}" "${file}" "${exepath}" "${dirs}" resolved_file "${rpaths}") endif() - get_filename_component(resolved_file "${resolved_file}" ABSOLUTE) # canonicalize path + if(IS_ABSOLUTE "${resolved_file}") + get_filename_component(resolved_file "${resolved_file}" ABSOLUTE) # canonicalize path + endif() string(TOLOWER "${original_file}" original_lower) string(TOLOWER "${resolved_file}" lower) |