Merge pull request #9 from jnbntz/cmake_transition

Copying input files into BINDIR so that these samples will run properly
This commit is contained in:
Rob Armstrong 2025-01-16 09:02:53 -08:00 committed by GitHub
commit 9a454d3ba9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 140 additions and 0 deletions

View File

@ -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}/
)

View File

@ -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})

View 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}/
)

View File

@ -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}/
)

View File

@ -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}/
)

View File

@ -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}/
)

View File

@ -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}/
)

View File

@ -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}/
)

View File

@ -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}/
)