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