Commit 8f1824c3 authored by Urs Fleisch's avatar Urs Fleisch
Browse files

Mac: Fix build with Qt 5.5.0.

parent fe670ea0
......@@ -27,6 +27,9 @@ endif (POLICY CMP0020)
if (POLICY CMP0045)
cmake_policy(SET CMP0045 OLD)
endif (POLICY CMP0045)
if (POLICY CMP0042)
cmake_policy(SET CMP0042 OLD)
endif (POLICY CMP0042)
set(BUILD_SHARED_LIBS ON CACHE BOOL "build shared libraries")
set(WITH_QT4 OFF CACHE BOOL "force use of Qt4")
......@@ -260,6 +263,14 @@ if (NOT WITH_QT4 AND NOT Qt4_FOUND AND NOT QT4_FOUND)
set(QT_EXECUTABLE_COMPILE_FLAGS ${Qt5Core_EXECUTABLE_COMPILE_FLAGS})
get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION)
get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH)
if (APPLE)
# For Mac Qt5.5.0 QT_LIBRARY_DIR is wrong
# (<installdir>/Qt5.5.0/5.5/clang_64/lib/QtCore.framework), fix it.
string(REGEX MATCH "^(.*)/QtCore.framework$" _qt5LibDir "${QT_LIBRARY_DIR}")
if (_qt5LibDir)
set(QT_LIBRARY_DIR ${CMAKE_MATCH_1})
endif (_qt5LibDir)
endif (APPLE)
get_target_property(QT_LUPDATE_EXECUTABLE Qt5::lupdate LOCATION)
get_target_property(QT_PLUGINS_DIR Qt5::QJpegPlugin LOCATION)
if (QT_PLUGINS_DIR)
......
......@@ -188,13 +188,6 @@ if (APPLE OR WIN32)
set(bundle_libs \"\${bundle_libs};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${WITH_LIBDIR}/kid3-cli\")
endif (APPLE AND BUILD_CLI_APP)
fixup_bundle(\"${bundle_app}\" \"\${bundle_libs}\" \"${QT_LIBRARY_DIR}\")
if (APPLE)
file(GLOB_RECURSE _qtlibs \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/kid3.app/Contents/Frameworks/*Qt*\")
file(GLOB_RECURSE _plugins \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/kid3.app/Contents/PlugIns/*.dylib\")
foreach (_universalBinary \${_plugins} \${_qtlibs})
execute_process(COMMAND lipo \${_universalBinary} -output \${_universalBinary} -thin i386)
endforeach (_universalBinary \${plugins})
endif (APPLE)
")
endif (APPLE OR WIN32)
......
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