glfs/xincludes/setqt.xml
Fernando de Oliveira 49d333629c Tweaks, reformats and fixes: setqt, Qt-5.2.1, Qt-4.8.5, LibreOffice-4.2.0, WebKitGTK+-1.10.2 and WebKitGTK+-2.2.4.
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@12817 af4574ff-66df-0310-9fd7-8a98e5e911e0
2014-03-04 13:30:09 +00:00

38 lines
1.4 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE note PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<!-- $LastChangedBy: $
$Date: $ -->
<sect3>
<title>Choosing Qt Program Versions</title>
<para>If you install both Qt4 and Qt5, you can use some simple
scripts to select the currently active set of Qt programs. As the
<systemitem class="username">root</systemitem> user, create
the following scripts:</para>
<screen role="root"><userinput>cat &gt; /usr/bin/setqt4 &lt;&lt; 'EOF'
<literal>if [ "x$QT5DIR" != "x/usr" ]; then pathremove $QT5DIR/bin; fi
if [ "x$QT4DIR" != "x/usr" ]; then pathprepend $QT4DIR/bin; fi
echo $PATH</literal>
EOF</userinput></screen>
<screen role="root"><userinput>cat &gt; /usr/bin/setqt5 &lt;&lt; 'EOF'
<literal>if [ "x$QT4DIR" != "x/usr" ]; then pathremove $QT4DIR/bin; fi
if [ "x$QT5DIR" != "x/usr" ]; then pathprepend $QT5DIR/bin; fi
echo $PATH</literal>
EOF</userinput></screen>
<para>You should now be able to use the appropriate Qt version by running
<command>source setqt4</command> or <command>source setqt5</command> as
desired. (Setting the PATH wont work in a subshell.) Another technique that
can be used is to create appropriate alias additions to your ~/.bashrc like
<command>alias setqt4='source setqt4'</command>.</para>
</sect3>