Using VTK shared libraries in (CERN) ROOT

CMake will / can not be used.
I need to write a C++ interpreted macro which will “inject” the required “magic” into the ROOT’s C++ interpreter (that’s also the way I dynamically link VTK shared libraries on demand).
In principle, Linux and possibly macOS are my primary targets (same as what ROOT supports).

BTW. Is there somewhere any “detailed” technical description of how VTK initializes its modules?