Author Topic: CB .... nearly ready for dev team.  (Read 2689 times)

Offline grahamo

  • Multiple posting newcomer
  • *
  • Posts: 17
CB .... nearly ready for dev team.
« on: April 22, 2011, 11:59:25 am »
Hi,

I'm about to expose the codeblocks dev environment to the rest of my team here. I have removed all hard coded dirs etc with global variables and such like. I need however to set global settings and have them used by the other users.

I cannot write into the codeblocks installation dir. Full stop :(

I see my global variables are used in my home dir;

 ~/.codeblocks/default.conf

Now I do not want other users to have to copy my conf over manually (or automatically). I could add a run_codeblocks.sh that copies my template/copy over to their dir the first time they run CB but I don't wan that.

What I'd like ideally is to do something like;

codeblocks --config file path_to_config_file.conf.


Is there any way to get CB up and running using a config file from the working dir (not the CB binary install dir)?

Environment variables could work, launch options could work. I want indeally to put the default.conf into our SVN repository once only so everybody uses it. Users can update the default.conf file if they like but their changes will be seen by everybody else as we all startup with the same file.

Anyways, let me know if this is feasible/possible.

thanks and have a nice day

Graham



Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CB .... nearly ready for dev team.
« Reply #1 on: April 22, 2011, 12:42:16 pm »
One problem in your scenario is, that C::B writes back the conf-file on closing, not while it is running.

So if user A opens C::B, then user B open C::B, changes something in the configuration and closes C::B.
All changes are now in the configuration-file, but now user A closes C::B, the changes will be overwritten by A's conf-files.
This can (of course) break B's configuration.

You can also store variables inside the project ("Build options -> Custom variables") ona per project or per target base.

Nevertheless, there is a workaround for the common conf-file problem (not really nice, but works here):
you can start C::B with different personalities (profiles) from console.
If your conffile is named theConf.conf and placed in /var/svn/projects/foo you can force theuse with the commandline (if C::B is in /usr/bin):
Code
codeblocks -p ../../var/svn/projects/foo/theConf

Or in general with the path to the conf-file relative to the users configuration directory or C::B's install directory (in my example /usr/bin) ending with the name of the conf-file without the ending.

I hope I was able to make clear what I meant.

It's surely not the most elegant way, but it should work.

You can also cd to the conf-files directory and call C::B with
Code
codeblocks -p ../../`pwd`/<name_of_conf_without_extension>