Skip to content

Building Tonatiuh Under Windows

ilescener edited this page Apr 3, 2017 · 4 revisions

Whether you want to collaborate in the development of Tonatiuh, you want to develop your own Tonatiuh plug-ins, or you just want to use the latest version of the program without between formal official program releases, you need to access the Tonatiuh Subversion repository and be able to build the Tonatiuh program from the source code.

Here you will find the instructions to configure Eclipse to both access the Tonatiuh Suversion repository and building the program and its official plug-ins from the source code.

Details

Obtaining a local copy of Tonatiuh

To build Tonatiuh using the C++ Eclipse IDE, the first thing you need to do is to download the Tonatiuh source code from the Subversion repository at Googlecode. To do this, execute Eclipse, click on the "Window" option in the menu bar, then click on "Open Perspective" and select "SVN Repository Exploring" as the perspective to open.

Once the "SVN Repository Exploring" is open under Eclipse, right click on the middle of the left panel titled "SVN Repositories". A pop-up menu will be displayed showing only one option titled "New". Left-click on it, and select the option titled "Repository Location..." (see Figure 1).

Figure 1. Eclipse "SVN Repository Exploring" perspective.

This will display a pop-up dialog, with several tabs. Under the "General" tab, in the dialog's URL field enter "https://github.com/iat-cener/tonatiuh", then in the "Label" section check the option "Use repository URL as label".

If you are a member of the Tonatiuh software development team, enter your username and password, in the "Authentication" section of the "General" tab of the pop-up dialog. If you are not a member of the team, leave this section blank to make an anonymous download of the Tonatiuh code.

Finally, check the option "Validate Repository Location on finish", and click on the "Finish" button. After doing this, you will see the tree of the Tonatiuh Subversion code repository at Google code. To download the Tonatiuh code, including the code of the official Tonatiuh plug-ins, please, expand the "trunk" subtree and right-click on the "TonatiuhProject" folder. By doing this, you will trigger the display of a pop-up menu. On that menu, select the "Check Out" option (see Figure 2). This will start the process of downloading the Tonatiuh code into your computer.

Figure 2. Eclipse "SVN Repository Exploring" perspective pop-up menu.

Configuring Eclipse to build Tonatiuh

Set up Tonatiuh as a C++ project

Once the process of checking out the Tonatiuh code finishes, please, open the C/C++ Eclipse Perspective. To do it, left-click on the "Window option of the Eclipse main menu bar, select "Open Perspective", then select "Other..." and then select "C/C++ (default)"and click on the "OK" button.

Within the C/C++ perspective, locate the "Project Explorer" pane and right-click on the "TonatiuhProject" folder. In the pop-up menu that will be displayed, click on "New" and then on "Convert to a C/C++ Project". This will display the "Convert to a C/C++ project" dialog (see Figure 3).

In the "Candidates for conversion" section of the dialog, verify that the folder "TonatiuhProject" is checked. In the "Convert to C or C++" section verify that the "C++ Project" option is selected. In the "Project options" section verify that the "Specify project type" option is checked, that the selected "Project type:" is "Makefile project", and that the selected "Toolchains" is "Other Tool Chains". After all of the above is done, click on the "Finish" button.

Define environment variables

Once Tonatiuh is set up as a C++ project within Eclipse, you need to defining several environment variables which are needed by qmake to properly process the many Tonatiuh qt project files (.pro) which are necessary to build Tonatiuh.

On the C/C++ Eclipse perspective, right-click on the "TonatiuhProject" folder to display the pop-up menu. Go to the bottom of the menu and click on "Properties". This will display the "Properties for TonatiuhProject" dialog. There, on the tree-view at the left, click on the "C/C++ Build" item to expand it, and then click on the "Environment" sub-item. This will display the "Environment" form-view to the right of the tree-view of the "Properties for TonatiuhProject" dialog.

To create the new environment variable TDE_ROOT, first, click on the "Add..." button of the "Environment" form-view to display the "New variable" pop-up dialog, then on this dialog check the "Add to all configurations" option, enter the following information:

Name: TDE_ROOT
Value: C:\sde\MinGW\msys/1.0

And click the "OK" button.

To create the new environment variable TONATIUH_ROOT follow a similar procedure. However, in this case, in the "New variable" pop-up dialog enter the following information:

Name: TONATIUH_ROOT
Value: C:\sde\workspace\TonatiuhProject

It's also necessary to define the environment variable PATH with this information:

Name: PATH
Value: C:\sde\MinGW\bin;C:\sde\Qt\Desktop\Qt\4.7.4\mingw\bin

And click the "OK" button.

At the end of the process the "Properties for TonatiuhProject" pop-up dialog, should look like Figure 4.

Figure 4. _Eclipse C/C++ Environment variables pop-up dialog.

After defining the two environment variables of Tonatiuh needed by qmake, go the tree-like window of the "Properties for TonatiuhProject" dialog and under the "C/C++ Build" item click on the "Settings" sub-item to display the "Settings" form-like view. There, select the "Binary parser" tab, and within the "Binary parser:" section make sure that only the option "PE Windows Parser" is checked. Then, click on the "OK" button to close the "Properties for TonatiuhProject" dialog.

Create Make Targets

qmake

On the Make Target tab, right click on the folder titled "TonatiuhProject"_. Then, on the pop-up menu select "New...". Finally, on the pop-up dialog titled "Create Make Target" fill the different fields as follows:

Target name: qmake
Make target: TonatiuhProject.pro
Build command: qmake

To fill the "Make target" field you need uncheck the "Same as the target name" option. Likewise, to fill the "Build command" field uncheck the "Use builder settings" option. Before clicking on the "OK" button to close the dialog, please, verify that the "Run all project builders" option is checked.

all

Repeat the previous procedure until the dialog "Create Make Target" is displayed. Then, fill the differend fields as follows:

Target name: all
Make target: all
Build command: C:\sde\MinGW\bin\mingw32-make.exe

To fill the "Make target" field just verify that the "Same as the target name" option is checked. To fill the "Build command" field uncheck the "Use builder settings" option. Before clicking on the "OK" button to close the dialog, please, verify that the "Stop on first build error" and "Run all project builders" options are both checked.

distclean

Repeat the previous procedure until the dialog "Create Make Target" is displayed. Then, fill the differend fields as follows:

Target name: distclean
Make target: distclean
Build command: C:\sde\MinGW\bin\mingw32-make.exe

To fill the "Make target" field just verify that the "Same as the target name" option is checked. To fill the "Build command" field uncheck the "Use builder settings" option. Before clicking on the "OK" button to close the dialog, please, verify that the "Stop on first build error" and "Run all project builders" options are both checked. and select Add Make Target.

Building Tonatiuh and its plug-ins

To build Tonatiuh and all the official plug-ins you need first to double-click on the "qmake" target you just created in the "Make Target" tab of the "C/C++" Eclipse perspective. This will trigger the creation by qmake of all the Makefiles needed to build Tonatiuh. If you look at the "Console" tab of the "C/C++" Eclipse perspective you will see the following messages:

**** Build of configuration Default for project TonatiuhProject ****

qmake TonatiuhProject.pro

Once qmake finishes creating the project Makefiles, double-click on the "all" target in the "Make Target" tab of the "C/C++" Eclipse perspective. This will trigger the building of Tonatiuh and its plug-ins. The process will take a while to execute. If you look at the "Console" of the "C/C++" Eclipse perspective you will see the display of compiler and linking instructions related to compilation and linking of the set of source code files of Tonatiuh and its plug-ins.


Windows Configuration | Developer's Guide | Wiki Home

Clone this wiki locally