Commit c09f47de authored by Urs Fleisch's avatar Urs Fleisch
Browse files

QML: Fix build on Windows and Mac OS X.

parent a875f4ec
......@@ -218,7 +218,7 @@ $DOWNLOAD http://ftp.de.debian.org/debian/pool/main/m/mp4v2/mp4v2_${mp4v2_versio
if test "$compiler" = "cross-mingw"; then
test -f mingw.cmake ||
cat >mingw.cmake <<EOF
set(QT_PREFIX /windows/Qt/$qt_version)
set(QT_PREFIX /windows/Qt/Qt5.4.0/5.4/mingw491_32)
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER ${cross_host}-gcc)
......@@ -229,9 +229,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(QT_BINARY_DIR /usr/lib/${HOSTTYPE/i686/i386}-linux-gnu/qt4/bin)
set(QT_BINARY_DIR /usr/lib/${HOSTTYPE/i686/i386}-linux-gnu/qt5/bin)
set(QT_LIBRARY_DIR \${QT_PREFIX}/lib)
set(QT_QTCORE_LIBRARY \${QT_PREFIX}/lib/libQtCore4.a)
set(QT_QTCORE_LIBRARY \${QT_PREFIX}/lib/libQt5Core.a)
set(QT_QTCORE_INCLUDE_DIR \${QT_PREFIX}/include/QtCore)
set(QT_MKSPECS_DIR \${QT_PREFIX}/mkspecs)
set(QT_MOC_EXECUTABLE \${QT_BINARY_DIR}/moc)
......@@ -2180,7 +2180,7 @@ echo "### Ignore make error"
cp -f po/*.qm doc/*/kid3*.html $INSTDIR
for f in QtCore4.dll QtNetwork4.dll QtGui4.dll QtXml4.dll phonon4.dll libgcc_s_dw2-1.dll libstdc++-6.dll libwinpthread-1.dll; do
for f in Qt5Core.dll Qt5Network.dll Qt5Gui.dll Qt5Xml.dll Qt5Widgets.dll Qt5Multimedia.dll Qt5Qml.dll Qt5Quick.dll libgcc_s_dw2-1.dll libstdc++-6.dll libwinpthread-1.dll icuin53.dll icuuc53.dll icudt53.dll; do
cp $QT_BIN_DIR/$f $INSTDIR
done
......
......@@ -211,14 +211,5 @@ if (WIN32)
"${QT_BINARY_DIR}/libwinpthread-1.dll"
"${QT_BINARY_DIR}/libiconv-2.dll"
DESTINATION ${WITH_BINDIR})
else (NOT HAVE_QT5)
if (EXISTS "${_qt5Dir}/../ported-x32/bin/libjpeg-8.dll")
install(FILES "${_qt5Dir}/../ported-x32/bin/libjpeg-8.dll"
DESTINATION ${WITH_BINDIR})
endif ()
string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type_uc)
get_target_property(_qt5xml_location Qt5::Xml IMPORTED_LOCATION_${_build_type_uc})
install(FILES ${_qt5xml_location}
DESTINATION ${WITH_BINDIR})
endif (NOT HAVE_QT5)
endif (WIN32)
......@@ -23,7 +23,12 @@ string(TOLOWER ${plugin_NAME} plugin_TARGET)
qt4_wrap_cpp(plugin_GEN_MOC_SRCS ${plugin_MOC_HDRS})
add_library(${plugin_TARGET} MODULE ${plugin_SRCS} ${plugin_GEN_MOC_SRCS})
if (APPLE)
# The extension must be dylib, not so.
add_library(${plugin_TARGET} SHARED ${plugin_SRCS} ${plugin_GEN_MOC_SRCS})
else (APPLE)
add_library(${plugin_TARGET} MODULE ${plugin_SRCS} ${plugin_GEN_MOC_SRCS})
endif (APPLE)
target_link_libraries(${plugin_TARGET} kid3-core ${BASIC_LIBRARIES})
install(TARGETS ${plugin_TARGET}
......@@ -35,13 +40,20 @@ set_target_properties(
LIBRARY_OUTPUT_DIRECTORY ${kid3_plugins_BINARY_DIR}/imports/Kid3App
)
if (WIN32)
set(_qmldirPluginName libkid3appqml)
else (WIN32)
set(_qmldirPluginName kid3appqml)
endif (WIN32)
add_custom_command(TARGET ${plugin_TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "module Kid3App" > "${kid3_plugins_BINARY_DIR}/imports/Kid3App/qmldir"
COMMAND ${CMAKE_COMMAND} -E echo "plugin kid3appqml" >> "${kid3_plugins_BINARY_DIR}/imports/Kid3App/qmldir"
COMMAND ${CMAKE_COMMAND} -E echo "plugin ${_qmldirPluginName}" >> "${kid3_plugins_BINARY_DIR}/imports/Kid3App/qmldir"
)
string(REGEX MATCH "(i586-mingw32msvc-g\\+\\+|i686-w64-mingw32-g\\+\\+)" _crossMingwMatch "${CMAKE_CXX_COMPILER}")
if (NOT _crossMingwMatch)
if (WIN32)
install(FILES "${kid3_plugins_BINARY_DIR}/imports/Kid3App/qmldir"
DESTINATION ${WITH_PLUGINSDIR}/imports/Kid3App)
else (WIN32)
if (HAVE_QT5)
get_target_property(_qmakeLocation Qt5::qmake LOCATION)
else (HAVE_QT5)
......@@ -60,7 +72,22 @@ if (NOT _crossMingwMatch)
install(FILES "${kid3_plugins_BINARY_DIR}/imports/Kid3App/qmldir"
"${kid3_plugins_BINARY_DIR}/imports/Kid3App/plugins.qmltypes"
DESTINATION ${WITH_PLUGINSDIR}/imports/Kid3App)
else (NOT _crossMingwMatch)
install(FILES "${kid3_plugins_BINARY_DIR}/imports/Kid3App/qmldir"
DESTINATION ${WITH_PLUGINSDIR}/imports/Kid3App)
endif (NOT _crossMingwMatch)
endif (WIN32)
if ((WIN32 OR APPLE) AND HAVE_QT5)
# Install essential QML modules.
get_target_property(QT_QML_DIR Qt5::qmake LOCATION)
get_filename_component(QT_QML_DIR ${QT_QML_DIR} PATH)
get_filename_component(QT_QML_DIR ${QT_QML_DIR} PATH)
set(QT_QML_DIR ${QT_QML_DIR}/qml)
install(DIRECTORY "${QT_QML_DIR}/QtQuick.2"
DESTINATION "${WITH_PLUGINSDIR}/imports"
FILES_MATCHING PATTERN "*plugin${CMAKE_SHARED_LIBRARY_SUFFIX}"
PATTERN "qmldir")
install(DIRECTORY "${QT_QML_DIR}/QtQuick/Layouts"
DESTINATION "${WITH_PLUGINSDIR}/imports/QtQuick"
FILES_MATCHING PATTERN "*plugin${CMAKE_SHARED_LIBRARY_SUFFIX}"
PATTERN "qmldir")
endif ()
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