Forcing Eclipse to generate standard Unix makefiles - eclipse

I have an Eclipse project I've been working on for some time now, and I'd like to open source it. But to do that I'd like to have a clean Makefile like the majority of other open source programs. I understand I could make my own, but it would be better if Eclipse could manage it for me. Getting Eclipse to generate a CMake file would be even better, but I can settle for a plain makefile if that is easiest. So, how can I get Eclipse to do this? There are a few posts on the internet that suggest selecting "Managed make" when creating a project, but they were from a few years ago and are outdated. When I try to create a C project, there is the option to create a "Makefile project", but it creates the makefile in a folder called "Linux GCC" and makes everything cluttered. Any suggestions?

I've been a *nix guy for 25+ years and am a big fan of make. However, making your Eclipse project dependent upon make is going to exclude the Mac and Windows community. Why don't you just export the Eclipse project and open source it as an Eclipse project? Then users can can have it ready to extend if they choose. You didn't specify the language your project is written in, if it's Java (pretty common for Eclipse) why not create an ant build file for the project?
Just a thought.

I ended up just creating a CMake project by hand. CMake files are really not that hard to make, and it's a lot easier than trying to get Eclipse to do it for you. Plus, they're cross-platform.

Would a CMakeBuilder eclipse plugin, associated with this tutorial be a good fit for what you are trying to do?
The end result would be something like:
(source: vtk.org)

If you've been building your project using the Debug configuration the makefile Eclipse generates is stored in the Debug folder of your project (or the Release folder if you've built it using the release configuration).

Related

Eclipse CDT, stop auto find

I've recently been trying to setup a little toolchain for something with Eclipse CDT but I'm being driven insane by the default behaviors of Eclipse. It's just so against the grain of other IDEs for C/C++.
Is there anyway to disable the automatic searching of folders in the project directory for the source files? I want to manually add the files for it to compile instead of having to manually exclude all the files I don't want it to compile between multiple configurations.
you can use your own makefile instead on relying on the eclipse auto generated makefile

Migrating From NetBeans to Eclipse

