0

I am using KDevelop 4.7.1 on OpenSUSE Leap Linux, and I'm trying to figure out why both the main.cpp and test.cpp files are shown TWICE in my project, once in the root note and once inside the launch configuration.

I am aware that the test inside the test below is a launchable executable but what I don't understand, besides why anyone would want this, is how can I hide the duplication (other than just closing the tree view) or even completely hide the launch configuration node since it seems useless and confusing. Did I make a mistake when making this project able to launch? I just created a new Qt project, tried to build and execute it. Other IDEs, even earlier KDevelop versions, I think, did not show all my files twice like this.

If there is a configuration option in kdevelop that will just hide the launch targets, since I only ever want to have one, that would be great, or any option that can hide the .cpp files so they don't appear under the launch configuration, I'd like to know how to do that.

kdev 4

Warren P
  • 65,725
  • 40
  • 181
  • 316

2 Answers2

1

The highlighted "Test" comes from the CMake target defined. In Your CMakeLists.txt you have something like

add_executable(test main.cpp test.cpp)

So the inner "Test" only shows the sources files related to this target.

MatzZze
  • 391
  • 1
  • 7
  • Is that optional? Do I have to have this target to be able to run my Qt4 app? – Warren P Oct 20 '16 at 00:55
  • If you want to create an executable then it must have such target type. I don't think that you can't hide them. (I never found such option) – MatzZze Oct 20 '16 at 01:00
  • Okay. I guess this just feels weird because other C++ IDEs don't look and work this way. – Warren P Oct 20 '16 at 01:01
  • I just installed KDevelop now and opened a project. You can right-click on the CMake target and then choose "Exclude Item From Project" and then it should be gone. KDevelop was always ... special ;) – MatzZze Oct 20 '16 at 01:07
  • I tried that also but when I exclude it, it won't build the target when it's excluded. – Warren P Oct 20 '16 at 11:02
1

Note: KDevelop developer here.

Starting with KDevelop 5.0, a toggle was implemented which allows to show/hide those CMake targets. There's now a "Show Targets" toggle inside the project explorer toolbar.

More info: https://mail.kde.org/pipermail/kdevelop/2016-March/019030.html

kfunk
  • 2,002
  • 17
  • 25