Commit ec16d52c authored by Jan Möbius's avatar Jan Möbius

Make sure that either debug or release versions of plugins are copied into the...

Make sure that either debug or release versions of plugins are copied into the bundle. Otherwise we get crashes due to mixing them.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14015 383ad7c9-94d9-4d36-a494-682f7c89f535
parent eeb8ee80
......@@ -255,8 +255,32 @@ if ( APPLE )
acg_copy_after_build( OpenFlipper "/opt/local/libexec/qt4-mac/lib/QtGui.framework/Versions/4/Resources/qt_menu.nib" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/qt_menu.nib")
endif ()
# Copy qt plugins into bundle
acg_copy_after_build ( OpenFlipper "${QT_PLUGINS_DIR}" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/QtPlugins")
# Copy qt plugins into bundle but omit debug libraries when in release mode and vice versa
acg_unset (_files)
acg_get_files_in_dir (_files ${QT_PLUGINS_DIR})
foreach (_file ${_files})
if ( CMAKE_BUILD_TYPE MATCHES "Release" )
# In release mode, we don't want debug binaries in the bundle as it could cause crashes due to wrong linking or mixing of debug and release
if ( NOT _file MATCHES ".*debug.*" )
add_custom_command(TARGET OpenFlipper POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${QT_PLUGINS_DIR}/${_file}" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/QtPlugins/${_file}"
)
endif()
else ()
# In debug mode, we don't want release binaries in the bundle as it could cause crashes due to wrong linking or mixing of debug and release
if ( _file MATCHES ".*debug.*" )
add_custom_command(TARGET OpenFlipper POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${QT_PLUGINS_DIR}/${_file}" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/QtPlugins/${_file}"
)
endif()
endif()
endforeach ()
elseif(WIN32)
#copy qt plugins to Build directory and configure qt.conf file
......
......@@ -42,6 +42,7 @@ include (BundleUtilities)
# copy qt plugins to bundle
file (GLOB _plugins "@CMAKE_BINARY_DIR@/Build/OpenFlipper.app/Contents/Resources/Plugins/*.so")
file (GLOB_RECURSE _qtplugins "@CMAKE_BINARY_DIR@/Build/OpenFlipper.app/Contents/Resources/QtPlugins/*.dylib")
foreach (_qtp ${_qtplugins})
get_filename_component(_dir "${_qtp}" PATH)
list(APPEND _qtdirs "${_dir}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment