how to configure kdevelop projects toolbar to hide certain files? - kdevelop

I have a project that usues autotools and I also need coverage reports by gcov, which generates files in the same folders where the sources are.
My problem is that my "Projects" toolbar shows all .gcno files and all make targets (which would be about 30 per folder).
Is there any way to configure kdevelop not to show all make targets and not to show files with certain extensions (e.g. .gcno files)?

KDevelop 4.6 has a feature that allows exactly that:
http://milianw.de/blog/kdevelop-project-filters
You can add *.gcno as project filter and those files won't show up on the Project View.

Related

Preprocessor Include Paths, Macros etc. entry not available

I can't navigate through a project in Eclipse (Oxygen.3a Release (4.7.3a) with CDT version 9.4.3.201802261533). The project is built successfully but I can't trace back many functions using ctrl+LMclick.
I tried fixing the problem from online resources, but many suggested modifying the entry of Preprocessor Include Paths, Macros etc, which my project does not even have. What is the reason behind this and how do I fix it?
For some reason, the next entry (C/C++ Include Paths and Symbols) shows that |Include path not found"
When I try to trace a function, I get the "Could not find symbol "xyz" in index". I have already tried rebuilding the indexer but it did not work for me.
In my experience, the absence of the Preprocessor Include Paths, Macros etc. preference page happens in newer versions of CDT when you select the new Makefile Project option in the new project wizard, whose description is
(Experimental) Create a new project that builds with the 'make' build
tool using CDT's new Core Build System.
I would avoid using this as it's experimental, and would select instead C Managed Build (or C++ Managed Build). On the next wizard page you can still make it a makefile project if you want.
I ran into this problem trying to use cmake4eclipse. I forgot to heed the warning in the help file, which explicitly state:
"Do not choose the New C/C++ project wizard, as that will take you down the road of CDT`s new project type (which has poor cmake support)."
What this means is that, for the entry to appear in an executable / library -type project (not Makefile project), you have to do this now:
File --> New --> Other...
Choose "C++ Project" (not "C/C++
Project") under the C/C++ category:
P.S. Also, I had to remake the folder and copy all the sources there, i.e. when I tried the old wizard on top of a "deleted" project, something didn't override correctly and I was still missing "Preprocessor Include Paths, ...". Deleting .cproject and .project files within the folder before recreating works too.
Depending on your project, you may need to include the path of the toolchain manually. It wasn't for me. So for my project I did the following:
Go to Project – Properties – C/C++ Include Paths and add there “C:\Program Files (x86)\GNU Tools ARM Embedded\5.4 2016q3\arm-none-eabi\include” (change to fit your installation). Then refresh, clean and build the project. Finally, rebuild the indexer and this should work.

Eclipse: C project folder structure

I have an existing C project with the following folder structure:
bin
proj
src
inc
doc
conf
When i launch Eclipse and create a new project the root project folder is polluted with:
.cproject
.project
Also the parent folder with:
.metadata
RemoteSystemsTempFiles/
A want to continue use Eclipse as an C IDE with a my custom makefile (or not) but I want all Eclipse related files and folders to be put inside the proj directory. I need Eclipse to debug ARM targets.
Is it possible? If not what is the next best thing?
I made a promise to myself to start a smooth transition from IDEs to vim with a custom makefile. I still need Eclipse to help me for debugging.
One step at a time...
The files .project and .cproject (and the .settings folder if it exists) contains the Eclipse-specific (general and C/C++) project configuration.
The .metadata folder is a kind of cache/temp folder (to store error/warnings markers, local file history, etc.) and also used to store your workspace preferences (most of Window > Preferences).
Files in a project are tracked and can cause changes in the .metadata folder. If the .metadata folder would be located in a project, this could end in an infinite loop.
You could use the workspace folder of Eclipse (which contains the .metadata folder) as part of your overall project folder and link instead of copy all files and folder that you want to see in Eclipse or that are required by Eclipse into your Eclipse project (you can also mark some files and folders as derived to stop them from being tracked and to make them less visible in Eclipse).
Note, do not share or move the .metadata folder (and derived resources). In contrast, .project, .cproject and .settings are intended to be shared.

Versioning absolute paths in qt .pro files

lets say i have a qt project file (*.pro) and related files under a versioning system (git). The project is multiplatform and developing is performed on a lot of different ones as well. Developmers are both progrmmers and not programmers (matematicians, ecc) so i'd like to keep things as easier as possible for the person who cloned it (eg: avoid env variables).
The project is dependent on other projects whose are in an non-standard folder in the developer platform.
So i need them to edit the project file INCLUDEPATH += "absolute-path-to-external-stuff"
Problem is i'd like to put this single line in a file to be included in the .gitignore (remove it from versioning once uploaded) so that one can freely edit it without editing others when pushing to repo.
Should i use .pri files (and how? it seems they only are ok in subdirectories, cant find a reference) or is there a better pattern?
You can use a .pri file for that — a .pri is just a file that gets include()d by a .pro file.
Create a file in the project root called config.pri, containing the INCLUDEPATH addition
Add include(config.pri) to your main project file
Add the config.pri to your .gitignore
In the long run, you might consider using pkg-config to manage dependencies, since it integrates nicely with qmake.

Building a multi module C project (i.e. solution) with Eclipse CDT

I am moving from Netbeans to Eclipse (on Ubuntu 12.0.4). I have a C application that consists of several sub projects which are libraries (shared and static), as well as stand alone executables.
I can't figure out how to create a 'parent' project foo, which contains component projects
foobar
foofoo
barfoo
barbar
Ideally, I want all the 'component projects' to be created under the folder foo, so that I have a directory structure like this:
/path/to/foo/foobar/ (contains foobar project files)
/path/to/foo/foofoo/ (contains foofoo project files)
/path/to/foo/barfoo/ (contains barfoo project files)
/path/to/foo/barbar/ (contains barbar project files)
Does anyone know how I can achieve this structure using Eclipse as IDE (with CDT)?
Last but not the least, I intend to create my C modules using the Autotools option. Will the generated files for Autotools be automatically updated as I add new header/source to a module - or do I need to manually maintain the Autotool files?
Friend,
I think there is no the "parent" C project. You can create a normal C project in IDE and add all dependencies into sub-folders. Then tell compiler your build procedure via Makefile. I think it's easy way as you have had experience on C application.
About autotools, once you update/add/remove your project file, I think you need to modify your Makefile to reflect your change and do clean and rebuild your project.
For other C build tools, you can use buildroot if you'd like.
The best way I can think to do this in eclipse is to create a separate workspace for the project e.g. foo, and then add the sub-projects (foobar, foofoo, etc...) as projects. This is generally a better approach to take with eclipse, instead of a single monolithic workspace. I don't know what the specific dependency structure for the sub-projects looks like, but you should be able to express it simply by using eclipse project properties. This can include a rollup executable sub-project that depends on the libraries.
Unfortunately, I'm not sure if eclipse cdt will maintain autotools files. However if not, it should be relatively easy to integrate and use some of the autotools binaries such as autoscan, and autoheader into the eclipse build commands.
At first you need to a working directory, Then you should new project, Then per file or per class (according to C++ or C ) append your files, it's much safe way. another way is not clean, i have experience. don't use them.

Add external source files from a library to the project in Eclipse-CDT

I have a project which I try to compile with Eclipse-CDT. The project depends on a library with header files and source files. How can I configure the project in Eclipse such that it will compile the needed source files from the library with the project?
With a makefile I use:
SRC+=lib_source.c
You can add linked source file.
Choose project properties and in the left panel choose c++ general.
Under it choose path and symbols.
Now in the right panel tabs choose source location and add linked source folder.
Include you need to define in "include" (under c++ build you will find settings)
Another approach is to use the operating system to add your libraries to the project. Eclipse then treats all source files (including library files) as part of the project, and therefore compiles any that need it even if they are in the libraries. This set-up allows keeping the library sources in a separate git repository from the project source code. You can record the git commit of a library to provide library version control so that improving the library in one project does not break all the others. The setup relies on the operating system's capability to link directories in a way that is entirely transparent to eclipse--in windows using the mklink command.
In windows the steps are
put your library files in a clean workspace not mixed with .git (you can have .git in the parent directory as egit sets it up)
use cmd window in administrator mode to add a link from your project directory to your library directory.
from eclipse press F5 t make sure your project matches what is on disk, then set up git to ignore your library directory.
set up your library file properties for read only access unless you are still tweaking that library.
set up your project include path to include the project sub-directory in your project.
I can't remember why I abandoned eclipse linked directories; i think it was that the includes kept breaking. The mklink approach has worked flawlessly so far.
I have a pdf tutorial of how to set this up--but I'm new to the forum and don't see how to attach a file.

Resources