2010-12-07 12:28:53 +00:00
|
|
|
# gp_item_default_embedded_path_override item default_embedded_path_var
|
|
|
|
|
#
|
|
|
|
|
# Return the path that others should refer to the item by when the item
|
|
|
|
|
# is embedded inside a bundle.
|
|
|
|
|
#
|
|
|
|
|
# This is a project-specific override of BundleUtilities.cmake's
|
|
|
|
|
# gp_item_default_embedded_path
|
|
|
|
|
#
|
|
|
|
|
function(gp_item_default_embedded_path_override item default_embedded_path_var)
|
|
|
|
|
|
|
|
|
|
# By default, embed items as set by gp_item_default_embedded_path:
|
|
|
|
|
#
|
|
|
|
|
set(path "${${default_embedded_path_var}}")
|
|
|
|
|
|
|
|
|
|
# But for OpenFlipper...
|
|
|
|
|
#
|
|
|
|
|
# ...embed *.dylib in the Libraries folder:
|
|
|
|
|
#
|
|
|
|
|
if(item MATCHES "\\.dylib$")
|
|
|
|
|
set(path "@executable_path/../Libraries")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# ...embed qt plugins in the Libraries folder:
|
|
|
|
|
#
|
|
|
|
|
if(item MATCHES "@QT_PLUGINS_DIR@" AND item MATCHES "\\.bundle")
|
|
|
|
|
file (RELATIVE_PATH _plugin "@QT_PLUGINS_DIR@" "${item}")
|
|
|
|
|
get_filename_component(_dir "${_plugin}" PATH)
|
|
|
|
|
set(path "@executable_path/../Resources/QtPlugins/${_dir}")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# ...embed *.so in the Plugins folder:
|
|
|
|
|
#
|
|
|
|
|
if(item MATCHES "\\.so$")
|
|
|
|
|
set(path "@executable_path/../Resources/Plugins")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set(${default_embedded_path_var} "${path}" PARENT_SCOPE)
|
|
|
|
|
endfunction(gp_item_default_embedded_path_override)
|
|
|
|
|
|
|
|
|
|
include (BundleUtilities)
|
|
|
|
|
|
2011-08-22 06:15:33 +00:00
|
|
|
if ( @BUILD_APPS@ )
|
|
|
|
|
message("Fixing up bundle ...")
|
|
|
|
|
|
|
|
|
|
# copy qt plugins to bundle
|
|
|
|
|
file (GLOB _plugins "@CMAKE_BINARY_DIR@/Build/OpenFlipper.app/Contents/Resources/Plugins/*.so")
|
|
|
|
|
file (GLOB_RECURSE _qtplugins "@QT_PLUGINS_DIR@/*.bundle")
|
|
|
|
|
foreach (_qtp ${_qtplugins})
|
|
|
|
|
get_filename_component(_dir "${_qtp}" PATH)
|
|
|
|
|
list(APPEND _qtdirs "${_dir}")
|
|
|
|
|
endforeach ()
|
|
|
|
|
|
|
|
|
|
# Get library paths
|
|
|
|
|
get_filename_component(_GlutDir "@GLUT_glut_LIBRARY@" PATH)
|
|
|
|
|
|
|
|
|
|
# fix all dependencies
|
|
|
|
|
fixup_bundle (@CMAKE_BINARY_DIR@/Build/bin/QtViewer "${_qtplugins}" "/usr/lib;${_qtdirs};${_GlutDir}")
|
|
|
|
|
|
|
|
|
|
endif()
|
2010-12-07 12:28:53 +00:00
|
|
|
|
|
|
|
|
# create qt plugin configuration file
|
2010-12-07 13:12:02 +00:00
|
|
|
# file(WRITE "@CMAKE_BINARY_DIR@/Build/OpenMesh.app/Contents/Resources/qt.conf" "[Paths]\nPlugins = Resources/QtPlugins")
|
2010-12-07 12:28:53 +00:00
|
|
|
|