summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-07-09 18:23:38 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-07-09 18:23:38 (GMT)
commitcdc00f0f7ef6c28540a1755573b477690501ee7f (patch)
tree1cb3eaf2a4b57cb35f5175860de3978ef6182817 /Modules
parentb636728e390b62c5952d2d3063d071fe5746008a (diff)
parentac7a1939511eda6b2baa1211fa5dcd12ec241fae (diff)
downloadCMake-cdc00f0f7ef6c28540a1755573b477690501ee7f.zip
CMake-cdc00f0f7ef6c28540a1755573b477690501ee7f.tar.gz
CMake-cdc00f0f7ef6c28540a1755573b477690501ee7f.tar.bz2
Merge topic 'getprerequisites-pie-executables'
ac7a193 GetPrerequisites.cmake: detect executables built with the -pie linker flag.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/GetPrerequisites.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 8761f40..d215685 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -195,6 +195,14 @@ function(is_file_executable file result_var)
return()
endif("${file_ov}" MATCHES "text")
endif("${file_ov}" MATCHES "executable")
+
+ # Also detect position independent executables on Linux,
+ # where "file" gives "shared object ... (uses shared libraries)"
+ if("${file_ov}" MATCHES "shared object.*\(uses shared libs\)")
+ set(${result_var} 1 PARENT_SCOPE)
+ return()
+ endif()
+
else(file_cmd)
message(STATUS "warning: No 'file' command, skipping execute_process...")
endif(file_cmd)