For example, you receive the following message:

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures 
are deprecated, and may be removed in a future release 
(Use -Wno-deprecated-gpu-targets to suppress warning).

So, how do you do this with CMake?

Just add the following line to your CMakeLists.txt:


But if you want, for example, turn on warnings for the return of a function (“control reaches end of non-void function” type of error, for example), just add: