Compile With Eclipse
From FreeOrionWiki
Eclipse is open source multiplatform IDE comparable with Visual Studio.
Eclipse IDE for C/C++ Developers in version 3.5 can be downloaded here. To compile FreeOrion with Eclipse it is required to install plugins for Eclipse to support:
- subversion
- python
Contents |
[edit] Plugins
[edit] Subversion plugin
Click on Help->Install New Software menu, select work with All Avalaible Sites and install Collaboration->Subversive SVN Team Provider.
Add update url(Help->Install New Software->Add) for subversion connector plugin in Eclipse. Install it via Subversive SVN Connectors-> and check:
- Subversive SVN Connectors
- SVNKit 1.3.x Implementation.
[edit] Python plugin
Add update url(Help->Install New Software->Add) for Pydev plugin in Eclipse. Install it for developing FreeOrion AI written in Python. PyDev->PyDev for Eclipse
[edit] Settings
[edit] Insert spaces for tabs
Under Window>Preferences>General>Editors>Text Editors turn on
- Insert spaces for tabs
Under Window>Preferences>C/C++>Code Style->Edit change Tab Policy
- Spaces only
[edit] Autorefresh project
Under Windows->Preferences->General->Workspace turn on
- Refresh automatically
[edit] Changing minimum and maximum memory for Eclipse
Change eclipse.ini file with lines Xms(minimal memory) and Xmx(maximal memory) to
-Xms256m
-Xmx1024m
[edit] Turn automatic Eclipse updates on
Under Windows->Preferences->Install/Update->Automatic Updates turn on
- Automatically find new updates and notify me
- Download new updates automatically and notify me when ready to install them
[edit] Checkout from repository
Switch to SVN Repository Exploring perspective(Window->Open Perspective->Other) and add location
http://freeorion.svn.sourceforge.net/svnroot/freeorion/trunk
Select FreeOrion, use option using wizard and confirm. On the next screen, change project to C++, select Makefile project and confirm Hello World screen. After Eclipse downloads sources from subversion repository, switch to C++ perspective.
After some changes in svn repository you can update it from Eclipse(project name->Team->Synchronize with repository and update file)
[edit] Install missing libraries and headers
[edit] Install GG to system
Compile in console GG and install it.
[edit] Set GG headers to Eclipse
Right click on project name and select Properties. Under C/C++ General->Paths and symbols->Includes->Gnu C++
add path where installed headers are(on Linux it is /usr/local/includes/GG)
[edit] Set Boost headers to Eclipse
Similarly add path where Boost headers are installed(on Linux it is /usr/includes/boost)
[edit] Set Graphviz headers to Eclipse
Add path where Graphviz headers are installed(on Linux it is /usr/includes/graphviz)
[edit] Set Ogre headers to Eclipse
Add path where Ogre headers are installed(on Linux it is /usr/local/include/OGRE)
[edit] Install pylint library for Python error checking
[edit] Ubuntu and Debian
Install with command:
(sudo) apt-get install pylint
[edit] Compile FreeOrion from Eclipse
[edit] Configuring Eclipse External Tools to using scons to compile
Run->External Tools->External Tools Configuration->Program and clicked with right mouse button New.
Update Location to where scons is installed. On Linux it is:
/usr/bin/make
Update Working Directory via Browse Workspace and select directory where is FreeOrion
Clicked Apply.
[edit] Running compile
First time, you have to compile FreeOrion from console because it will generate configuration and will compile correctly project. Then it is possible to compile FreeOrion with Eclipse. After changing some FreeOrion file in Eclipse, run scons via Eclipse External Tools and compile FreeOrion.
[edit] Run FreeOrion from Eclipse
Run->Run Configurations->C/C++ Application and clicked with right mouse button New.
Update Location to where C/C++ Application is installed with selecting Browse and find file freeorion(you have to compile FreeOrion first)
Clicked Apply and Run to test this configuration.

