Do you mean to replace this line to `set(OpenCVModules_TARGETS "" CACHE INTERNAL FORCE)`?

It is a normal practice to use cache variables as a globals variable in cmake (especially with `INTERNAL` type), so I believe that additional warning are useless.