Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: rufeo on March 13, 2007, 10:32:41 pm
-
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 (http://wiki.codeblocks.org/index.php?title=FAQ#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F) 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!
-
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.
-
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.
-
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]