Home - Forums - Documentation - Gallery - Bugs
(KDevelop IDE configuration for use with Crystal Space)
Current revision (16:32, 10 August 2007) (edit) (undo)
(Author, version control and copyright information)
 
(24 intermediate revisions not shown.)
Line 1: Line 1:
-
=KDevelop IDE configuration for use with Crystal Space=
+
=KDevelop IDE configuration for use with Crystal Space and CEL=
In this short tutorial I will guide you through some basic steps in order to create a Crystal Space application using the KDevelop IDE.
In this short tutorial I will guide you through some basic steps in order to create a Crystal Space application using the KDevelop IDE.
First of all, you need to have a compiled and working version of Crystal Space, see "Building and Installing Crystal Space".
First of all, you need to have a compiled and working version of Crystal Space, see "Building and Installing Crystal Space".
 +
 +
''Note: The screenshots embedded on this page are reduced versions. Click on them for the full resolution image.''
==Creating the application template==
==Creating the application template==
Line 9: Line 11:
A wizard appears and you should see a screen similar to this:
A wizard appears and you should see a screen similar to this:
-
[[Image:CSkdevelop01.jpg]]
+
[[Image:CSkdevelop01.jpg|800px]]
Now, as shown in the screenshot, choose ''C++'' and ''Simple Hello world program''.
Now, as shown in the screenshot, choose ''C++'' and ''Simple Hello world program''.
Line 18: Line 20:
==Author, version control and copyright information==
==Author, version control and copyright information==
The next step of the wizard takes you to this screen:
The next step of the wizard takes you to this screen:
-
[[Image:CSkdevelop02.jpg]]
+
 
 +
[[Image:CSkdevelop02.jpg|800px]]
 +
 
Here you can enter your name, e-mail and the version and license type of your application.
Here you can enter your name, e-mail and the version and license type of your application.
In the next step you can optionally set up a version control system, which is useful for larger projects. I will not go into detail here, since this is not part of this tutorial:
In the next step you can optionally set up a version control system, which is useful for larger projects. I will not go into detail here, since this is not part of this tutorial:
-
[[Image:CSkdevelop03.jpg]]
+
 
 +
[[Image:CSkdevelop03.jpg|800px]]
The next two screens show the templates for the ''.h'' and ''.cpp'' source files, you may want to keep the copyright stuff in there:
The next two screens show the templates for the ''.h'' and ''.cpp'' source files, you may want to keep the copyright stuff in there:
-
[[Image:CSkdevelop04.jpg]]
+
 
-
[[Image:CSkdevelop05.jpg]]
+
[[Image:CSkdevelop04.jpg|400px]] [[Image:CSkdevelop05.jpg|400px]]
==The important part==
==The important part==
So much for warm-up, lets get down to the nitty-gritty. A screen similar to the one below appears, now open the project properties page by clicking ''Project'' and ''Project Options'':
So much for warm-up, lets get down to the nitty-gritty. A screen similar to the one below appears, now open the project properties page by clicking ''Project'' and ''Project Options'':
-
[[Image:CSkdevelop06.jpg]]
+
 
 +
[[Image:CSkdevelop06.jpg|800px]]
A new window pops up where you can configure several project-specific settings, you can take a look through them to make sure everything is in order.
A new window pops up where you can configure several project-specific settings, you can take a look through them to make sure everything is in order.
-
[[Image:CSkdevelop07.jpg]]
 
-
Click on ''Configure Options'' and enter a new configuration name, here it is ''CrystalSpace''. Now, important is to click on ''Add'' ''before'' actually entering anything in the below fields.
+
[[Image:CSkdevelop07.jpg|800px]]
-
[[Image:CSkdevelop08.jpg]]
+
-
Now you have created a new configuration profile and can set up the Crystal-Space specific settings as shown:
+
Click on ''Configure Options'' and enter a new configuration name, here it is ''CrystalSpace''. Now, important is to click on '' 'Add' '' ''before'' actually entering anything in the below fields.
-
[[Image:CSkdevelop09.jpg]]
+
 
 +
[[Image:CSkdevelop08.jpg|800px]]
 +
 
 +
Now you have created a new configuration profile and you can enter the Crystal-Space specific settings as shown:
 +
 
 +
[[Image:CSkdevelop09.jpg|800px]]
'''Please note:''' If you did not install Crystal Space and the Crystal Space build directory is not in the system $PATH variable, you have to specify the location of the 'cs-config' file explicitly. This means that instead of just entering ''cs-config'' you have to state the location of the 'cs-config' in addition, for example the Crystal Space build directory.
'''Please note:''' If you did not install Crystal Space and the Crystal Space build directory is not in the system $PATH variable, you have to specify the location of the 'cs-config' file explicitly. This means that instead of just entering ''cs-config'' you have to state the location of the 'cs-config' in addition, for example the Crystal Space build directory.
Line 45: Line 54:
If you did not, you really have to enter the path to the build directory of Crystal Space, e.g. ''`/mnt/g/CS/cs-config`''.
If you did not, you really have to enter the path to the build directory of Crystal Space, e.g. ''`/mnt/g/CS/cs-config`''.
However, it is also possible, but not recommended to copy the cs-config file into the top directory of your new project.
However, it is also possible, but not recommended to copy the cs-config file into the top directory of your new project.
 +
