Author Topic: Sharing compiler search directories between 3 projects  (Read 4739 times)

Offline 16BitBilly

  • Multiple posting newcomer
  • *
  • Posts: 13
Sharing compiler search directories between 3 projects
« on: April 21, 2015, 07:59:35 pm »
I currently have about 10 projects in my workspace. Some projects have a lot of paths added in "Compiler search paths". I wanted to know if there was a way i could tell another project to use the same compiler search directories a specific project is using. That way I will not have to type in all the header search paths again for that project. I know I could do this globall in settings >> xompiler search directories tab but then I dont want those paths available to all the projects that  I wouldnt even mind if there was a way for me to copy paste search paths (even if I have to do that in an xml file).

Offline Chun Jiu

  • Multiple posting newcomer
  • *
  • Posts: 71
  • My Girlfriend
    • EasilyGCC
Re: Sharing compiler search directories between 3 projects
« Reply #1 on: April 21, 2015, 08:41:38 pm »
I usually use a text editor to open the *.cbp files, copy these options.

Code
<Target title="Debug">
<Option output="bin/Debug/TestBitmapButton" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="0" />
<Option compiler="gcc" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="-g" />
<Add option="-D__WXDEBUG__" />
<Add directory="$(#wx)/lib/gcc_lib/mswud" />
</Compiler>
<ResourceCompiler>
<Add directory="$(#wx)/lib/gcc_lib/mswud" />
</ResourceCompiler>
<Linker>
<Add library="libwxmsw30ud.a" />
<Add library="libwxpngd.a" />
<Add library="libwxjpegd.a" />
<Add library="libwxtiffd.a" />
<Add library="libwxzlibd.a" />
<Add directory="$(#wx)/lib/gcc_lib" />
</Linker>
</Target>

Note - For example: <Add directory="$(#wx)/lib/gcc_lib" /> Copy to another .cbp file.
« Last Edit: April 21, 2015, 08:49:18 pm by Chun Jiu »
I love my girlfriend like c++!    :-)

http://pan.baidu.com/s/1feNwU
easilygcc is a gmail's email.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Sharing compiler search directories between 3 projects
« Reply #2 on: April 21, 2015, 09:38:53 pm »
Way easier: create a copy of the compiler you are using. Then add all path and settings as needed for ask of your projects to the compiler settings. Then reference this compiler in your project.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Sharing compiler search directories between 3 projects
« Reply #3 on: April 21, 2015, 09:42:06 pm »
Project files are not meant to be edited by hand. If you do so, very bad things including crashes can happen. Don't do this. For all operations we have ui, scripting or similar support trough plugins.

To mass manipulate project settings you could also use the project options manipulator plugin.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline 16BitBilly

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Sharing compiler search directories between 3 projects
« Reply #4 on: April 21, 2015, 10:33:09 pm »
Thanks for the post could you tell me a little  about the project options manipulator plugin.
Any links ?

Offline Chun Jiu

  • Multiple posting newcomer
  • *
  • Posts: 71
  • My Girlfriend
    • EasilyGCC
Re: Sharing compiler search directories between 3 projects
« Reply #5 on: April 22, 2015, 05:40:24 am »
Project files are not meant to be edited by hand. If you do so, very bad things including crashes can happen. Don't do this. For all operations we have ui, scripting or similar support trough plugins.

To mass manipulate project settings you could also use the project options manipulator plugin.

Sorry, I should not be recommend others do the same.

Yes, the project files easily damaged, C::B will collapse ......
But there is no other method is faster than it.
Copy the backup of *.cbp files before be edit by hand.
I love my girlfriend like c++!    :-)

http://pan.baidu.com/s/1feNwU
easilygcc is a gmail's email.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Sharing compiler search directories between 3 projects
« Reply #6 on: April 22, 2015, 11:05:46 am »
Thanks for the post could you tell me a little  about the project options manipulator plugin.
Any links ?
Its distributed with recent nightlies. Just run it through the plugins menu.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline teto

  • Almost regular
  • **
  • Posts: 127
Re: Sharing compiler search directories between 3 projects
« Reply #7 on: April 22, 2015, 03:50:52 pm »
I've never used "profiles" but that may come in handy too (though MortenMacFly's solution looks the best)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Sharing compiler search directories between 3 projects
« Reply #8 on: April 22, 2015, 08:48:40 pm »
I've never used "profiles" but that may come in handy too (though MortenMacFly's solution looks the best)
Indeed, profiles are another option: This would mean you don't make copies of compilers, but just use a different profile for a different set of projects.

Profiles are easy to use:
- Just make a link to the C::B executable and add a parameter "-p [profile_name]" (w/o quotation marks and brackets)
- This creates a (new) profile file named "profile_name.conf"

The drawback is, that all settings are copied and become independent, so for example editor and colour settings as well.
If you want to re-use your current settings, just copy the default profile file (default.conf) to [profile_name].conf before you run C::B with the "-p" parameter.

More information can be found in the C::B manual.

More information about command line options available are with the help (/?) parameter and (again) in the manual.

Yes, the project files easily damaged, C::B will collapse ......
Well again: Don't do this and C::B won't collapse.

But there is no other method is faster than it.
Sorry, but I strongly disagree. I think with the options and plugin mentioned you can very fast adopt / harmonise multiple projects at once... and we did't speak about scripting so far...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