Developing in Eclipse on Linux
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.
Contents
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:
- File | New > New Project...
- SVN | Checkout Projects from SVN
- Create new repository location: http://svn.mythtv.org/svn/ (or select it if you've created it already)
- Select the root "trunk" folder of the repository
- MAKE SURE you select "Check out as a project in the workspace"
- Enter a name for the project eg. "mythtv-trunk-svn"
- Accept all the other defaults and click "Finish"
- 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:
- File | New > Convert to a C/C++ Make Project
- Select your "mythtv-trunk-svn" project
- Select "C++" project and click "Finish"
Set up build targets:
Another way:
- check out sources on command line with "svn co http://svn.mythtv.org/svn/trunk" to your favorite location
- in Eclipse go to File-->Import and select Qt/"Qt Project" then press "next"
- look for your mythtv folder and select the mythtv project-file /your/path/mythtv/mythtv.pro
- take care of the Caveats-section
- 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.