My company wants to migrate to Eclipse, I was wondering what options besides an Ant build are there to move our projects from Netbeans to Eclipse.
Tooooo ... oooo .... oooo late to answer but this works
http://www.coderanch.com/t/458555/vc/Export-Netbeans-Eclipse
i was looking for an answer my self and saw this question :)
Quoting:
Here is a little tutorial on "Importing projects from NetBeans to Eclipse".
Please try this:
PART I - NETBEANS
Open NebBeans.
Create a java project named "ToEclipse".
Build this project.
Then, NetBeans has created several folders. The important folders to us are (in my computer):
c:\User\Almir\NetBeans\ToEclipse\dist
c:\User\Almir\NetBeans\ToEclipse\src
PART II - ECLIPSE
Go to Eclipse.
Create a java project in Eclipse named "ToEclipse".
Then, Eclipse has created several folders. The important folders to us are (in my computer):
c:\Users\Almir\Eclipse\ToEclipse\bin
c:\Users\Almir\Eclipse\ToEclipse\src
PART III - WINDOWS EXPLORER
Go to Windows Explorer.
Copy the FILE "ToEclipse.jar" at c:\Users\Almir\Eclipse\ToEclipse\bin folder.
Past it in c:\Users\Almir\Eclipse\ToEclipse\bin
Copy the FOLDER "toeclipse" at c:\User\Almir\NetBeans\ToEclipse\src folder.
Past it in b) c:\Users\Almir\Eclipse\ToEclipse\src folder.
PART IV - ECLIPSE
Go to Eclipse.
Press F5 to refresh the view.
Verify that your project is there (under ToEclipse/src/toeclipse).
Say "Oh! Yes! It works!".
Run the project.
Return to 3) how many times you want!
I hope that helps you!
Kind regards,
Almir Campos
São Paulo, Brazil.
I found another easier way that worked for me at least since I had problems importing the Ant build script due to a missing javac.
Say you have your Netbeans project (src, build, dist etc) in D:/blah/
In Eclipse go to File->New->Java Project
Uncheck 'Use default location' and instead use the path where the Netbeans project is (D:/blah/) Eclipse should automatically populate everything else and link to the files as well.
I have recently 'migrated' from Netbeans to Eclipse and found it amazingly easy. The reason it was easy though is that all of our projects are IDE independent standard ant and ivy build scripts that most modern IDE's can understand. This way, we all get to use the IDE we like (yes - emacs and vi too) and their are no 'migration' issues.
The reason that I am pointing that out is that, if it is not already that way, I would recommend that you take that same path on your migration. Just create some standard ant (and ivy) build scripts. Eclipse knows how to slurp those in and there will be no future migration issues.
in MY PERSONAL experience, it was easy. I was migrating a java desktop app from netbeans to eclipse. Just copy my projects into the workspace, create the project in eclipse as a new java project and put the same name of the project in netbeans (use your workspace as location). It will recognize the project structure ( Eclipse Helios, Netbeans 6.8 )
Hope this helps. I don't know how hard it turns if you have another kind of project.
I just migrated a Netbeans 7.0 JSF web project to Eclipse. And it was easier than i would have imagined.
What i did was:
List item
Clean and build my JSF application in netbeans
Close netbeans and open Eclipse(i use galileo)
Create a new Dynamic Web Application.
Right click on the new web application in project explorer and go to import then to .WAR file
It then ask whether i want to import any of the jar files(libraries) as projects and i do not select any and just click finish.
Copied my netbeans src(source) folder /src/java/ to
the Eclipse src folder. e.g netbeansproject/medman/src/java/com to eclipseSpace/medman/src/
Next setup your server in Eclipse(i use tomcat 6.0).
And voila! it is done.
You can also check out this link. http://www.coderanch.com/t/458555/vc/Export-Netbeans-Eclipse
At my company people pretty much use either eclipse or Netbeans. I myself use both of them for various tasks. We write our own ant scripts to build and package our source so it does not matter what IDE a person uses. I would suggest that you create your own ant script to build your source, that way you won't have to depend on an IDE specific build script.

Completely lost with Blackberry JDE for Eclipse

