You need to add a few paths to your PATH environmental variable. On Windows, you can modify it with a configuration window: right click on your "My computer" and select "Properties". It's somewhere there. :)

+

You need to add a few paths to your PATH environmental variable. On Windows, you can modify it with a configuration window: right click on your "My computer" and select "Properties". It's somewhere there, under "Environmental Variables". :)

−

'''TIP:''' The environmental variables window allows you to modify and define env-variables for the current user and for the system. There should be already a "Path" variable defined for the system, but not for the user. Instead of modifying the system PATH, it is more convenient to define a user PATH (just click on the "New..." button and fill in the boxes).

+

'''WARNING:''' Don't just blindly copy the paths. Make sure that these directories exist and that the Qt version number is the same as yours.

+

+

'''TIP:''' The environmental variables window allows you to modify and define variables separately for the current user and for the system. There should be already a "Path" variable defined for the system, but not for the user. Instead of modifying the system PATH, it is more convenient to define a user PATH (just click on the "New..." button and fill in the boxes).

If you have let the Qt SDK install itself in its default location, the path to the Qt libraries should be something like <code>C:\QtSDK\Desktop\Qt\4.7.4\mingw</code> You need to add three subdirectories to the PATH variable:

If you have let the Qt SDK install itself in its default location, the path to the Qt libraries should be something like <code>C:\QtSDK\Desktop\Qt\4.7.4\mingw</code> You need to add three subdirectories to the PATH variable:

Line 36:

Line 38:

C:\QtSDK\Desktop\Qt\4.7.4\mingw\include

C:\QtSDK\Desktop\Qt\4.7.4\mingw\include

−

You also need to add the GnuWin libraries:

+

You also need to add the MinGW directories themselves:

+

C:\QtSDK\mingw\bin

+

C:\QtSDK\mingw\lib

+

C:\QtSDK\mingw\include

+

+

And the GnuWin libraries:

C:\Program Files\GnuWin32\bin

C:\Program Files\GnuWin32\bin

C:\Program Files\GnuWin32\lib

C:\Program Files\GnuWin32\lib

Line 42:

Line 49:

All elements of the list should be separated with a semicolon (;). So the end result should look something like this:

All elements of the list should be separated with a semicolon (;). So the end result should look something like this:

'''Warning:''' Don't just blindly copy the paths. Make sure that these directories exist and that the Qt version number is the same as yours.

+

==Install CMake==

==Install CMake==

Line 70:

Line 75:

*In the "Run CMake step", there is an "Arguments" field where you can set CMake command-line arguments.

*In the "Run CMake step", there is an "Arguments" field where you can set CMake command-line arguments.

**You can use it to set Stellarium's pseudo-installation directory. This is necessary only if you want to use a trick useful to translators (described below) or to create an executable installer. Just type in <code>-DCMAKE_INSTALL_PREFIX=c:\stellarium-temp\</code>, where <code>c:\stellarium-temp\</code> is the path to the pseudo-installation directory. (It is not necessary to exist, CMake will create it.)

**You can use it to set Stellarium's pseudo-installation directory. This is necessary only if you want to use a trick useful to translators (described below) or to create an executable installer. Just type in <code>-DCMAKE_INSTALL_PREFIX=c:\stellarium-temp\</code>, where <code>c:\stellarium-temp\</code> is the path to the pseudo-installation directory. (It is not necessary to exist, CMake will create it.)

+

**When you are done with the arguments, click on the "Run CMake" button. CMake will start and its log will be displayed in the box below. If everything is OK, the last lines will be something like: "Configuring done. Generating done. Build files have been written to <your build directory>" The "Finish" button will be enabled. Click it to close the wizard.

+

+

After you close the wizard, Qt Creator should open the project.

+

+

'''Tip:''' You can always run again CMake by choosing "Run CMake" from the "Build" menu.

+

+

==Building Stellarium==

+

+

==Running Stellarium==

+

You can run the freshly-built Stellarium from inside Qt Creator. You only need to fix the default working directory first.

+

+

From the left column, select "Projects" (or press Ctrl+5). Then select the "Run Settings" tab. On that page, under "Run", there must be a "Working directory:" field with a path that looks like this:

+

C:\stellarium\trunk\builds\msys\src

+

+

Select and remove the <tt>builds\msys\src</tt> tail so that the path looks like this:

+

C:\stellarium\trunk\

+

+

After that, you can run the build by clicking on the green arrow button in the left column (or pressing Ctrl+R). You can also run the project in debug mode, etc.

+

+

If you have forgotten to set the correct working directory, Stellarium will crash when you try to run it and it will display a "WARNING: could not locate installation directory" error in the log.

The Inno Setup project file that contains the rules for creating the installer is called <tt>stellarium.iss</tt>. It is generated from the template <tt>stellarium.iss.cmake</tt> when you run CMake, so:

+

