Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: eranon on April 10, 2013, 12:53:24 pm

Title: How to configure output directory of CCCC plugin ?
Post by: eranon on April 10, 2013, 12:53:24 pm
Hello. Is there a simple way to indicate the output directory used by the CCCC plugin ? The default one is "<project_dir>/.cccc" and I would like to go with "<project_dir>/analysis/cccc" because I'm using several metrics tools and have added the "analysis" subdirectory in my SVN/Git ignore lists.
Title: Re: How to configure output directory of CCCC plugin ?
Post by: oBFusCATed on April 10, 2013, 01:36:30 pm
Read the source...
Title: Re: How to configure output directory of CCCC plugin ?
Post by: eranon on April 10, 2013, 03:36:08 pm
OK, no problem to look at the source, but it's not a reply Obfuscated. When you have an answer and someone look for, the easiest way is to give him... It's the way I go when I see someone looking for answer I have. Anyone (any dev, I mean) is able to browse source, but, sometime, you have no time (and it's the reason why of my question here).

Well, I take 5 minutes to do it (maybe it will help someone else a day)... Here is what the code shows :

CCCC is launched from :
Code
wxExecute(CommandLine, Output, Errors);

with command line being :
Code
wxString CommandLine = m_CcccApp + _T(" ") + ListOfFileNames.Trim();

So, we see that not any output location is explicitely indicated, and it falls in the default CCCC one... At the end of the process, we see that the plugin just look at the produced report in an hardcoded path :
Code
const wxString FileName = _T("./.cccc/cccc.html");

So, unless mistake, I can conclude there's not any provided way to configure the outdir option of CCCC, unless patching the plugin...
Title: Re: How to configure output directory of CCCC plugin ?
Post by: oBFusCATed on April 10, 2013, 04:45:16 pm
If I knew the answer, I would have answered you directly.
I had just wild guess that it is not possible and I had to read the source in order to find out 100%.

So this was a question of wasting my time or wasting your time. I have no interest in CCC, so you've got the answer. ::)
Title: Re: How to configure output directory of CCCC plugin ?
Post by: eranon on April 10, 2013, 05:27:27 pm
OK, so sorry for the wrong interpretation, Obfuscated (I'm a little bit nervous these days)... Well, unless patching the source to hardcode a new outdir path, or provide a conf dialog, or use an ini file under %appdata% (talking about Windows), I didn't found a way with the CCCC plugin.

So, I've taken a look at the other side (the CCCC one), hoping it could exist an environment variable about default outdir... But, no ! So, of course, again, I could rebuilt cccc.exe since it's open source... But, rhâaaa, not now.

Finally, awaiting a better/smarter way, I've disabled the plugin (not uninstalled, I'll be back) and added an entry in the C::B's Tools menu, launching :

Code
"C:\Program Files (x86)\CCCC\cccc.exe" --outdir="analysis\cccc" *.h *.cpp

Of course, with ${PROJECT_DIR} as working directory.