For development version of CS, the cs-config-file may be named cs-config-1.1 or similar.
Also note another thing that can be a source of errors: The character that encloses cs-config is an "opening single quote" ` (ASCII nr. 96) and not '! Ensure you do not forget these characters, otherwise you will get a compiler error message later.
Also note another thing that can be a source of errors: The character that encloses cs-config is an "opening single quote" ` (ASCII nr. 96) and not '! Ensure you do not forget these characters, otherwise you will get a compiler error message later.
Line 50: Line 60:
Basically you can copy-paste (and if needed, edit) the following:
Basically you can copy-paste (and if needed, edit) the following:
-
CPPFLAGS: -I `$CRYSTAL/cs-config --includedir`
+
{| class="wikitable" style="width:100%; text-align:center" border="1"
-
 
+
|+ KDevelop Settings for CS and CEL applications
-
LDFLAGS: `$CRYSTAL/cs-config --libs crystalspace`
+
! !!CrystalSpace Application !! CrystalEntityLayer Application
 +
|-
 +
! CPPFLAGS:
 +
| -I `$CRYSTAL/cs-config --includedir` || -I`$CRYSTAL/cs-config --includedir` -I`$CEL/cel-config --includedir`
 +
|-
 +
! LDFLAGS:
 +
| `$CRYSTAL/cs-config --libs crystalspace` || `$CRYSTAL/cs-config --libs crystalspace` `$CEL/cel-config --lflags`
 +
|}
And at the next tab (C tab):
And at the next tab (C tab):
-
CFLAGS: `$CRYSTAL/cs-config --cflags`
+
{| class="wikitable" style="width:100%; text-align:center" border="1"
-
[[Image:CSkdevelop10.jpg]]
+
! !!CrystalSpace Application !! CrystalEntityLayer Application
 +
|-
 +
! CFLAGS:
 +
| `$CRYSTAL/cs-config --cflags` || `$CRYSTAL/cs-config --cflags` `$CEL/cel-config --cflags`
 +
|}
And at the C++ tab:
And at the C++ tab:
-
CXXFLAGS: `$CRYSTAL/cs-config --cxxflags`
+
{| class="wikitable" style="width:100%; text-align:center" border="1"
-
[[Image:CSkdevelop11.jpg]]
+
! !!CrystalSpace Application !! CrystalEntityLayer Application
 +
|-
 +
! CXXFLAGS:
 +
| `$CRYSTAL/cs-config --cxxflags` || `$CRYSTAL/cs-config --cxxflags` `$CEL/cel-config --cxxflags`
 +
|}
 +
 
 +
[[Image:CSkdevelop10.jpg|400px]] [[Image:CSkdevelop11.jpg|400px]]
==Runtime options==
==Runtime options==
-
In the 'run' options tab on the left hand side, you can enter some arguments to the program, e.g. '' '-mode=1280x1024 -fs' ''
+
In the 'run' options tab on the left hand side, you can enter some arguments to the program, e.g. '' '-mode=1280x1024 -fs' '' or '' '-bugplug' ''
==Let your friends run==
==Let your friends run==
Now let's see if you're lucky. Click ''Build'' and ''Run automake & friends''
Now let's see if you're lucky. Click ''Build'' and ''Run automake & friends''
-
[[Image:CSkdevelop12.jpg]]
+
 
 +
[[Image:CSkdevelop12.jpg|800px]]
Before you can start, you have to insert the obligatory lines for Crystal-Space applications in your .cpp file:
Before you can start, you have to insert the obligatory lines for Crystal-Space applications in your .cpp file:
Line 78: Line 106:
In addition you may need to modify the signature of the main function the following way:
In addition you may need to modify the signature of the main function the following way:
-
[[Image:CSkdevelop13.jpg]]
+
 
 +
[[Image:CSkdevelop13.jpg|800px]]
==That's a Simple One==
==That's a Simple One==
Line 85: Line 114:
==Have fun!==
==Have fun!==
-
You should now be able to compile your application and make some shiny game with Crystal Space.
+
Now you should be able to compile your application and make some shiny game with Crystal Space!
That's all there is to it. If you have trouble, you are welcome to check out the Crystal Space IRC-Channel for help or drop me a note.
That's all there is to it. If you have trouble, you are welcome to check out the Crystal Space IRC-Channel for help or drop me a note.
==Useless information==
==Useless information==
-
Written by Jan Hendriks (DaHoC, DaHoC3150@gmail.com)
+
Written by Jan Hendriks (DaHoC, DaHoC3150 [@] gmail.com)
-
 
