News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

search directories using environment variables

Started by rufeo, March 13, 2007, 10:32:41 PM

Previous topic - Next topic

rufeo

I would like the change the search directories in my codeblocks project file, but I want them to use environment variables rather than a path defined by the project creator.  The FAQ has a topic about setting the search directories on projects, but it does not say how to use environment variables on projects in place of that path.  How can I do this?  In MSVC, the format is $(MY_VARIABLE).  So, I would like to be able to open the search directories section of my project and see environment variables in place of the paths to the dependency folders, like $(CPPUNIT_INCLUDES) rather than "../../dependencies/CppUnit/include".  Thanks!

MortenMacFly

Quote from: rufeo on March 13, 2007, 10:32:41 PM
like $(CPPUNIT_INCLUDES) rather than "../../dependencies/CppUnit/include".  Thanks!
Why don't you just do it? The syntax is exactly like that. ;-) BTW: More advanced and with improved usability are global variables. They are being used with a "#" (sharp) instead of "$". Look in the WiKi here: http://wiki.codeblocks.org/index.php?title=Global_compiler_variables
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

rufeo

Oh I tried this, trust me, it doesn't work for me.  In a shell, I can type:
> ls $(CPPUNIT_INCLUDES)

and it prints out the right header files, but in Codeblocks, using that syntax does not let my program compile.  I am using build SVN 3652.

MortenMacFly

Well I just tried (r3693) and it *works* here. I have attached an image that shows where I setup things. I have used the Temp variable that is available on every system (type "set" or "env" at a command prompt to see). As the image shows this gets expanded to my Temp directory and is added as (sense-less) include folder to the compiler options. On linux you may have to "backtick" this expression but I doubt this is really required...?!
With regards, Morten.

[attachment deleted by admin]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]