PDA

View Full Version : questions about setting the global include path that could be used in every project



openxmpp
1st August 2012, 10:39
Hi ,administrator.
Recently I am using QT Creator to develop some applications. I Want to set the include path and library path for all projects i created.
For example , i usually needs to use the boost library , currently i have to add the library path and include path while i am creating a new project, when the project is huge, this seems a little boring.
Is there one way to set the include path and library path that could be applied for all the projects?
I tried eclipse for C++ version,it seems that eclipse will auto load the CPLUS_INCLUDE_PATH defined in .bashrc.
Can QT Creator do this ? If it can ,how could i set it ?

openxmpp
3rd August 2012, 06:54
no body knows?

spirit
3rd August 2012, 07:31
Well, as for libs you can always use LD_LIBRARY_PATH (for Linux) and DYLD_LIBRARY_PATH (for Mac).
As for includes you can create your own system variable which will contain path to includes. Then you can use this variable in your pro-file. Something like this:
pro-file


HEADERS += ...\
$$(MY_INCLUDE_PATH)/myheader.h
...

in QtCreator project's settings you should declare this variable or export it from command line (export MY_INCLUDE_PATH=~/projects/mylib/include) and then run QtCreator.