diff options
author | David Cole <david.cole@kitware.com> | 2012-01-25 16:17:12 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-01-25 16:17:12 (GMT) |
commit | 476679afaf99cb4d3f436499f0fef89f5590ca0d (patch) | |
tree | c3b4ef5997fa60b90fea637ec2d07b89429e0f17 /Modules | |
parent | 352279cdc28940ff116d7c63005b029fc0a9b3d4 (diff) | |
parent | 98d20316bdf701865a3e3c4df7d378917224b8b0 (diff) | |
download | CMake-476679afaf99cb4d3f436499f0fef89f5590ca0d.zip CMake-476679afaf99cb4d3f436499f0fef89f5590ca0d.tar.gz CMake-476679afaf99cb4d3f436499f0fef89f5590ca0d.tar.bz2 |
Merge topic 'GetPrerequisites-rpath-OSX'
98d2031 Fix BundleUtilities test failure with space in build path.
36d6641 Fix new BundleUtilities test failure on Mac 10.4.x
0d96dec GetPrerequisites: Add test for @rpath support.
880139a GetPrerequisites: Add support for @rpath on Mac OS X.
9a6b102 GetPrerequisites: Add support for @rpath on Mac OS X.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/GetPrerequisites.cmake | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 2efa079..8761f40 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -304,6 +304,26 @@ function(gp_resolve_item context item exepath dirs resolved_item_var) endif(NOT resolved) if(NOT resolved) + if(item MATCHES "@rpath") + # + # @rpath references are relative to the paths built into the binaries with -rpath + # We handle this case like we do for other Unixes + # + string(REPLACE "@rpath/" "" norpath_item "${item}") + + set(ri "ri-NOTFOUND") + find_file(ri "${norpath_item}" ${exepath} ${dirs} NO_DEFAULT_PATH) + if(ri) + #message(STATUS "info: 'find_file' in exepath/dirs (${ri})") + set(resolved 1) + set(resolved_item "${ri}") + set(ri "ri-NOTFOUND") + endif(ri) + + endif(item MATCHES "@rpath") + endif(NOT resolved) + + if(NOT resolved) set(ri "ri-NOTFOUND") find_file(ri "${item}" ${exepath} ${dirs} NO_DEFAULT_PATH) find_file(ri "${item}" ${exepath} ${dirs} /usr/lib) @@ -461,6 +481,15 @@ function(gp_resolved_file_type original_file file exepath dirs type_var) get_filename_component(path "${lower}" PATH) if("${original_path}" STREQUAL "${path}") set(is_local 1) + else() + string(LENGTH "${original_path}/" original_length) + string(LENGTH "${lower}" path_length) + if(${path_length} GREATER ${original_length}) + string(SUBSTRING "${lower}" 0 ${original_length} path) + if("${original_path}/" STREQUAL "${path}") + set(is_embedded 1) + endif() + endif() endif() endif() endif() |