Difference between revisions of "Compile With Eclipse"

From FreeOrionWiki
Jump to: navigation, search
m (Python plugin: Clarifying text.)
(Old and stale, we don't use SourceForce or Subversion, recommended method to generate eclipse projects is via CMake.)
 
Line 1: Line 1:
Eclipse is open source multiplatform IDE comparable with Visual Studio.
 
  
Eclipse IDE for C/C++ Developers can be downloaded [http://www.eclipse.org/downloads/ here].
 
To compile FreeOrion with Eclipse it is required that you install the following plugins for Eclipse:
 
*subversion
 
*python
 
 
==Plugins==
 
===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.
 
 
===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
 
 
==Settings==
 
===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
 
 
===Autorefresh project===
 
Under Windows->Preferences->General->Workspace turn on
 
*Refresh automatically
 
===Changing minimum and maximum memory for Eclipse===
 
Change eclipse.ini file with lines Xms(minimal memory) and Xmx(maximal memory) to
 
 
-Xms256m
 
 
-Xmx1024m
 
 
===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
 
 
==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.
 
Or look at nice manual [http://www.ibm.com/developerworks/opensource/library/os-ecl-subversion/[here]]
 
 
After some changes in svn repository you can update it from Eclipse(project name->Team->Synchronize with repository and update file)
 
 
==Install missing libraries and headers==
 
===Install GG to system===
 
Compile in console GG and install it.
 
===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)
 
 
===Set Boost headers to Eclipse===
 
Similarly add path where Boost headers are installed(on Linux it is /usr/includes/boost)
 
 
===Set Ogre headers to Eclipse===
 
Add path where Ogre headers are installed(on Linux it is /usr/local/include/OGRE)
 
 
===Install pylint library for Python error checking===
 
====Ubuntu and Debian====
 
Install with command:
 
(sudo) apt-get install pylint
 
 
==Compile FreeOrion from Eclipse==
 
===Configuring Eclipse External Tools to using make to compile===
 
Run->External Tools->External Tools Configuration->Program and clicked with right mouse button New.
 
 
Update Location to where make is installed. On Linux it is:
 
/usr/bin/make
 
 
Update Working Directory via Browse Workspace and select directory where is FreeOrion. Clicked Apply.
 
 
Repeat above steps with cmake. Cmake location on linux is:
 
/usr/bin/cmake
 
Add arguments to cmake from [[Compile_In_Linux|Compile in linux]].
 
After updating from svn or changing cmake configuration there is need to regenerate cmake configuration.
 
 
How to configure eclipse cdt project using cmake is [http://www.cmake.org/Wiki/CMake:Eclipse_UNIX_Tutorial[here]].
 
===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 cmake via Eclipse External Tools and compile FreeOrion.
 
 
==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.
 

Latest revision as of 20:21, 15 March 2018