* To have <tt>stellarium.iss</tt>, you need to have run CMake and/or built Stellarium at least once.

+

* If you run CMake (or build Stellarium?) after you've made changes to <tt>stellarium.iss</tt>, they will be overwritten, so be careful - always keep in mind what changes do you want to make and why, and in which file do you need to make them.

+

+

===Building in "install" configuration===

+

TODO

+

- add screenshots

+

To generate an installer, you need to have something to install. Make sure you build Stellarium in the normal way first.

+

+

After that, you need to "build" it in an "install" configuration, the equivalent of running <tt>make install</tt> from the command line. Before trying to do it, though, please make sure that you've set the <tt>CMAKE_INSTALL_PREFIX</tt> parameter as described [[#Opening Stellarium with Qt Creator|above]]. If you haven't done it, run CMake again with the appropriate parameters. (You can trigger a new run of CMake at any time - from the "Build" menu at the top select "Run CMake".)

+

+

You need to add the build configuration only once per object. From the left column, select "Projects" (or press Ctrl+5). In the "Build Settings" tab, look at the first line: "Edit build configuration:". Click on the "Add" button, then select "Clone selected" from the menu. (This will create a copy of the current configuration, which should be "all".) In the small window that appears, type a name for the new configuration ("install" will do). Make sure that the new configuration is selected in the first box on the same line, then look below for the "Make Steps" section. There should be a "Make:" field containing something like this:

+

mingw32-make.exe

+

Click on the "Details" button to the right. More controls should fold out. In the "Additional arguments:" field, type <tt>install</tt>, then click on the "Details" button again to fold the controls. The "Make:" field should now read:

+

mingw32-make.exe install

+

That's it, you can now use the new build configuration.

+

+

To change the current build configuration, press Ctrl+T (or click on the computer screen icon labelled "Stellarium" in the left column). In the box that opens, the "Build:" drop down list should offer two options - "all" and whatever name you gave the "install" configuration.

+

+

So, to build Stellarium in the "install" configuration, make sure that it is selected and then just trigger a new build (for example, by pressing Ctrl+B). The <tt>make</tt> script will then copy all the necessary files to the temporary installation directory that you have set.

+

+

If you need only to (re)compile Stellarium after that, open the build configuration selection window again and select "all".

+

+

===Running Inno Setup===

+

After Stellarium has been built in the "install" configuration (which should have copied the necessary files to the temporary installation directory), open the <tt>stellarium.iss</tt> file with Inno Setup (just double-click it). You can make some final changes before running the script.

+

+

By default, the new installer will be created in the <tt>/installers</tt> sub-directory in the main directory of your Stellarium working tree. Bazaar is set to ignore it, so you can't accidentally commit a setup file to the repository.

Stellarium is based on the Qt framework, so you need to install it. Before, the Qt libraries and Qt Creator were distributed separately, but then Nokia integrated all Qt components in a SDK. So you can download a small installer, and select and download only the components you are going to use.

The "online installer" for Windows is only 15 MB and allows you to pick which components to download and install

You need Qt Creator and the Qt Desktop libraries (open source, with MinGW), so in the component selection screen:

Under "Development Tools":

Under "Desktop Qt", make sure that the latest version of Qt is checked (as of November 2011, that is 4.7.4). Under the version number, select only "Desktop Qt 4.7.4 - MinGW"

Make sure "Qt Designer" is selected

You probably don't need anything else under "Development Tools", so feel free to uncheck the rest.

Under "Miscellaneous", make sure that "MinGW 4.4" is checked. You don't need the source code. You may need the Qt Examples only if you are a programmer and you want to contribute to Stellarium - they will be useful to understand Qt.

You need "Documentation" only if you are a programmer who wishes to contribute to Stellarium.

You don't need "APIs" and "Experimental".

Even if you miss anything at this point, you can install it later with the "Maintain Qt SDK" application (it can be found in the Start menu after the installation is complete).

For all of them, download the "Complete package, except sources" executable installer. Run the installers and let them install the libraries to the directory they want. It should be something like C:\Program Files\GnuWin32

You need to add a few paths to your PATH environmental variable. On Windows, you can modify it with a configuration window: right click on your "My computer" and select "Properties". It's somewhere there, under "Environmental Variables". :)

WARNING: Don't just blindly copy the paths. Make sure that these directories exist and that the Qt version number is the same as yours.

TIP: The environmental variables window allows you to modify and define variables separately for the current user and for the system. There should be already a "Path" variable defined for the system, but not for the user. Instead of modifying the system PATH, it is more convenient to define a user PATH (just click on the "New..." button and fill in the boxes).

If you have let the Qt SDK install itself in its default location, the path to the Qt libraries should be something like C:\QtSDK\Desktop\Qt\4.7.4\mingw You need to add three subdirectories to the PATH variable:

