Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Subprojects give me grief when using cmake
Subprojects give me grief when using cmake [message #899936] Fri, 03 August 2012 05:22 Go to next message
Chris Stankevitz is currently offline Chris StankevitzFriend
Messages: 52
Registered: September 2011
Member
Hello,

I use cmake to create my projects. My build directory is "out of source". Cmake creates three "resources" in my project:
[Source Directory]: this is where my source is
[Subprojects]: I have no idea what this is for, but it also holds my source
[Targets]: Again, I have no idea what this is for.

Question: How do I tell Eclipse/CDT to never open a supposed "source file" from within the "Subprojects" resource?

Sometimes Eclipse's extremely useful F3 key takes me to a file in the bogus resource. Worse, I often do not realize what had happened and start editing them and eventually screw myself over.

Thank you!

Chris

[Updated on: Fri, 03 August 2012 05:57]

Report message to a moderator

Re: Subprojects give me grief when using cmake [message #900485 is a reply to message #899936] Tue, 07 August 2012 09:30 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1968
Registered: July 2009
Senior Member
Select the Subprojects folder in the Project Explorer. Right click to open the context menu. There select Properties. Go to Resources and enable the attribute "Derived".
Eclipse will then treat this folder as "automatically generated source code" and will ignore it for search results.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Subprojects give me grief when using cmake [message #903512 is a reply to message #900485] Fri, 24 August 2012 04:28 Go to previous messageGo to next message
Chris Stankevitz is currently offline Chris StankevitzFriend
Messages: 52
Registered: September 2011
Member
Axel,

Thank you for this tip. I have been using it for the past couple weeks. I like that I can mark a project "derived" and signal that it should not be used for source code editing. I do not use Eclipse's 'search' feature, but I do believe you when you say "derived" projects are excluded from search results.

An eclipse feature that I use (and love) is F3 also known as "Open Declaration". Sometimes (I'd say 20% of the time) using F3 brings me to source code in a "derived" project. I generally do not notice when this happens. However, if I attempt to edit the source code, Eclipse CDT interrupts me with a modal dialog: 'Are you sure you want to edit source code in a "derived" project?'

Question: Can I command Eclipse/CDT to never direct me to "derived" projects when performing an F3/Open_Declaration?

Thank you again for your help,

Chris

index.php/fa/11291/0/

[Updated on: Fri, 24 August 2012 04:31]

Report message to a moderator

Re: Subprojects give me grief when using cmake [message #903554 is a reply to message #903512] Fri, 24 August 2012 09:30 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1968
Registered: July 2009
Senior Member
Quote:
Question: Can I command Eclipse/CDT to never direct me to "derived" projects when performing an F3/Open_Declaration?

Derived folders are normally excluded from being indexed and thus F3 should ignore them. I guess you need to rebuild your index (context menu of Project and then Index->..) to get rid of them.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Subprojects give me grief when using cmake [message #948280 is a reply to message #903554] Wed, 17 October 2012 23:12 Go to previous messageGo to next message
Chris Stankevitz is currently offline Chris StankevitzFriend
Messages: 52
Registered: September 2011
Member
Axel Mueller wrote on Fri, 24 August 2012 05:30

Derived folders are normally excluded from being indexed and thus F3 should ignore them. I guess you need to rebuild your index (context menu of Project and then Index->..) to get rid of them.


Unfortunately this is not the case. I filed a bug report here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=390964

Chris
Re: Subprojects give me grief when using cmake [message #948782 is a reply to message #948280] Thu, 18 October 2012 11:18 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1968
Registered: July 2009
Senior Member
In Project Properties->C/C++ General->Paths and Symbols you can define the Source location (default is the whole project but you can exclude subfolders). The indexer will only have a look at these folders.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Subprojects give me grief when using cmake [message #949278 is a reply to message #948782] Thu, 18 October 2012 21:39 Go to previous message
Chris Stankevitz is currently offline Chris StankevitzFriend
Messages: 52
Registered: September 2011
Member
Axel Mueller wrote on Thu, 18 October 2012 07:18
In Project Properties->C/C++ General->Paths and Symbols you can define the Source location (default is the whole project but you can exclude subfolders). The indexer will only have a look at these folders.


Axel,

This seems to work! I cannot tell you how happy this makes me! Thank you!

I filed a cmake bug to encourage them to change this setting:

http://public.kitware.com/Bug/view.php?id=13596

Thank you!

Chris

[Updated on: Thu, 18 October 2012 21:40]

Report message to a moderator

Previous Topic:Console Input under windows / use windows console
Next Topic:Double click on error in console does not jump to error
Goto Forum:
  


Current Time: Thu Nov 27 19:51:36 GMT 2014

Powered by FUDForum. Page generated in 0.10129 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software