mirror of
				https://github.com/NVIDIA/cuda-samples.git
				synced 2025-11-04 15:47:50 +08:00 
			
		
		
		
	Copying input files into BINDIR so that these samples will run properly
This commit is contained in:
		
							parent
							
								
									e633580eff
								
							
						
					
					
						commit
						48e70c8b31
					
				@ -25,3 +25,17 @@ target_compile_options(simpleTexture PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extend
 | 
			
		||||
target_compile_features(simpleTexture PRIVATE cxx_std_17 cuda_std_17)
 | 
			
		||||
 | 
			
		||||
set_target_properties(simpleTexture PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET simpleTexture POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/teapot512.pgm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET simpleTexture POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/ref_rotated.pgm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@ -43,6 +43,20 @@ add_custom_command(
 | 
			
		||||
    COMMENT "Building CUDA fatbin: ${CUDA_FATBIN_FILE}"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET simpleTextureDrv POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/teapot512.pgm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET simpleTextureDrv POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/ref_rotated.pgm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Create a dummy target for fatbin generation
 | 
			
		||||
add_custom_target(generate_fatbin_textureDrv ALL DEPENDS ${CUDA_FATBIN_FILE})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -47,3 +47,24 @@ target_compile_features(boxFilter PRIVATE cxx_std_17 cuda_std_17)
 | 
			
		||||
else()
 | 
			
		||||
    message(STATUS "OpenGL not found - will not build sample 'boxFilter'")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET boxFilter POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/teapot1024.ppm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET boxFilter POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/ref_14.ppm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET boxFilter POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/ref_22.ppm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
@ -36,3 +36,17 @@ add_custom_command(TARGET dct8x8 POST_BUILD
 | 
			
		||||
    ${REF_DATA}
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET dct8x8 POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/teapot512.ppm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET dct8x8 POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/teapot512.bmp
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
@ -25,3 +25,24 @@ target_compile_options(eigenvalues PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended
 | 
			
		||||
target_compile_features(eigenvalues PRIVATE cxx_std_17 cuda_std_17)
 | 
			
		||||
 | 
			
		||||
set_target_properties(eigenvalues PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET eigenvalues POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/diagonal.dat
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET eigenvalues POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/superdiagonal.dat
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET eigenvalues POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/reference.dat
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
@ -25,3 +25,24 @@ target_compile_options(segmentationTreeThrust PRIVATE $<$<COMPILE_LANGUAGE:CUDA>
 | 
			
		||||
target_compile_features(segmentationTreeThrust PRIVATE cxx_std_17 cuda_std_17)
 | 
			
		||||
 | 
			
		||||
set_target_properties(segmentationTreeThrust PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET segmentationTreeThrust POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/test.ppm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET segmentationTreeThrust POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/ref_00.ppm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET segmentationTreeThrust POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/data/ref_09.ppm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
@ -47,3 +47,10 @@ target_compile_features(freeImageInteropNPP PRIVATE cxx_std_17 cuda_std_17)
 | 
			
		||||
else()
 | 
			
		||||
    message(STATUS "FreeImage not found - will not build sample 'freeImageInteropNPP'")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET freeImageInteropNPP POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/teapot512.pgm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
@ -48,3 +48,10 @@ target_compile_features(histEqualizationNPP PRIVATE cxx_std_17 cuda_std_17)
 | 
			
		||||
else()
 | 
			
		||||
    message(STATUS "FreeImage not found - will not build sample 'histEqualizationNPP'")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET histEqualizationNPP POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/teapot512.pgm
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@ -35,3 +35,24 @@ target_link_libraries(watershedSegmentationNPP PRIVATE
 | 
			
		||||
        CUDA::nppif
 | 
			
		||||
        CUDA::cudart
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET watershedSegmentationNPP POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/teapot_512x512_8u_Gray.raw
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET watershedSegmentationNPP POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/CT_skull_512x512_8u_Gray.raw
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# Copy data files to output directory
 | 
			
		||||
add_custom_command(TARGET watershedSegmentationNPP POST_BUILD
 | 
			
		||||
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/Rocks_512x512_8u_Gray.raw
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}/
 | 
			
		||||
)
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user