From c8e8b0fcd053b40eb0a54e617dda3406725f60f9 Mon Sep 17 00:00:00 2001 From: Rashad Kanavath <rashad.kanavath@c-s.fr> Date: Mon, 2 Jan 2017 11:32:43 +0100 Subject: [PATCH] Revert "PKG: XDK: fix is executable2 function for windows (check .exe and .dll)" This reverts commit 133cbd1a909e5bcb447cdb83ca386feb8b27c417. --- SuperBuild/Packaging/PackageMacros.cmake | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/SuperBuild/Packaging/PackageMacros.cmake b/SuperBuild/Packaging/PackageMacros.cmake index 8f2a704bef..eea19d1d02 100755 --- a/SuperBuild/Packaging/PackageMacros.cmake +++ b/SuperBuild/Packaging/PackageMacros.cmake @@ -266,20 +266,23 @@ function(func_is_file_a_symbolic_link file result_var1 result_var2) get_filename_component(file_full "${file}" ABSOLUTE) string(TOLOWER "${file_full}" file_full_lower) - # If file name ends in .exe on Windows, *assume* executable. - # And If file name ends in .dll on Windows, *assume* libary. + # If file name ends in .exe on Windows, *assume* executable: + # if(WIN32 AND NOT UNIX) - if("${file_full_lower}" MATCHES "(\\.exe|\\.dll)$") - set(${result_var} 1 PARENT_SCOPE) + if("${file_full_lower}" MATCHES "\\.lnk$") + set(${result_var1} 1 PARENT_SCOPE) + #Assuming the file is linked to a file with same name without .lnk extension + get_filename_component(name_we_lnk "${file_full_lower}" NAME_WE) + set(${result_var2} "${name_we_lnk}" PARENT_SCOPE) return() endif() - + # A clause could be added here that uses output or return value of dumpbin # to determine ${result_var}. In 99%+? practical cases, the exe name # match will be sufficient... # endif() - + # Use the information returned from the Unix shell command "file" to # determine if ${file_full} should be considered an executable file... # -- GitLab