Author Topic: How to configure output directory of CCCC plugin ?  (Read 7600 times)

Offline eranon

  • Almost regular
  • **
  • Posts: 180
How to configure output directory of CCCC plugin ?
« 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.
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to configure output directory of CCCC plugin ?
« Reply #1 on: April 10, 2013, 01:36:30 pm »
Read the source...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: How to configure output directory of CCCC plugin ?
« Reply #2 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...
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to configure output directory of CCCC plugin ?
« Reply #3 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. ::)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline eranon

  • Almost regular
  • **
  • Posts: 180
Re: How to configure output directory of CCCC plugin ?
« Reply #4 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.
[Independent dev. - wxWidgets 3.0.0 under "Win 7 Pro 64-bit, C::B SVN 9435 & wxSmith, TDM64-GCC 4.7 & MSVC9" + "OS X 10.8, FSF GCC 4.7 & C::B SVN 8909"]