This is starting to look like duplication. IMO, what you should do here is:

1) Keep these blocks as they were, except instead of `OpenCV_EXTRA_LIBS_${__opttype}`, append to a temporary list (e.g. `OpenCV_CUDA_LIBS`).
2) Do a `foreach` across `OpenCV_CUDA_LIBS`, storing the paths in e.g. `OpenCV_CUDA_LIBS_PATH`.