How to show only important file in project explorer in eclipse CDT - eclipse-cdt

After evaluating multiple IDE's for cross platform C++ development (Code blocks, CLion, CodeLite, QTCreator, KDevelop, NetBeans) I thought of sticking to eclipse CDT as it was the only one that gave a good user experience apart from CLion, UNTIL I wanted to filter out all unwanted files that are shown in the project explorer. I know I can filter them out using project properties by adding multiple inclusions and exclusions, but is there a simpler way like editing a text file where I specify a comma separated list of inclusions and exclusions? And more importantly, how do I do that for all projects in the work space? The current GUI based way takes time, confusing and I dont know how to do that for all projects. After-all, users of Eclipse CDT are developers and they really dont need a dialog based work-flow to do this.

Related

Eclipse CDT update/sync project list automatically (to easy "refresh" related project set)

Historical context:
We have a project consisting of following parts:
Host application (C++)
Scripting Engine library (also written in C++)
A lot of C++ plugins (around 30+)
A lot of scripts that tie all the stuff together...
From version to version some plugins are added and some are removed.
Till now we used Visual Studio solution (*.sln) to contain all the projects (*.vcxproj) for Host application, Scripting Engine library and plugins (one *.vcxproj per plugin!).
To share sources/projects we use proprietary source control system, and till now once we merged updates from the server (some plugin projects are added and some plugin projects are removed) all the project tree in the VS were refreshed thanks to "reload" feature (no action was required from developer to see and build updated source tree).
The problem:
Now our senior management decided to switch to Eclipse CDT/MinGW pair and we faced the issue that Eclipse Workspace is not the same thing as Visual Studio *.sln ...
Now when some plugin project folder appears or some plugin project folders disappears corresponding workspace items do not update accordingly.
Thus from now every developer has to use File>Import...>General>"Existing projects into workspace" File/"Open Projects from File System" to add new projects to own Workspace manually once they were added by other developer to the source control.
Also one has to manually remove from own Workspace those plugin projects that were deleted from source control...
This is a great contrast with what we previously had with Visual Studio where "reload" feature automatically updated project/source tree (just bacause all the information arrived with *.sln/*.vcxproj from server).
Our first option was to place Workspace\.metadata etc stuff to source control (as we previously did for *.sln files) but "that is not the way how Eclipse Workspace is designed to be used" (this is even not possible just because paths in .metadata\* are absolute and tons of Workspace\* stuff it is not mergeable at all)
Question:
Is there some way to automatically syncronize Eclipse CDT Workspace with project set obtained from source control. Like just press some (hidden?) magic "refresh" button (in special plugin to install or something like that) and all the new projects will be automatically added to the source tree in the Workspace and deleted projects will also disappear automatically, wothout need to use all those "Import" wizards, and withot need to remove deleted projects manually?
May be there is a special "Container" project type in Eclipse to play the same role as *.sln did in Visual Studio or something like that?
May be other options available?... Overall intention is not in replacing *.sln by some Eclipse equivalent but to support similar workflow when bunch of plugin projects is managed as a whole and project set "refresh" to be simple operation that does not require from each person in the team to manually track projects appeared/disappeared in that set.
Have you looked at using CMake to generate the Eclipse project files? You can then import those into an Eclipse workspace.
Its not automatic, but if you create separate CMakeLists.txt files for each part, then you can easily comment the include of that part in the main CMakeLists.txt file and regenerate the project files when you only want to load subset of the project.
https://cmake.org/Wiki/Eclipse_CDT4_Generator
Should you ever want to change back to VS or to another IDE CMake can generate project files for that too.
I've personally only used CMake to generate VS-solutions and Unix make files so I can't vouch for how well this works.
HTH.
On side note, why did management decide that Eclipse should be used instead of Visual Studio? It sounds like a poor decision without factual grounds or impact research prior to the decision being made.
Was it because Eclipse is free? Did they consider what reduced developer productivity costs?

Xcode support for C++

I try to use Xcode (v.7.3.1) for my C++ project (build system - make), but the experience is quite poor (and it was always like that since old versions like v4 when I started using it) - code completion doesn't work, color syntaxing works oddly (no coloring sometimes, or partially colored code), no "jump-to-definition" functionality, can't switch b/w header/source files with shortcuts. Basically, it's just a text editor where I have to use "Find" and Cmd+Shift+O all the time.
Is this intentional and Xcode will never get any proper support for C++ projects with external build system (make) or am I misconfiguring my project? How can I re-index files in the project? How can I make code completion work?
Thanks,
I believe there is a way to use Xcode with makefiles by adding an external build target, file->new->target->External Build System.
This is an older tutorial but the steps may be worth looking through: http://web.ist.utl.pt/jose.alberto.coelho/mac/MakefilesXcode.pdf
I've never had a problem with the syntax highlighting, but I remember the refactoring support being limited for C++ in some ways.
So, I ended up using this workaround: even though, I use external build system, I create Console Application project in Xcode and choose C++ language in settings. Then, I simply add my source files to the project (just drag folders from the Finder window) and then manually create project targets of type External Build System as I need. I don't use default target and don't use generated main.cpp file at all.
My files get indexed with no problems. I'm also able to debug code as I used to.
I still think Xcode developers should review indexing process for the projects with external build system...
Thanks for all the insights though!

Eclipse : How to hide a file from Project Explorer?

I'm using the Eclipse IDE for C/C++ running on an iMac, OS X Yosemite.
In my C++ project, I want to hide certain files from the Project Explorer, YET they still be included in the project. I'm trying to run a series of tests for an empirical study I'm doing. Files I'm trying to hide are for test purposes and as such I don't want the participants to be able to see the contents of my test files.
I found the following StackOverflow thread, which does exactly what I want, except for the fact that when I do it, Eclipse excludes the files from compiling.
Eclipse: how to hide custom files in Project Explorer
How can I merely hide the files without excluding from compiling?
Thanks in advance!
W.r.t Project Explorer/Navigator view its not possible to merely hide the custom resources based on name patters.
Refer this post for more info : https://stackoverflow.com/a/2396496/1391924
However note that: In C/C++ Projects view you can hide resources based on your own file name patterns.
Refer this help.

what is required to get intellisense for Gtkmm using editor Geany!

i want to get the intellisense in GTkmm application, similarly as we get in dot net under windows. However this time i am using Linux, C++, Gtkmm and Geany as my editor. Please guide how to get the intellisense. Moreover, if any kind of editor supports the property of intellisense, please mention that also.
Thanks and Regards
Owais Masood
Geany automatically indexes your open files for auto-completion, but if you want it to index some library or API, you have to create a global tags file like it describes here in the documentation. I have had mixed results getting this to work completely and correctly though.
I used to use Geany on Linux, but I have moved to QtCreator. Even though it has an emphasis on Qt, you can use it on any C or C++ project (you just have to specify your own build process or do it outside the IDE). The editor is one of the best I've used on Linux and the autocompletion works great without a whole lot of configuration. Also check out my answer here on how to set the include paths. Anything in the include paths will be indexed for autocompletion automatically.

C/C++ editor that can create projects from lists of files

I recently asked a question about importing from a list of source/header files in Eclipse
I haven't found a good solution to this, so I thought I'd check out other IDEs. I want an IDE that does not need to "own" everything from a top directory and down. When creating a new project I want to have a text file that lists source/header files (autogenerated by the build tool), and have the IDE create a project with those files. The only IDE I know of that does this is SlickEdit, which is great, but also rather expensive. Do you know of any other IDEs that have this feature.
Eclipse wants to own everything in the directory I pointed it to, and I haven't found a way to remove subfolders afterwards (to exclude them from search, indexing and annoying me).
I think CMake can be helpful for you.
Emacs does all this, and more. The desktop feature lets you store a set of files to load and save in a working directory, and the Emacs Code Browser (ECB) extension has support for browsing files and classes, and managing projects. It doesn't own anything, Emacs just gives you lots of tools to manipulate text in godly ways. Along with ECB, SpeedBar and a few other extensions, CEDET is an Emacs "meta"-extension which turns the venerable editor into an IDE. It even does UML!
Emacs IDE: CEDET
Code::Blocks can do this for you.