[Interest] Qt 5.9 all-in-one build: how to install to a temporary prefix, DESTDIR= or INSTALL_ROOT= ?

René J.V. Bertin rjvbertin at gmail.com
Fri Jun 22 23:02:24 CEST 2018


Hi,

How does one instruct the all-in-one Qt build process to install to a temp. prefix,

%> make install DESTDIR=/path/to/destroot

or

%> make install INSTALL_ROOT=/path/to/destroot

The latter is the syntax to be used for QMake-based projects, the former for any other kind of project. The former usually works fine for me (I find my entire new Qt install under /path/to/destroot from where I can just copy it to the intended prefix), but I have already seen cases where a library ended up in /path/to (= next to the destroot dir). That never led to errors (install failures or missing libraries) though.

Now a user of my build/packaging script reports an anomaly on Mac OS 10.13:

%> cd "/path/to/build" && gmake -w install DESTDIR=/path/to/destroot
...
%> rm -f ../../../lib/libQt5Bootstrap.a
%> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar cq /path/to/destrootlibQt5Bootstrap.a .obj/qlatincodec.o .obj/qtextcodec.o .obj/qutfcodec.o .obj/qglobal.o .obj/qlogging.o .obj/qmalloc.o .obj/qnumeric.o .obj/qoperatingsystemversion.o .obj/qabstractfileengine.o .obj/qbuffer.o .obj/qdatastream.o .obj/qdebug.o .obj/qdir.o .obj/qdiriterator.o .obj/qfile.o .obj/qfileinfo.o .obj/qfilesystementry.o .obj/qfilesystemengine.o .obj/qfsfileengine.o .obj/qfsfileengine_iterator.o .obj/qiodevice.o .obj/qfiledevice.o .obj/qresource.o .obj/qtemporaryfile.o .obj/qtextstream.o .obj/qsavefile.o .obj/qstandardpaths.o .obj/qloggingcategory.o .obj/qloggingregistry.o .obj/qcoreapplication.o .obj/qcoreglobaldata.o .obj/qmetatype.o .obj/qvariant.o .obj/qsystemerror.o .obj/quuid.o .obj/qbitarray.o .obj/qbytearray.o .obj/qarraydata.o .obj/qbytearraymatcher.o .obj/qcommandlineparser.o .obj/qcommandlineoption.o .obj/qcryptographichash.o .obj/qdatetime.o .obj/qhash.o .obj/qlist.o .obj/qlinkedlist.o .obj/qlocale.o .obj/qlocale_tools.o .obj/qmap.o .obj/qregexp.o .obj/qringbuffer.o .obj/qpoint.o .obj/qrect.o .obj/qsize.o .obj/qline.o .obj/qstring.o .obj/qstringbuilder.o .obj/qstring_compat.o .obj/qstringlist.o .obj/qversionnumber.o .obj/qvsnprintf.o .obj/qxmlutils.o .obj/qxmlstream.o .obj/qjson.o .obj/qjsondocument.o .obj/qjsonobject.o .obj/qjsonarray.o .obj/qjsonvalue.o .obj/qjsonparser.o .obj/qjsonwriter.o .obj/qdom.o .obj/qxml.o .obj/qfilesystemengine_unix.o .obj/qfilesystemiterator_unix.o .obj/qfsfileengine_unix.o .obj/qcoreapplication_mac.o .obj/qcore_mac.o .obj/qoperatingsystemversion_darwin.o .obj/qcore_mac_objc.o .obj/qcore_foundation.o .obj/qstandardpaths_mac.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib -s ../../../lib/libQt5Bootstrap.a
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: can't open file: ../../../lib/libQt5Bootstrap.a (No such file or directory)

and when I look at build/qtbase/src/tools/bootstrap/Makefile I see something that makes me wonder how it could ever go right outside of a traditional, direct install:

```
../../../lib/$(TARGET):  $(OBJECTS) $(OBJCOMP)
     @test -d ../../../lib/ || mkdir -p ../../../lib/
     -$(DEL_FILE) ../../../lib/$(TARGET)
     $(AR) $(DESTDIR)$(TARGET) $(OBJECTS)
     $(RANLIB) ../../../lib/$(TARGET)
```

Thanks for any shiny lights :)

René



More information about the Interest mailing list