DirectX SDK

Bazaar

For getting the source code of Stellarium you need installed DVCS Bazaar from this url. We recommend using latest stable standalone release of Bazaar. If you want GUI clients for management of source code then you can Bazaar Explorer, QBzr and optionally TortoiseBZR.

Note: You should add path to Bazaar to PATH variable if you want use command line for getting source code of Stellarium.

Qt5

Stellarium wants Qt version 5 since revision 6224 for building. You can get latest version of Qt from website of Qt Project. We recommended use Qt 5.2.1, which you can get here - Qt 5.2.1 (VC 2012) with ANGLE for 32-bit Windows or here - Qt 5.2.1 (VC 2012) with ANGLE for 64-bit Windows.

Note: for following steps we will use path C:\Qt as directory with installed Qt5 framework.

CMake

zlib

Stellarium wants zlib for manipulation of the archives, e.g. landscapes packages. Latest binary package of zlib for Windows you can get on zlib website. We recommended use zlib 1.2.5 or better.

You can find and download binary package of zlib for MSVC 2012 or download source code and build it yourself. In any case for 64-bit Windows you can't find binary package, but you can get source code of zlib from zlib-win64 website (with patches for win64) and solution for Visual Studio, and build it (please read instructions from package!). After building you need put files into C:\zlib folder and add it to PATH variable.

If you want use precompiled package, then you should download archive and unpack it. Unpacked directory will named as zlib-winXX-Y, where XX - architecture (32 or 64) and Y is mode (release or debug). You should rename zlib-winXX-Y into zlib directory and add it to PATH.

Configuring the build environment

After installing all required libraries and tools you should configure the build environment.

Add C:\Qt to PATH variable - you should add string C:\Qt5\5.2.1\msvc2012\;C:\Qt5\5.2.1\msvc2012\bin;C:\Qt5\5.2.1\msvc2012\lib;C:\Qt5\5.2.1\msvc2012\include for 32-bit or C:\Qt5\5.2.1\msvc2012_64\;C:\Qt5\5.2.1\msvc2012_64\bin;C:\Qt5\5.2.1\msvc2012_64\lib;C:\Qt5\5.2.1\msvc2012_64\include for 64-bit to PATH variable.

Note: After changes the PATH variable you should reboot the computer for apply those changes.

Getting source code

Release versions

You can download the source code for the release versions from the sourceforge download area. Save the file to the C:/Stellarium-Source directory as example. The file name should be stellarium-0.13.0.tar.gz or similar.

You will need a decompression program installed in Windows, for example 7-Zip.

De-compress the tar file like this:

tar zxvf stellarium-0.13.0.tar.gz

The root of the source tree will be will be C:/Stellarium-Source/stellarium for simplicity.

Development versions from the Bazaar repository

You can try the latest development code by downloading from the bzr repository using the TortoiseBZR client bzr shell. This program integrates with the Windows file browser. See the TortoiseBZR website for details. Check out the source by entering the folder where you have the stellarium source code and from the Windows menu bar:

The root of the source tree typically will be C:/Stellarium-Source/stellarium.

You will first need to get the source code.

For example you use TortoiseBZR and want get the source code of the Stellarium. Run Explorer and open directory C:/Stellarium-Source, choose directory stellarium and make right click mouse. In opened window select "Bazaar create working copy/branch". Set source as "lp:stellarium", destination directory will be "C:/Stellarium-Source/stellarium". Press OK for getting source code.

This will download the trunk into .bzr (nearly 1GB at the moment), a hidden folder in the stellarium folder, so it may take some time. When this completes the trunk source code will be written into your stellarium folder.

When the source code is loaded into your stellarium folder you can add any updates from the Windows pull down menu.
Note: in Windows 7 the menu will appear if you right click the mouse in a vacant area of the stellarium folder.

Building

Open an Explorer and change directory into the root of the source tree, e.g.

Add special configure options (e.g. you can add CMAKE_INSTALL_PREFIX and set C:\stellarium here)

Generate CMakeLists.txt file

Open Microsoft Visual Studio 2012 Express and compile project

Steps on the screenshot above:

Open Stellarium project (FILE -> Open Project... -> Stellarium)

Set the building mode (e.g. Release)

Choose stellarium in the Solution Explorer and make right click on it

Run Build for stellarium

If building is O.K. - run Build for the INSTALL solution

This will place all the compiled files in C:\stellarium. From where they will be found when you run the installer program stellarium.iss after you install the Inno Setup Compiler.

Doing a test run

If the build was successful, you can run the program without installing it, just to test everything is OK. First you need to find all the DLLs which Stellarium uses, and copy them to the root of the source tree:

From the \Qt\5.2.1\msvc2012\plugins\platforms (or \Qt\5.2.1\msvc2012_64\plugins\platforms for 64-bit libraries) folder to the /platforms of the source tree: qwindows.dll

From the \Qt\5.2.1\msvc2012\imports\Qt\labs\shaders (or \Qt\5.2.1\msvc2012_64\imports\Qt\labs\shaders for 64-bit libraries) folder to the /Qt/labs/shaders of the source tree: qmldir, plugins.qmltypes, and qmlshadersplugin.dll

If you need a language other than English copy the stellarium\translations folder from C:\stellarium\share (or \program files\stellarium\share if you don't set CMAKE_INSTALL_PREFIX variable) to the stellarium source tree root folder.

Finally run Build for INSTALL solution in Visual Studio.

This will place all the necessary files in your program files folder stellarium where the installer expects to find them.

Making the installer

We use the Inno Setup Compiler to create the installer. These details are for builds source later than 6052

If you have followed the above procedure the current bzr build will generate the necessary stellarium.iss file. Double click on it, then from the menu bar "build-compile". It will build the stellarium installer package and place it in a folder of the stellarium source tree root folder "installers"

Run the program generated and Stellarium will be installed in program files\stellarium or wherever you select and place an icon on the desktop.

Notes

↑ If the compile fails with the error "can't find a particular file". Check the CMakeCache.txt file in the ...\builds\msys folder and make sure the variable/path/file is directed to the correct source.