TMVA Conditional Compilation

Dear Experts,
I’m in the need of producing a code that uses TMVA and is able to be run on ROOT v5 and v6.
Since the TMVA API has changed I was thinking about a conditional compilation of the code so that I do not have to apply twice the same changes in the codes.

Something like

#if RootVersion > XX,YY,ZZ
Compile this stuff here with the data loader
#else 
Compile this other stuff
#endif

So my questions are the following:

  • How can I retrieve the root version in order to do this ?
  • When has the API changed ?

Cheers,
Carlo

#if ROOT_VERSION_CODE > ROOT_VERSION(XX,YY,ZZ)

Thanks,
do you also know the XX,YY,ZZ values when the API has changed?

If I remember correctly, the change was in 6.08 (= first version with new API).