mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
macOS: build googlemaps plugin as fat binary
I couldn't make this to work as a single pass build, so we again do a dual pass and manually assemble the dylib. This is then copied to a sane spot which required another attempt to copy it in the CMakeLists.txt - which I added comments to in order to make sense of the weirdness. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c41e2489a4
commit
ac70282193
2 changed files with 22 additions and 2 deletions
|
@ -580,8 +580,13 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
endif()
|
endif()
|
||||||
if(MAPSUPPORT)
|
if(MAPSUPPORT)
|
||||||
install(CODE "execute_process(COMMAND mkdir -p ${PLUGINDIR}/geoservices)")
|
install(CODE "execute_process(COMMAND mkdir -p ${PLUGINDIR}/geoservices)")
|
||||||
|
# this is really weird. We first try a plugin that ended up in the Qt install prefix
|
||||||
|
# then we try one that's in that odd broken install location that the qmake file results in (that includes the QT_INSTALL_PREFIX after our INSTALL_ROOT
|
||||||
|
# and finally, for fat binaries, we copy the one that's in the 'logical' spot under the INSTALL_ROOT
|
||||||
|
# this should cover all cases and always get us the correct library
|
||||||
install(CODE "execute_process(COMMAND cp ${QT_INSTALL_PREFIX}/plugins/geoservices/libqtgeoservices_googlemaps.dylib ${PLUGINDIR}/geoservices ERROR_QUIET)")
|
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)")
|
install(CODE "execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/../install-root/${QT_INSTALL_PREFIX}/plugins/geoservices/libqtgeoservices_googlemaps.dylib ${PLUGINDIR}/geoservices ERROR_QUIET)")
|
||||||
|
install(CODE "execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/../install-root/plugins/geoservices/libqtgeoservices_googlemaps.dylib ${PLUGINDIR}/geoservices ERROR_QUIET)")
|
||||||
endif()
|
endif()
|
||||||
# this will fail is macdeployqt isn't in the PATH - that seemed to happen in the past, but not recently
|
# this will fail is macdeployqt isn't in the PATH - that seemed to happen in the past, but not recently
|
||||||
# also, on M1 macOS systems macdeployqt throws a ton of (apparently harmless) errors. Warn the unsuspecting developer
|
# also, on M1 macOS systems macdeployqt throws a ton of (apparently harmless) errors. Warn the unsuspecting developer
|
||||||
|
|
|
@ -559,7 +559,8 @@ if [ "$QUICK" != "1" ] && [ "$BUILD_DESKTOP$BUILD_MOBILE" != "" ] && ( [[ $QT_VE
|
||||||
if [ "$PLATFORM" = Darwin ] && [[ $QT_VERSION == 6* ]]; then
|
if [ "$PLATFORM" = Darwin ] && [[ $QT_VERSION == 6* ]]; then
|
||||||
# since we are currently building QtLocation from source, we don't have a way to easily install
|
# since we are currently building QtLocation from source, we don't have a way to easily install
|
||||||
# the private headers... so this is a bit of a hack to get those for googlemaps...
|
# the private headers... so this is a bit of a hack to get those for googlemaps...
|
||||||
$QMAKE "INCLUDEPATH=$INSTALL_ROOT/../qtlocation/build/include/QtLocation/6.3.0" ../googlemaps.pro
|
# regardless of whether we do a fat build or not, let's do the 'native' build here
|
||||||
|
$QMAKE "INCLUDEPATH=$INSTALL_ROOT/../qtlocation/build/include/QtLocation/6.3.0" QMAKE_APPLE_DEVICE_ARCHS=$(arch) ../googlemaps.pro
|
||||||
else
|
else
|
||||||
$QMAKE "INCLUDEPATH=$INSTALL_ROOT/include" ../googlemaps.pro
|
$QMAKE "INCLUDEPATH=$INSTALL_ROOT/include" ../googlemaps.pro
|
||||||
fi
|
fi
|
||||||
|
@ -571,7 +572,21 @@ if [ "$QUICK" != "1" ] && [ "$BUILD_DESKTOP$BUILD_MOBILE" != "" ] && ( [[ $QT_VE
|
||||||
cat Makefile.bak | sed -e 's/std=c++1z/std=c++11/g ; s/-Wdate-time//' > Makefile
|
cat Makefile.bak | sed -e 's/std=c++1z/std=c++11/g ; s/-Wdate-time//' > Makefile
|
||||||
fi
|
fi
|
||||||
make -j4
|
make -j4
|
||||||
make install
|
if [ "$PLATFORM" = Darwin ] && [[ $QT_VERSION == 6* ]] && [[ $ARCHS == *" "* ]] ; then
|
||||||
|
# we can't build fat binaries directly here, so let's do it in two steps
|
||||||
|
# above we build the 'native' binary, now build the other one
|
||||||
|
OTHERARCH=${ARCHS//$(arch)/}
|
||||||
|
OTHERARCH=${OTHERARCH// /}
|
||||||
|
mkdir -p ../build-$OTHERARCH
|
||||||
|
cd ../build-$OTHERARCH
|
||||||
|
$QMAKE "INCLUDEPATH=$INSTALL_ROOT/../qtlocation/build/include/QtLocation/6.3.0" QMAKE_APPLE_DEVICE_ARCHS=$OTHERARCH ../googlemaps.pro
|
||||||
|
make -j4
|
||||||
|
# now combine them into one .dylib
|
||||||
|
mkdir -p "$INSTALL_ROOT"/plugins/geoservices
|
||||||
|
lipo -create ./libqtgeoservices_googlemaps.dylib ../build/libqtgeoservices_googlemaps.dylib -output "$INSTALL_ROOT"/plugins/geoservices/libqtgeoservices_googlemaps.dylib
|
||||||
|
else
|
||||||
|
make install
|
||||||
|
fi
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue