summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-10-22 17:37:46 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-10-22 17:37:46 (GMT)
commit1271a93434b6c32d0274cfad5e79cabeac80fc32 (patch)
treebf64daa4c3b86d574adb4b5f3b2916b6118eac03 /Modules
parent513369421602f0e102453779acfd2a58db70f2a9 (diff)
parent41564ff289b486ea0ccff46cb51f7ac3250f0312 (diff)
downloadCMake-1271a93434b6c32d0274cfad5e79cabeac80fc32.zip
CMake-1271a93434b6c32d0274cfad5e79cabeac80fc32.tar.gz
CMake-1271a93434b6c32d0274cfad5e79cabeac80fc32.tar.bz2
Merge topic 'fix-OSX-bundle-rpaths-and-Qt5'
41564ff2 BundleUtilities: Ensure framework symlinks and Info.plist exist
Diffstat (limited to 'Modules')
-rw-r--r--Modules/BundleUtilities.cmake18
1 files changed, 16 insertions, 2 deletions
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 445c719..fee0a7c 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -655,8 +655,12 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite
if(EXISTS "${resolved_resources}")
#message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_resources}' '${resolved_embedded_resources}'")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}")
- else()
- # Otherwise try at least copy Contents/Info.plist to Resources/Info.plist, if it exists:
+ endif()
+
+ # Some frameworks e.g. Qt put Info.plist in wrong place, so when it is
+ # missing in resources, copy it from other well known incorrect locations:
+ if(NOT EXISTS "${resolved_resources}/Info.plist")
+ # Check for Contents/Info.plist in framework root (older Qt SDK):
string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Contents/Info.plist" resolved_info_plist "${resolved_item}")
string(REGEX REPLACE "^(.*)/[^/]+$" "\\1/Resources/Info.plist" resolved_embedded_info_plist "${resolved_embedded_item}")
if(EXISTS "${resolved_info_plist}")
@@ -674,6 +678,16 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite
if(NOT EXISTS "${resolved_embedded_versions}/Current")
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${resolved_embedded_version}" "${resolved_embedded_versions}/Current")
endif()
+ # Restore symlinks in framework root pointing to current framework
+ # binary and resources:
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1" resolved_embedded_root "${resolved_embedded_item}")
+ string(REGEX REPLACE "^.*/([^/]+)$" "\\1" resolved_embedded_item_basename "${resolved_embedded_item}")
+ if(NOT EXISTS "${resolved_embedded_root}/${resolved_embedded_item_basename}")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/${resolved_embedded_item_basename}" "${resolved_embedded_root}/${resolved_embedded_item_basename}")
+ endif()
+ if(NOT EXISTS "${resolved_embedded_root}/Resources")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/Resources" "${resolved_embedded_root}/Resources")
+ endif()
endif()
endif()
if(UNIX AND NOT APPLE)