How to create Eclipse project from existing source

When you create a project in Eclipse (or NVIDIA Nsight), it creates a new directory in your workspace and creates the files there. If you have your source files arranged under a directory in some other location, you might prefer to work on them without Eclipse copying them over to its workspace directory.

To achieve this, do not use the import option! Instead create a new project, in its dialog uncheck the Use default location option and provide the root directory of your source code. The entire contents of your source directory will appear in the newly created project. Do not fear, they have not been copied. Instead, Eclipse has created .project, .cproject and other hidden files and directories in your source directory, so that it can work from there. Also, any new files or directories you create under your source directory will automatically appear in your Eclipse project.

Another alternative to this approach is to create a Makefile project, which works similarly.

Tried with: NVIDIA Nsight 5.5.0 and Ubuntu 12.04 LTS

Advertisements

One thought on “How to create Eclipse project from existing source

  1. I want to create a new project in eclipse using a batch file(command line). I don’t want to use the GUI to create the project.
    I will provide the source code and Makefile(which I already have) to the batch file. The batch file should create an eclipse project with the provided Makefile.
    Later I want the batch file to start debugger for the same project

    I want to ease the work of repeatedly creating a new project in eclipse for my different application. With a single batch file, I want to create a new project in eclipse and debug it.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.