diff --git a/CMakeLists.txt b/CMakeLists.txt index d2cfcfa80..e1ec476e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -539,20 +539,22 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") install(CODE "execute_process(COMMAND mkdir -p ${RESOURCEDIR}/qml)") if(QT_VERSION VERSION_LESS 6.0.0) set(QT_INSTALL_PREFIX ${_qt5Core_install_prefix}) + install(CODE "execute_process(COMMAND mkdir -p ${PLUGINDIR}/geoservices)") + install(CODE "execute_process(COMMAND cp ${QT_INSTALL_PREFIX}/plugins/geoservices/libqtgeoservices_googlemaps.dylib ${PLUGINDIR}/geoservices ERROR_QUIET)") + install(CODE "execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/../install-root/${QT_INSTALL_PREFIX}/plugins/geoservices/libqtgeoservices_googlemaps.dylib ${PLUGINDIR}/geoservices ERROR_QUIET)") else() set(QT_INSTALL_PREFIX ${QT6_INSTALL_PREFIX}) endif() - install(CODE "execute_process(COMMAND mkdir -p ${PLUGINDIR}/geoservices)") - install(CODE "execute_process(COMMAND cp ${QT_INSTALL_PREFIX}/plugins/geoservices/libqtgeoservices_googlemaps.dylib ${PLUGINDIR}/geoservices ERROR_QUIET)") - install(CODE "execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/../install-root/${QT_INSTALL_PREFIX}/plugins/geoservices/libqtgeoservices_googlemaps.dylib ${PLUGINDIR}/geoservices ERROR_QUIET)") # this will fail is macdeployqt isn't in the PATH - that seemed to happen in the past, but not recently install(CODE "execute_process(COMMAND macdeployqt ${APP_BUNDLE_DIR} -no-strip ${MACDEPLOY_ARGS})") # the next hack is here to delete the sqlite plugin that get's installed even though it isn't needed install(CODE "execute_process(COMMAND rm -rf ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/PlugIns/sqldrivers)") # and another hack to get the QML Components in the right place - install(CODE "execute_process(COMMAND rm -rf ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Resources/qml/{QtQuick.2,QtLocation,QtPositioning})") - install(CODE "execute_process(COMMAND cp -a ${QT_INSTALL_PREFIX}/qml/QtQuick.2 ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Resources/qml)") - install(CODE "execute_process(COMMAND cp -a ${QT_INSTALL_PREFIX}/qml/QtLocation ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Resources/qml)") + if(QT_VERSION VERSION_LESS 6.0.0) + install(CODE "execute_process(COMMAND rm -rf ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Resources/qml/{QtQuick.2,QtLocation,QtPositioning})") + install(CODE "execute_process(COMMAND cp -a ${QT_INSTALL_PREFIX}/qml/QtQuick.2 ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Resources/qml)") + install(CODE "execute_process(COMMAND cp -a ${QT_INSTALL_PREFIX}/qml/QtLocation ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Resources/qml)") + endif() install(CODE "execute_process(COMMAND cp -a ${QT_INSTALL_PREFIX}/qml/QtPositioning ${CMAKE_BINARY_DIR}/${APP_BUNDLE_DIR}/Contents/Resources/qml)") if(NOT QT_VERSION VERSION_LESS 5.11.0) # and with Qt 5.11 we need another library that isn't copied by macdeployqt