cmake generating only compute_10 and sm_10 code

I am compiling cpp and cu codes together using this command :

add_executable(objects_detection “./objects_detection.cpp”) .

all libraries are added then linked and it compiles well (without atomic functions) but showing this warning:
nvcc warning : The ‘compute_10’ and ‘sm_10’ architectures are deprecated, and may be removed in a future release.

Having compute_10 code generated I cannot compile cuda atomic functions.

I added both of these code lines separately and also together to cmake but I still get the same warning and it throws error when I comment out the atomic function (atomicAdd())

list(APPEND CUDA_NVCC_FLAGS “-gencode=arch=compute_20,code=sm_20”)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -arch compute_20 -code sm_20)

any help or hint would be appreciated
thank you