Developing in Eclipse on Linux

From MythTV Official Wiki
Jump to: navigation, search

Warning.png Warning: The QT integration plugin causes corruption of the .pro (project) files in MythTV breaking the build. Please don't report build errors if you are using eclipse.


Introduction

With the release of QT Eclipse integration and the move to QT 4.4, it is now possible to have a working environment in Eclipse on Linux.

(The examples given assume 32-bit Ubuntu 8.10)

Install Software Packages

Eclipse and C Developers Toolkit Plugin

Download and install Eclipse IDE for C/C++ Developers or use Update with your existing Eclipse to install the CDT plugin.

Example:

 cd ~/Dev
 wget http://download.eclipse.org/technology/epp/downloads/release/ganymede/SR2/eclipse-cpp-ganymede-SR2-linux-gtk.tar.gz
 tar xvfz eclipse-cpp-ganymede-SR2-linux-gtk.tar.gz

Eclipse QT Integration

Download Eclipse QT Integration.

Follow the installation instructions

Example:

 cd ~/Dev
 wget http://get.qt.nokia.com/qteclipse/qt-eclipse-integration-linux.x86-1.6.1.tar.gz
 #if /usr/local/eclipse/plugins exists then
 cd /usr/local 
 #elseif /usr/lib/eclipse/plugins exists then
 #cd /usr/lib
 sudo tar xvfz ~/Dev/qt-eclipse-integration-linux.x86-1.6.0.tar.gz
 #Start eclipse clearing caches
 eclipse -clean

Configure in Eclipse: - Window | Preferences - select 'Qt' section - Add a new Qt version:

Name: QT 4.4.0
Bin Path: /usr/bin
Include Path: /usr/include/qt4

- Note that if you define more that one QT version, you will have to edit each Project's Properties to indicate which one to use.

Eclipse Perl Integration

Install EPIC

Example:

 In Eclipse, select Help | Software Updates...
 Add site: http://e-p-i-c.sf.net/updates/testing
 Install EPIC 0.6.33

Subversion and Subclipse

Install Subversion (available in distro packages)

Install Subclipse

Example:

 sudo apt-get install subversion libsvn-java   // installs svn 1.5.1
 In Eclipse, select Help | Software Updates...
 Add site: http://subclipse.tigris.org/update_1.4.x
 Install Subclipse node (containing Subclipse, Subversion Client Adaptor, Subversion Native Library Adaptor, and Subversion Revision Graph) 

Create Eclipse Project

Check out sources:

  1. File | New > New Project...
  2. SVN | Checkout Projects from SVN
  3. Create new repository location: http://svn.mythtv.org/svn/ (or select it if you've created it already)
  4. Select the root "trunk" folder of the repository
  5. MAKE SURE you select "Check out as a project in the workspace"
  6. Enter a name for the project eg. "mythtv-trunk-svn"
  7. Accept all the other defaults and click "Finish"
  8. About 150MB of source will now be checked out

NOTE: if you get the error "Unable to load default svn client" while Eclipse is confirming the subversion url, then you need to install the subversion java bindings : apt-get install libsvn-java

Convert project:

  1. File | New > Convert to a C/C++ Make Project
  2. Select your "mythtv-trunk-svn" project
  3. Select "C++" project and click "Finish"

Set up build targets:


Important.png Note: To be completed...

Another way:

  1. check out sources on command line with "svn co http://svn.mythtv.org/svn/trunk" to your favorite location
  2. in Eclipse go to File-->Import and select Qt/"Qt Project" then press "next"
  3. look for your mythtv folder and select the mythtv project-file /your/path/mythtv/mythtv.pro
  4. take care of the Caveats-section
  5. now, mythtv should compile fine in your Eclipse installation

Caveats

Eclipse doesn't like the empty "config" directory. Comment out "SUBDIRS += config" in myth.pro to solve it.