I'm serious. I installed the Blackberry web developer thing for eclipse (being stupid, and not seeing the 'web' part). Then, when I realized my mistake, I went and got the JDE for Eclipse. I went through the install process....open up Eclipse...and I'm lost. I don't know how to run code...or the simulator, or anything.
All the tutorials I'm finding are referencing an older "beta" version of the Eclipse plugin, which apparently had a "Blackberry" menu option. I'm not seeing that.
I found some sample code, which gives the helpful instructions:
"1. Extract HelloWorld_incomplete.zip
2. In the IDE, open the helloworld.jdw workspace
3. Open the helloworld.java source file.
"
...I've never seen a .jdw file before. If I try opening it in Eclipse, I get a not-very-useful text file. Since they say it's a workspace, I try the "Switch Workspace" option in Eclipse, which lets me pick a folder, rather than a file.
I'm pretty sure "Import Project" isn't right, either.
So, I figure I'll deal with that later, so I open up the source code (a standard .java file, with a main, etc). I try running it, but it asks for an Ant build file.
I can run standard Java files just fine (that is, I know Java is in my path).
I don't know if maybe I don't have the Blackberry part right...or if it's on the eclipse side where I'm failing.
Does anyone have any ideas?
-Jenny
Edit: Just to be sure, I tried downloading the plugin through eclipse with their provided link (http://www.blackberry.com/go/eclipseUpdate), but eclipse says that it got a .jar file when it was expecting a .zip file, and so it errored. Can you even unzip a jar file (like Eclipse is trying to do?)
It sounds like you have the wrong package.
I installed it yesterday from the "Download Now" button at http://na.blackberry.com/eng/developers/javaappdev/javaeclipseplug.jsp
and it had both the menu option and the Blackberry project type.
It should have an installer if you get the correct one. I would post a direct link, but RIM likes to ask for your info before allowing the download.
Try installing it to a different directory and using a new workspace. It could be that the old install is interfering somehow.
-Hope that helps
if you want to know step by step to install the jde plugin in eclipse you can visit http://learn.virtue-software.com/2011/05/quick-start-creating-blackberry-application-with-eclipse/

How to open Eclipse project as read-only?

Does anyone know is there a way to open a project in Eclipse in read-only mode? If there is a lot of similar projects open it is easy to make changes to a wrong one.
Putting project in read-only mode is really useful, when you make another instance from the previous project. So you copy all files from old project, then make changes in the new instance. It's really simple to edit files from old project by mistake (they have the same names)!
Serg if you use linux, I suggest to put all files in read only mode with chmod in terminal:
sudo chmod 444 -R /path/to/your/project
After this operation Eclipse will tell you that file you are trying to edit is in read-only mode. I think that's enough to make the previous project safe :)
One sub-optimal solution is to make the project directory read-only in the file system in the underlying OS. I'm not sure how eclipse will react though.
This feature is called "binary projects" and is provided by the eclipse plug-in developement environment (PDE). Note that this only works for eclipse plug-in project, see
Contributing to Eclipse - Principles, patterns and plug-ins
or
http://www.vogella.de/articles/EclipseCodeAccess/article.html#importplugins_binary
You can also use the close project/open project feature : close all projects and only open the one you need to work on ?

How do I configure Eclipse to work on Qt-based applications in a subversion tree?

Most of the work being done at my company is Qt-based C++, and it's all checked into a Subversion repository. Until now, all work on the codebase has been done purely with nano, or perhaps Kate. Being new here, I would like to take advantage of setting up Eclipse -properly- to edit my local copy of the tree. I have the CDT "version" of Eclipse, and the Qt integration, and the Subclipse module. At this point, though, I don't know what to do. Do I "import" the projects into an Eclipse-controlled workspace? Do I edit them in place? Nothing I've tried to do gets Eclipse to recognize that the "project" is a Qt application, so that I can get the integration working.
I would create a new QT project in eclipse, then switch perspectives to subclipse and simply do a SVN checkout into the new eclipse project. You should be good to go.
OK, I've been playing around with this idea, and it has some merit. I can switch to the "SVN Project Exploring" perspective (which I hadn't noticed before), and do a checkout from the head of the sub-project I want. I get a nice SVN-linked copy of the tree in my Eclipse workspace for editing. Eclipse even "understands" the classes, and can do completion on methods and such. However, I still can't get Eclipse to understand that the project is a "QT Gui" project, such that I could view the properties, and control the linking of the various Qt libraries and the like. By extension, it also doesn't understand how to build my project, like it would be able to do if I had created an empty Qt Gui project from scratch. How do I get this part working?
I have exactly the same situation at work (with CVS instead of subversion and the rest of the team using KDevelop but that's no big deal). Just start a new Qt Gui project using the Qt - Eclipse integration features and then remove all the auto generated files. Now using the "Team" features of eclipse and choose to share your project, enter the path to the repository and you 're good to go.
Checkout the project. It will ask you some options like if you want to start with a blank project, or want to use the tree to make a new project. Choose the latter and you should be ok :). It seems to work for me with Ganymed and subversive(not sure about subclipse and i don't remember.) :)
The only way I could get this to work was to check out the project with eclipse and then copy over the .project and .cdtproject files from another Qt-project. Then do a refresh on the project. This is a horrible hack but it gets you started.
You might need to define another builder for 'make'.
Second nikolavp - Checkout, and mark the option to use the new project wizard, then select Qt project. I've done this (with ganymede) and it successfully finds everything and builds correctly.
My solution:
go to the svn-view and add the repository location for your project
check out the project some temporary location with svn or any client you like
choose 'File->Import...' and say 'Qt->Qt project'
browse to the location of the *.pro file, select and hit the OK-Button
you are in the game with an appropriate Qt-project and Subversion Access for that project
I would say the same as the last one,
but instead of the two first steps I would set up the Qt-Eclipse integration:
Qt-Eclipse integration before looking for the *.pro file.