I have a question regarding the CUDA modules in OpenCV 3. Formerly in OpenCV 2 there was the opencv_gpu module and there was always a opencv2/gpu/gpu.hpp file in the include folder. It would be moved there during install whether OpenCV was built with CUDA or without. In the latter case however, CUDA functions would not be usable later in the code, which could be checked by invoking cv::gpu::getCudaEnabledDeviceCount() which would then always return 0. This way a program that used CUDA could be compiled with versions of OpenCV that were built with CUDA, as well as with ones built without CUDA.
In Opencv 3.0 the CUDA functions have been moved to the modules cudaarithm, cudaimgproc, cudafilters, cudawarping and so on. They are only available if you add the opencv contrib repository.
Now, I was creating a program that uses cuda. Then I realized, that when building and installing OpenCV without CUDA, meaining the machine does not support CUDA and the NVIDIA cuda toolkit is not installed, the header files for the CUDA modules are not copied into the include folder when installing. This way the program doesn't compile. How do you compile a program using the OpenCV CUDA modules with a build that was built without CUDA in OpenCV 3?