All elements of the list should be separated with a semicolon (;). So the end result should look something like this:
C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin;C:\QtSDK\Desktop\Qt\4.7.4\mingw\lib;C:\QtSDK\Desktop\Qt\4.7.4\mingw\include;C:\QtSDK\mingw\bin;C:\QtSDK\mingw\lib;C:\QtSDK\mingw\include;C:\Program Files\GnuWin32\bin;C:\Program Files\GnuWin32\lib;C:\Program Files\GnuWin32\include

And interesting bug: As of 9 November 2011, if you use CMake 2.8.*, on Windows 7, Qt Creator won't show you Stellarium's source file tree in the "Projects" panel. Download and use CMake 2.6.4 (from the same website). If you have any idea why this is happening, contact us in the Stellarium developers mailing list or the Feedback forums.

During the installation, make sure to tell the installer that CMake should be added to the system PATH (for all users). This will save you editing it manually. :)

Find the folder where you have put Stellarium's files. Open the topmost CMakeLists.txt file - the one that is at the same level as the README file and the /src and /data directories.

A "CMake Wizard" window will open. It is small and inconvenient to use. You can resize it to a larger size.

In the "Build Location" step, there will be a default path already in the location field. Ignore it. Instead:

Select your base Stellarium location, the same directory where the CMakeLists.txt file was. For example, D:\stellarium\trunk

Then, add \builds\msys. The whole path should look like something like this:D:\stellarium\trunk\builds\msys

The point is that this will allow you to run Stellarium directly from inside Qt Creator without having to copy files or to create an installer and install Stellarium.

In the "Run CMake step", there is an "Arguments" field where you can set CMake command-line arguments.

You can use it to set Stellarium's pseudo-installation directory. This is necessary only if you want to use a trick useful to translators (described below) or to create an executable installer. Just type in -DCMAKE_INSTALL_PREFIX=c:\stellarium-temp\, where c:\stellarium-temp\ is the path to the pseudo-installation directory. (It is not necessary to exist, CMake will create it.)

When you are done with the arguments, click on the "Run CMake" button. CMake will start and its log will be displayed in the box below. If everything is OK, the last lines will be something like: "Configuring done. Generating done. Build files have been written to <your build directory>" The "Finish" button will be enabled. Click it to close the wizard.

After you close the wizard, Qt Creator should open the project.

Tip: You can always run again CMake by choosing "Run CMake" from the "Build" menu.

Stellarium uses Inno Setup to create its Windows installers (the self-extracting setup files), so you need to download and install Inno Setup first.

The Inno Setup project file that contains the rules for creating the installer is called stellarium.iss. It is generated from the template stellarium.iss.cmake when you run CMake, so:

To have stellarium.iss, you need to have run CMake and/or built Stellarium at least once.

If you run CMake (or build Stellarium?) after you've made changes to stellarium.iss, they will be overwritten, so be careful - always keep in mind what changes do you want to make and why, and in which file do you need to make them.

To generate an installer, you need to have something to install. Make sure you build Stellarium in the normal way first.

After that, you need to "build" it in an "install" configuration, the equivalent of running make install from the command line. Before trying to do it, though, please make sure that you've set the CMAKE_INSTALL_PREFIX parameter as described above. If you haven't done it, run CMake again with the appropriate parameters. (You can trigger a new run of CMake at any time - from the "Build" menu at the top select "Run CMake".)

You need to add the build configuration only once per object. From the left column, select "Projects" (or press Ctrl+5). In the "Build Settings" tab, look at the first line: "Edit build configuration:". Click on the "Add" button, then select "Clone selected" from the menu. (This will create a copy of the current configuration, which should be "all".) In the small window that appears, type a name for the new configuration ("install" will do). Make sure that the new configuration is selected in the first box on the same line, then look below for the "Make Steps" section. There should be a "Make:" field containing something like this:

mingw32-make.exe

Click on the "Details" button to the right. More controls should fold out. In the "Additional arguments:" field, type install, then click on the "Details" button again to fold the controls. The "Make:" field should now read:

mingw32-make.exe install

That's it, you can now use the new build configuration.

To change the current build configuration, press Ctrl+T (or click on the computer screen icon labelled "Stellarium" in the left column). In the box that opens, the "Build:" drop down list should offer two options - "all" and whatever name you gave the "install" configuration.

So, to build Stellarium in the "install" configuration, make sure that it is selected and then just trigger a new build (for example, by pressing Ctrl+B). The make script will then copy all the necessary files to the temporary installation directory that you have set.

If you need only to (re)compile Stellarium after that, open the build configuration selection window again and select "all".

After Stellarium has been built in the "install" configuration (which should have copied the necessary files to the temporary installation directory), open the stellarium.iss file with Inno Setup (just double-click it). You can make some final changes before running the script.

By default, the new installer will be created in the /installers sub-directory in the main directory of your Stellarium working tree. Bazaar is set to ignore it, so you can't accidentally commit a setup file to the repository.