visual studio environment error

when i try to use cmake to generate the visual studio sln project file with GPU, it shows error.
Error Cuda — build in 32 bits
i use visual studio 2019, if the cmake file is wrong?
thank you!

if(NOT _resultNVCC EQUAL 0)
	if(MSVC14.2 OR MSVC12 OR MSVC11 OR MSVC10 OR MSVC90 OR MSVC80)    
		set(ENV{PATH} "${VS_DIR}\\VC\\bin;C:\\Windows\\System32;${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}\\CMakeTmp\\")
		
		message("Visual studio express edition")
		
		execute_process(COMMAND "vcvars32.bat"  WORKING_DIRECTORY "${VS_DIR}\\VC\\bin")

		#message("Start process 32 bit") 

		if(EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/FoundCapa32.exe")
			#message("Found 32")
			execute_process( COMMAND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/FoundCapa32.exe"
							 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
							 RESULT_VARIABLE _resultNVCC OUTPUT_VARIABLE _outNVCC
							 ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)

		else()
			execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" "-m32" "-o=FoundCapa32" "${PROJECT_SOURCE_DIR}/src/uti_phgrm/GpGpu/tools/FoundCapa.cu"  "--run"		
					 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
					 RESULT_VARIABLE _resultNVCC OUTPUT_VARIABLE _outNVCC
					 ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)

		endif()
		#message(${_outNVCC}) 
	endif()

	if(NOT _resultNVCC EQUAL 0)		
		if("${CMAKE_GENERATOR}" MATCHES "Win64")
		    message("Error: 64 bits generation with cuda and visual express edition")
			message("2 options ")
			message("create with 32 bits generator")
			message("or")
			message("Copy the folder ${VS_DIR}\\VC\\bin\\x86_amd64 and rename x86_amd64 to amd64")
			message("Inside the new amd64 folder rename vcvarsx86_amd64.bat file to vcvars64.bat")
			message(FATAL_ERROR "64 bits generation with cuda and express edition")
		endif() 
		message( FATAL_ERROR "Error Cuda --- build in 32 bits" )
	endif()  
endif()

if(MSVC14.2)
	get_filename_component(VS_DIR [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\Setup\\VS;ProductDir] REALPATH CACHE)
elseif(MSVC12)
	get_filename_component(VS_DIR [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VS;ProductDir] REALPATH CACHE)
elseif (MSVC11)
	get_filename_component(VS_DIR [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH CACHE)
elseif (MSVC10)
    get_filename_component(VS_DIR [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir] REALPATH CACHE)
elseif (MSVC90)
    get_filename_component(VS_DIR [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;ProductDir] REALPATH CACHE)
elseif (MSVC80)
    get_filename_component(VS_DIR [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;ProductDir] REALPATH CACHE)
endif()

This doesn’t do anything useful. vcvars.bat scripts are meant to be used via call which works like source in POSIX shell. These operations require a shell environment (of which CMake is not).

You should use enable_language(CUDA) or project(myproj LANGUAGES CUDA) to enable CUDA support.

can you tell me if the vs2019 directory is correct?

I can’t make that determination, sorry. I only know the structure of VS when I’m poking around myself in in its install, so if it works, it might be right, but if it doesn’t it’s definitely wrong.