A variable -DSOLAXFLUX will serve to enable/disable the library linking into REST, by default it will be ON. Basically we need to encapsulate the code under CMakeLists.txt. And add this line ——>
set(excludes ${excludes} TRestAxionSolarModel)
in case SOLAXFLUX is OFF, so that TRestAxionModel is excluded from compilation. This is the same approach as in connectorslib.
If anyone experiences issues compiling solarAxionFlux but wants to use other parts of axionlib, magnetic fields, optic response, likelihood analysis, it will be possible this way.