glfs/archive/setqt.xml
Bruce Dubbs fdbc20109b Update cmake test instructions.
Archive xincludes/setqt.xml



git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@17803 af4574ff-66df-0310-9fd7-8a98e5e911e0
2016-09-24 04:02:42 +00:00

38 lines
1.5 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" ] &amp;&amp; [ "x$QT5DIR" != "x" ]; 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" ] &amp;&amp; [ "x$QT4DIR" != "x" ]; 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>