+
-
Last updated 19.02.2007, Using KDevelop 3.3.6, Crystal Space 1.0
+
-
Based on a tutorial made by Andreas Busch
+
Last major update 10.08.2007, Using KDevelop 3.4.1, Crystal Space 1.3, CEL 1.3 (both svn trunk version)

Current revision

Contents

KDevelop IDE configuration for use with Crystal Space and CEL

In this short tutorial I will guide you through some basic steps in order to create a Crystal Space application using the KDevelop IDE.

First of all, you need to have a compiled and working version of Crystal Space, see "Building and Installing Crystal Space".

Note: The screenshots embedded on this page are reduced versions. Click on them for the full resolution image.

Creating the application template

Now open KDevelop C/C++ IDE and click on Project -> New.

A wizard appears and you should see a screen similar to this:

Now, as shown in the screenshot, choose C++ and Simple Hello world program.

In the properties area, enter your preferred application name and a location to store the source and additional files in. The path can be located anywhere you like and does not have to be in the Crystal Space source directory. Just make sure you have sufficient r/w permissions and drive space available.

Author, version control and copyright information

The next step of the wizard takes you to this screen:

Here you can enter your name, e-mail and the version and license type of your application.

In the next step you can optionally set up a version control system, which is useful for larger projects. I will not go into detail here, since this is not part of this tutorial:

The next two screens show the templates for the .h and .cpp source files, you may want to keep the copyright stuff in there:

The important part

So much for warm-up, lets get down to the nitty-gritty. A screen similar to the one below appears, now open the project properties page by clicking Project and Project Options:

A new window pops up where you can configure several project-specific settings, you can take a look through them to make sure everything is in order.

Click on Configure Options and enter a new configuration name, here it is CrystalSpace. Now, important is to click on 'Add' before actually entering anything in the below fields.

Now you have created a new configuration profile and you can enter the Crystal-Space specific settings as shown:

Please note: If you did not install Crystal Space and the Crystal Space build directory is not in the system $PATH variable, you have to specify the location of the 'cs-config' file explicitly. This means that instead of just entering cs-config you have to state the location of the 'cs-config' in addition, for example the Crystal Space build directory. If you registered the $CRYSTAL-variable system-wide this can be done by substitution of every `cs-config` with `$CRYSTAL/cs-config`. If you did not, you really have to enter the path to the build directory of Crystal Space, e.g. `/mnt/g/CS/cs-config`. However, it is also possible, but not recommended to copy the cs-config file into the top directory of your new project. For development version of CS, the cs-config-file may be named cs-config-1.1 or similar.

Also note another thing that can be a source of errors: The character that encloses cs-config is an "opening single quote" ` (ASCII nr. 96) and not '! Ensure you do not forget these characters, otherwise you will get a compiler error message later.

Basically you can copy-paste (and if needed, edit) the following:

KDevelop Settings for CS and CEL applications
CrystalSpace Application CrystalEntityLayer Application
CPPFLAGS: -I `$CRYSTAL/cs-config --includedir` -I`$CRYSTAL/cs-config --includedir` -I`$CEL/cel-config --includedir`
LDFLAGS: `$CRYSTAL/cs-config --libs crystalspace` `$CRYSTAL/cs-config --libs crystalspace` `$CEL/cel-config --lflags`

And at the next tab (C tab):

CrystalSpace Application CrystalEntityLayer Application
CFLAGS: `$CRYSTAL/cs-config --cflags` `$CRYSTAL/cs-config --cflags` `$CEL/cel-config --cflags`

And at the C++ tab:

CrystalSpace Application CrystalEntityLayer Application
CXXFLAGS: `$CRYSTAL/cs-config --cxxflags` `$CRYSTAL/cs-config --cxxflags` `$CEL/cel-config --cxxflags`

Runtime options

In the 'run' options tab on the left hand side, you can enter some arguments to the program, e.g. '-mode=1280x1024 -fs' or '-bugplug'

Let your friends run

Now let's see if you're lucky. Click Build and Run automake & friends

Before you can start, you have to insert the obligatory lines for Crystal-Space applications in your .cpp file:

#include <crystalspace.h> (in the screenshot: <cssysdef.h> because of older version of Crystal Space) and

CS_IMPLEMENT_APPLICATION.

In addition you may need to modify the signature of the main function the following way:

That's a Simple One

For testing purposes, you can try out the 'simple1.cpp' and 'simple1.h' source files from the Crystal Space code tree. These files can be found within the Crystal Space source code tree at the following location: 'CS/apps/tutorial/simple1'

Have fun!

Now you should be able to compile your application and make some shiny game with Crystal Space!

That's all there is to it. If you have trouble, you are welcome to check out the Crystal Space IRC-Channel for help or drop me a note.

Useless information

Written by Jan Hendriks (DaHoC, DaHoC3150 [@] gmail.com)

Last major update 10.08.2007, Using KDevelop 3.4.1, Crystal Space 1.3, CEL 1.3 (both svn trunk version)

| Article | Discussion | View source | History |