#Author: D. Bonnie
#Date  : 03/11/2013

To install eclipse:

1. Download the latest version of Eclipse CDT (http://www.eclipse.org/cdt/)

The workspace is located at /home/SMCDev/SMC/eclipseWorkspaces

Project directories should exist at the workspace location.

-------------------------------------------
After Installing Eclipse:

Window -> Preferences -> C/C++ -> Build -> Build Variables

	makepp_build_location = /home/SMCDev/SMC/mpp2
	debug_path            = common/Debug
	release_path          = common/Release
	zoom_debug_path       = common/ZoomDebug
	zoom_release_path     = common/ZoomRelease
	z6debug_path            = common/zzDebug6.0.0
	z6release_path          = common/zzRelease6.0.0
	z6zoom_debug_path       = common/zzZoomDebug6.0.0
	z6zoom_release_path     = common/zzZoomRelease6.0.0

Window -> Preferences -> Run/Debug -> String Substitution

	debug_binary_path   = /home/SMCDev/SMC/mpp2/common/Debug
	release_binary_path = /home/SMCDev/SMC/mpp2/common/Release
	z6debug_binary_path   = /home/SMCDev/SMC/mpp2/common/zzDebug6.0.0
	z6release_binary_path = /home/SMCDev/SMC/mpp2/common/zzRelease6.0.0

--------------------------------------------
---- Add an existing project in eclipse ----
--------------------------------------------

 - File -> Import... 

 - General -> Existing Projects into Workspace

 - Select root directory -> /home/SMCDev/SMC/eclipseWorkspaces

 - click Finish

-------------------------------------
---- Create a project in eclipse ----
-------------------------------------

 - File -> New C++ Project

 - Set your project name, denoted as MyProject

 - Project type: Makefile project -> Empty Project

 - Toolchains: Linux GCC

 - Finish

In the project view: Add a folder called "src" to the project that is a link to the source directory, typically under /home/SMCDev/SMC/MyProject, this folder will be the location of the source files (to edit, compile, debug, etc)

 - Right click on the project -> New -> Folder

 - Enter "src" for the folder name

 - Click "Advanced>>" -> Click "link to alternate location (linked folder)	

 - Enter "/home/SMCDev/SMC/MyProject", where MyProject is the name of the project being created, for the folder path

----------------------------------------------
---- Set build log file location and name ----
----------------------------------------------

Go to project -> properties -> C/C++ Build -> Logging

 - change the log file location to: /home/SMCDev/SMC/eclipseWorkspaces/buildLogs/MyProject-build.log

------------------------------------------
---- Set Project build configurations ----
------------------------------------------

*Note: if this is a new project, the makepp files may not yet exist. Make sure the relevant makepp files exist for building. 

Go to Project -> Properties -> C/C++ build:

 - select "Manage Configurations"

 - select "New"

 - enter "Debug" for "Name:", description can be blank

 - select the "import from projects" bullet

 - select "ProjectName->Debug", such that ProjectName != Top, e.g. select ADCP->Debug

 - repeat this process for creating Release, ZoomDebug, ZoomRelease, zzDebug6.0.0, zzRelease6.0.0, zzZoomDebug6.0.0 and zzRelease6.0.0 configurations

If for some reason no configurations are available:

Go to Project -> Properties -> C/C++ build:

 - select "Manage Configurations"

 - select "New"

 - enter "Debug" for "Name:", description can be blank, choose the default existing configuration

 - Building Settings Tab: Build Command -> makepp (uncheck use default build command), Build Directory: ${makepp_build_location} 

 - Behavior Tab: 

	Build: common/${ConfigName}/${ProjName}
	Clean: ${ProjName}/${ConfigName}/clean

   These settings can be used for all configurations

 - repeat for all other builds, replacing the above line with the appropriate name, e.g. release_path, zoom_debug_path, zoom_release_path, z6debug_path, z6release_path, z6zoom_debug_path, z6zoom_release_path

-------------------------------------------------
---- Add references (dependencies) for build ----
-------------------------------------------------

Go to Project -> Properties -> Project References and remove all references.  The makepp build system already handles cascading builds.

-----------------------------------------------------------
---- Enable Running / Debugging of Projects in Eclipse ----
-----------------------------------------------------------

Project -> Properties -> Run/Debug Settings

 - new "MyProject Debug"

 - Main (Tab) -> C/C++ Application: ${debug_binary_path}/${project_name}

 - Arguments (Tab) -> working directory: ${workspace_loc:MyProject/src}

 - Environment (Tab) -> New -> 
	
		Name = 'LD_LIBRARY_PATH'
		Value = '/home/SMCDev/SMC/mpp2/common/Debug:/home/SMCDev/omniORB/Ubuntu/lib:/usr/local/boost/1.50.0/lib'

		Name = 'PATH'
		Value = '/home/SMCDev/omniORB/Ubuntu/bin:.:$PATH'

 - Common (Tab) -> Standard Input and Output -> Check 'Allocate console (necessary for input)' and 'File'...
       
	... where the input for 'File' is '/home/SMCDev/SMC/eclipseWorkspaces/consoleLogs/myProject-Debug.log'

	*Note: if the consoleLogs folder does not exist, create this folder with mkdir, e.g.'mkdir /home/SMCDev/SMC/eclipseWorkspaces/consoleLogs'

repeat for "MyProject Release"

 - Main (Tab) -> C/C++ Application: ${release_binary_path}/${project_name}

 - Arguments (Tab) -> working directory: ${workspace_loc:MyProject/src}

 - Environment (Tab) -> New -> 
	
		Name = 'LD_LIBRARY_PATH'
		Value = '/home/SMCDev/SMC/mpp2/common/Release:/home/SMCDev/omniORB/Ubuntu/lib:/usr/local/boost/1.50.0/lib'

		Name = 'PATH'
		Value = '/home/SMCDev/omniORB/Ubuntu/bin:.:$PATH'

 - Common (Tab) -> Standard Input and Output -> Check 'Allocate console (necessary for input)' and 'File'...
       
	... where the input for 'File' is '/home/SMCDev/SMC/eclipseWorkspaces/consoleLogs/myProject-Release.log'

repeat for "MyProject zzDebug6.0.0"

 - new "MyProject zzDebug6.0.0"

 - Main (Tab) -> C/C++ Application: ${z6debug_binary_path}/${project_name}

 - Arguments (Tab) -> working directory: ${workspace_loc:MyProject/src}

 - Environment (Tab) -> New -> 
	
		Name = 'LD_LIBRARY_PATH'
		Value = '/home/SMCDev/SMC/mpp2/common/zzDebug6.0.0:/home/SMCDev/omniORB/zzUbuntu6.0.0/lib:/usr/local/boost/1.46.1/lib'

		Name = 'PATH'
		Value = '/home/SMCDev/omniORB/zzUbuntu6.0.0/bin:.:$PATH'

 - Common (Tab) -> Standard Input and Output -> Check 'Allocate console (necessary for input)' and 'File'...
       
	... where the input for 'File' is '/home/SMCDev/SMC/eclipseWorkspaces/consoleLogs/myProject-zzDebug6.0.0.log'

repeat for "MyProject zzRelease6.0.0"

 - Main (Tab) -> C/C++ Application: ${z6release_binary_path}/${project_name}

 - Arguments (Tab) -> working directory: ${workspace_loc:MyProject/src}

 - Environment (Tab) -> New -> 
	
		Name = 'LD_LIBRARY_PATH'
		Value = '/home/SMCDev/SMC/mpp2/common/zzRelease6.0.0:/home/SMCDev/omniORB/zzUbuntu6.0.0/lib:/usr/local/boost/1.46.1/lib'

		Name = 'PATH'
		Value = '/home/SMCDev/omniORB/zzUbuntu6.0.0/bin:.:$PATH'

 - Common (Tab) -> Standard Input and Output -> Check 'Allocate console (necessary for input)' and 'File'...
       
	... where the input for 'File' is '/home/SMCDev/SMC/eclipseWorkspaces/consoleLogs/myProject-zzRelease6.0.0.log'

------------------------------------
---- Adding your project to svn ----
------------------------------------

Under /home/SMCDev/SMC/eclipseWorkspaces:

svn add --parents MyProject/.cproject MyProject/.project


