Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Different Defines in Different Folders(Different Defines in Different Folders)
Different Defines in Different Folders [message #720108] Mon, 29 August 2011 22:13 Go to next message
Steven R. Brandt is currently offline Steven R. BrandtFriend
Messages: 6
Registered: May 2010
Junior Member
I have a project that I'd like to use within CDT. One unfortunate thing is that it uses different defines in different folders, and so Eclipse can't show the right sections of code in #ifdef's. Is there some way to make Eclipse understand that different folders have different defines?
Re: Different Defines in Different Folders [message #720345 is a reply to message #720108] Tue, 30 August 2011 12:09 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
You must set up different build configurations. For each build config you can define source lcoations and symbol definitions.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Different Defines in Different Folders [message #720389 is a reply to message #720108] Tue, 30 August 2011 13:47 Go to previous messageGo to next message
Andrew Gvozdev is currently offline Andrew GvozdevFriend
Messages: 257
Registered: July 2009
Senior Member
You can set different defines in folder properties or even in file properties. Right-click on the folder -> Properties->C/C++ General->Paths and Symbols and select Symbols.

Andrew
Re: Different Defines in Different Folders [message #720708 is a reply to message #720389] Wed, 31 August 2011 06:03 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Andrew Gvozdev wrote on Tue, 30 August 2011 15:47
You can set different defines in folder properties or even in file properties. Right-click on the folder -> Properties->C/C++ General->Paths and Symbols and select Symbols.

Andrew

I did not know about this. Thanks for sharing.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Different Defines in Different Folders [message #720977 is a reply to message #720389] Wed, 31 August 2011 15:50 Go to previous messageGo to next message
Steven R. Brandt is currently offline Steven R. BrandtFriend
Messages: 6
Registered: May 2010
Junior Member
This mostly works. I find that when I open up the properties editor for a directory it doesn't always show the correct thing, but when I change the value and save it everything works. Thanks.

Is there a way that I can set these defines on directories from inside a plugin?
Re: Different Defines in Different Folders [message #721102 is a reply to message #720977] Wed, 31 August 2011 21:31 Go to previous messageGo to next message
Andrew Gvozdev is currently offline Andrew GvozdevFriend
Messages: 257
Registered: July 2009
Senior Member
There are a few ways but perhaps the easiest to explain is http://wiki.eclipse.org/CDT/Developer/FAQ#How_do_I_contribute_Include_.26_Library_paths_to_a_project_configuration.3F

Andrew
Re: Different Defines in Different Folders [message #721533 is a reply to message #721102] Fri, 02 September 2011 02:35 Go to previous messageGo to next message
Steven R. Brandt is currently offline Steven R. BrandtFriend
Messages: 6
Registered: May 2010
Junior Member
It seems I need a CExternalSettingProvider to do this, from package org.eclipse.cdt.core.settings.model.extension. This doesn't seem to be part of my installation, and I believe I have all CDT packages installed. Where can I find it?
Re: Different Defines in Different Folders [message #721761 is a reply to message #721533] Fri, 02 September 2011 19:05 Go to previous message
Steven R. Brandt is currently offline Steven R. BrandtFriend
Messages: 6
Registered: May 2010
Junior Member
Dopey me, I didn't notice the plugin example attached to the bug report. Thanks!
Previous Topic:Selection Highlighting on C Compare Viewer
Next Topic:Console output...
Goto Forum:
  


Current Time: Thu Sep 19 22:53:29 GMT 2024

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

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

Back to the top