Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Setting Include path based on target OS
Setting Include path based on target OS [message #653191] Tue, 08 February 2011 19:18 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: February 2011
Junior Member
Hi,

I am new to this forum and this is my first post, so please bare with me.

My project runs on two different operating systems (Linux & Mac OS) and it requires some third party libraries to be included, and compiled version of those is different for every OS. Is there any way I could include those libraries based on some variable which can differentiate target OS.
For example if I can define target OS somewhare like
OS = getTargetOS();
<option id="gnu.cpp.compiler.option.include.paths.1409277852" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
if($OS="mac") {
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/libs/openssl/mac/include}&quot;"/>
}else if($OS="linux"){
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/libs/openssl/linux/include}&quot;"/>
}
</option> 


Or if there is any other way I could include libraries, right now every new checkout requires configuring include paths and I am trying to avoid it. Please help.

Thanks a ton for help and support.
Re: Setting Include path based on target OS [message #653229 is a reply to message #653191] Tue, 08 February 2011 21:59 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: February 2011
Junior Member
Would something like this sounds like a good thing?
<option id="gnu.cpp.compiler.option.include.paths.1409277852" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/libs/openssl/${HostOsName}/include}&quot;"/>
</option>

Re: Setting Include path based on target OS [message #653279 is a reply to message #653229] Wed, 09 February 2011 08:11 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
You can define different build configurations for Linux and Mac.
Or you can try to use the Eclipse variable ${OsType}


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:how to set predefined variable to project?
Next Topic:Remote build makefile - no rule to make target
Goto Forum:
  


Current Time: Sat Apr 27 02:56:08 GMT 2024

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

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

Back to the top