Fix for ROOT-5782 (CMake)