OpenCV compile static

Hi
I would like to compile opencv so that I do not have to remember about the .dll file. I still have a problem: how to make it so that I can use CUDA acceleration. I have already installed cuda-toolkit and I still don't know what to do. Thanks for any help