Getting Started With Lighthouse: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
[[Category:Developing_Qt]]
the information presented here is obsoleted according to http://labs.qt.nokia.com/2011/05/31/lighthouse-has-grown-up-now/
the information presented here is obsoleted according to http://labs.qt.nokia.com/2011/05/31/lighthouse-has-grown-up-now/


=Getting started with Lighthouse=
[toc align_right="yes" depth="3"]


==Prerequisites==
= Getting started with Lighthouse =


You need a Unix-like system, a reasonably modern C++ compiler, and an up-to-date version of git (1.6 or newer recommended).<br /> (If you do not have git, there is a way to download tarballs from qt.gitorious.org, but I’m not going to show you how: You really want to use git, especially if you are ever going to update to newer versions.)
== Prerequisites ==


==Clone the Lighthouse repository==
You need a Unix-like system, a reasonably modern C++ compiler, and an up-to-date version of git (1.6 or newer recommended).<br />(If you do not have git, there is a way to download tarballs from qt.gitorious.org, but I'm not going to show you how: You really want to use git, especially if you are ever going to update to newer versions.)


First choose some convenient place to put the code. For the purpose of this document I will use <code>~/dev/</code>.
== Clone the Lighthouse repository ==


Now clone the Lighthouse repository into <code>~/dev/lighthouse</code>:
First choose some convenient place to put the code. For the purpose of this document I will use &lt;code&amp;gt;<sub>/dev/&amp;lt;/code&amp;gt;.
<br /><code><br /> mkdir -p</sub>/dev<br /> cd <sub>/dev<br /></code>
<br />Now clone the Lighthouse repository into &lt;code&amp;gt;</sub>/dev/lighthouse&amp;lt;/code&amp;gt;:


==Configure and build==
<code><br /> git clone git://gitorious.org/+qt-developers/qt/lighthouse.git<br /></code>
 
== Configure and build ==


We will use shadow builds for this. Shadow building means building outside the source directory tree. It is of course possible to build Lighthouse inside the source tree, but use shadow builds anyway. You will thank me later: With shadow builds you can have several different build configurations side by side.
We will use shadow builds for this. Shadow building means building outside the source directory tree. It is of course possible to build Lighthouse inside the source tree, but use shadow builds anyway. You will thank me later: With shadow builds you can have several different build configurations side by side.


The only limitation is that the shadow build directory has to be outside the source tree; otherwise Qt’s build system will be fatally confused. Apart from that you could put the build directory anywhere, but here I’ll put it next to the source directory.
The only limitation is that the shadow build directory has to be outside the source tree; otherwise Qt's build system will be fatally confused. Apart from that you could put the build directory anywhere, but here I'll put it next to the source directory.


Create a build directory, and <code>cd</code> into it.
Create a build directory, and &lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into it.
 
<code><br /> cd ~/dev<br /> mkdir build-lighthouse<br /> cd build-lighthouse<br /></code>


Running the configure script from inside the build directory sets up the shadow build:
Running the configure script from inside the build directory sets up the shadow build:


(The <code>-embedded-lite</code> option is what makes this a Lighthouse build instead of making just another Qt/X11 binary; <code>-developer-build</code> makes a library that does not need to be installed somewhere else, as well as setting some other developer-friendly options.)
<code><br /> ../qt-lighthouse/configure -qpa -developer-build<br /></code>


Now compile Lighthouse. To save time, we’ll just compile <code>src</code>, and skip the tools and examples for now:
(The &lt;code&amp;gt;-embedded-lite&amp;lt;/code&amp;gt; option is what makes this a Lighthouse build instead of making just another Qt/X11 binary; &lt;code&amp;gt;-developer-build&amp;lt;/code&amp;gt; makes a library that does not need to be installed somewhere else, as well as setting some other developer-friendly options.)


==Run some examples==
Now compile Lighthouse. To save time, we'll just compile &lt;code&amp;gt;src&amp;lt;/code&amp;gt;, and skip the tools and examples for now:


We didn’t compile any examples in the previous step, so we have to compile them as we need them. We’ll choose the industrial standard example for Qt testing:
<code><br /> make -C src<br /></code>


If we don’t specify a backend, Lighthouse will just complain at us, so we use the <code>-platform</code> command line argument, and choose ''minimal''.
== Run some examples ==


'''Note:''' you have to press Ctrl-C to stop the program, otherwise your file system will fill up with images.
We didn't compile any examples in the previous step, so we have to compile them as we need them. We'll choose the industrial standard example for Qt testing:


Now you can use your favorite image viewer to look at the images (<code>outputxxxx.png</code>). You probably want to clean up afterwards:
<code><br /> cd examples/widgets/wiggly/<br /> make<br /></code>


If you are running an X11 server, and have the necessary header files installed, you can also try out the <code>testlite</code> backend. It’s not compiled by default, so you’ll have to do that first:
If we don't specify a backend, Lighthouse will just complain at us, so we use the &lt;code&amp;gt;-platform&amp;lt;/code&amp;gt; command line argument, and choose ''minimal''.


Go back to the example,
<code><br /> ./wiggly <s>platform minimal<br /></code>
<br />'''Note:''' you have to press Ctrl-C to stop the program, otherwise your file system will fill up with images.
<br />Now you can use your favorite image viewer to look at the images (&lt;code&amp;gt;outputxxxx.png&amp;lt;/code&amp;gt;). You probably want to clean up afterwards:
<br /><code><br /> rm output*.png<br /></code>
<br />If you are running an X11 server, and have the necessary header files installed, you can also try out the &lt;code&amp;gt;testlite&amp;lt;/code&amp;gt; backend. It's not compiled by default, so you'll have to do that first:
<br /><code><br /> cd ../../../src/plugins/platforms/testlite/<br /> make<br /></code>
<br />Go back to the example,
<br /><code><br /> cd</s><br /></code>


and run it with the new backend:
and run it with the new backend:


==Now you can start on the advanced stuff==
<code><br />./wiggly -platform testlite<br /></code>
 
See [[Writing Your Own Lighthouse Backend|Writing_Your_Own_Lighthouse_Backend]] for how to port Lighthouse to other systems.
 
Go to [[Lighthouse Architecture|Lighthouse_Architecture]] for information on how Lighthouse works internally.


===Categories:===
== Now you can start on the advanced stuff ==


* [[:Category:Developing Qt|Developing_Qt]]
See [[Writing_Your_Own_Lighthouse_Backend]] for how to port Lighthouse to other systems.

Revision as of 09:43, 24 February 2015


the information presented here is obsoleted according to http://labs.qt.nokia.com/2011/05/31/lighthouse-has-grown-up-now/

[toc align_right="yes&quot; depth="3&quot;]

Getting started with Lighthouse

Prerequisites

You need a Unix-like system, a reasonably modern C++ compiler, and an up-to-date version of git (1.6 or newer recommended).
(If you do not have git, there is a way to download tarballs from qt.gitorious.org, but I'm not going to show you how: You really want to use git, especially if you are ever going to update to newer versions.)

Clone the Lighthouse repository

First choose some convenient place to put the code. For the purpose of this document I will use <code&gt;/dev/&lt;/code&gt;.


<br /> mkdir -p</sub>/dev<br /> cd <sub>/dev<br />


Now clone the Lighthouse repository into <code&gt;/dev/lighthouse&lt;/code&gt;:

<br /> git clone git://gitorious.org/+qt-developers/qt/lighthouse.git<br />

Configure and build

We will use shadow builds for this. Shadow building means building outside the source directory tree. It is of course possible to build Lighthouse inside the source tree, but use shadow builds anyway. You will thank me later: With shadow builds you can have several different build configurations side by side.

The only limitation is that the shadow build directory has to be outside the source tree; otherwise Qt's build system will be fatally confused. Apart from that you could put the build directory anywhere, but here I'll put it next to the source directory.

Create a build directory, and <code&gt;cd&lt;/code&gt; into it.

<br /> cd ~/dev<br /> mkdir build-lighthouse<br /> cd build-lighthouse<br />

Running the configure script from inside the build directory sets up the shadow build:

<br /> ../qt-lighthouse/configure -qpa -developer-build<br />

(The <code&gt;-embedded-lite&lt;/code&gt; option is what makes this a Lighthouse build instead of making just another Qt/X11 binary; <code&gt;-developer-build&lt;/code&gt; makes a library that does not need to be installed somewhere else, as well as setting some other developer-friendly options.)

Now compile Lighthouse. To save time, we'll just compile <code&gt;src&lt;/code&gt;, and skip the tools and examples for now:

<br /> make -C src<br />

Run some examples

We didn't compile any examples in the previous step, so we have to compile them as we need them. We'll choose the industrial standard example for Qt testing:

<br /> cd examples/widgets/wiggly/<br /> make<br />

If we don't specify a backend, Lighthouse will just complain at us, so we use the <code&gt;-platform&lt;/code&gt; command line argument, and choose minimal.

<br /> ./wiggly <s>platform minimal<br />


Note: you have to press Ctrl-C to stop the program, otherwise your file system will fill up with images.
Now you can use your favorite image viewer to look at the images (<code&gt;outputxxxx.png&lt;/code&gt;). You probably want to clean up afterwards:


<br /> rm output*.png<br />


If you are running an X11 server, and have the necessary header files installed, you can also try out the <code&gt;testlite&lt;/code&gt; backend. It's not compiled by default, so you'll have to do that first:


<br /> cd ../../../src/plugins/platforms/testlite/<br /> make<br />


Go back to the example,


<br /> cd</s><br />

and run it with the new backend:

<br />./wiggly -platform testlite<br />

Now you can start on the advanced stuff

See Writing_Your_Own_Lighthouse_Backend for how to port Lighthouse to other systems.