OpenOffice and Eclipse
With current versions of Eclipse (4.3) it is possible to create C/C++ projects for OpenOffice modules and use code assist, refactoring, lookup of definitions and declarations and all the other nice things that a modern IDE provides.
There are two different approaches to import the OpenOffice source code into Eclipse:
- The whole repository at once.
- You will need a not-yet-released nightly build of CDT to prevent major memory leaks and still have to increase memory limits for Eclipse.
- Module by module.
- This approach works with vanilla Eclipse. You only import individual modules (say sw/ and sfx/ into your workspace).
Module by Module
The following describes how to set up Eclipse for the module by module approach.
Install Eclipse
Install a current version of Eclipse (http://www.eclipse.org/downloads/).
- Version 4.3 (Kepler) is known to work. Older 4.* versions may also work.
- A version with focus on C/C++ (titled "Eclipse IDE for C/C++ Developers) works best but other versions with the CDT addon installed should work also.
Prepare a workspace
Start Eclipse and select or create an empty workspace. The empty workspace is not a hard requirement but with one Eclipse project per OpenOffice module you may loose track otherwise. You can freely choose the location of the workspace, just don't use the OpenOffice source code directory.
Add module to workspace
- Open the import wizard via menu
File->New->Other
. - In the dialog choose the
C/C++ -> Makefile Project with Existing Code
wizard. - In the 'Import Existing Code' wizard
- use the 'Browse...' button to set the 'Existing Code Location' to the top-level directory of a module. This will also set the 'Project Name'.
- Select the correct tool chain for your platform.
- Tool chains for the individual platforms:
- Windows : Microsoft Visual C++
- Close the import wizard via the
Finish
button to start the module import.
- Close the import wizard via the
Setup project properties
A few changes to the project properties are necessary for the indexer to find all include files and use the correct compiler definitions.
- Open the properties dialog via the menu
Project->Properties
. - Activate the
C/C++ General->Paths and Symbols
page. - In the 'Languages' list (left center) activate 'GNU C++', (for some reason this name does not change even when you use the MSVC tool chain).
- Click 'Add...' and in the new dialog 'File system...' and browse to
main/solver/VERSION/PLATFORM/inc
. - Click 'OK' two times to get back to the properties dialog.
- Go to the 'Symbols' tab page.
- Click 'Add...' and add macro definitions
- Windows: WNT (empty value)
- Click OK to close the dialog.
- Rebuild the index via 'Project->C/C++ Index->Rebuild'. This time the indexer should runs longer because it has to index no only the files in the module but also all include files in
solver/