justadudewhohacks / npm-opencv-build

A simple script to auto build recent OpenCV + contrib version via npm
43 stars 57 forks source link

Added CUDA cmake flags to opencv when CUDA is found on the host machine #32

Closed jclaessens97 closed 5 years ago

jclaessens97 commented 5 years ago

In relation with this issue I added cmake flags to support CUDA in opencv. I'm not sure autoinstall of cuda in the script is possible. Either way there should probably be an option to choose if you want to use CUDA or not since the build takes much longer with CUDA and this implementation is just naively checking if CUDA is installed, but should be good to get things going I think.

If you have any suggestions or any remarks, please let me know :)

justadudewhohacks commented 5 years ago

Thanks for the PR! In general this looks fine to me. However, I would prefer to also check for an environment to be set, such as OPENCV4NODEJS_BUILD_CUDA or something. Otherwise it won't be possible for users to prevent the auto build script from building opencv with cuda, if cuda is found on the system.

jclaessens97 commented 5 years ago

Yeah I reckon there was something needed to do that, didn't know/saw how it was done :) I added it in the PR!