mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
benchmarking cmake code simplified
This commit is contained in:
parent
2c026508b3
commit
5a26051fc8
@ -16,25 +16,17 @@ function(add_benchmark)
|
||||
${ARGN}
|
||||
)
|
||||
set(exe_name ${VTKm_AB_NAME})
|
||||
if (TARGET vtkm::cuda)
|
||||
get_filename_component(fname ${VTKm_AB_FILE} NAME_WE)
|
||||
get_filename_component(fullpath ${VTKm_AB_FILE} ABSOLUTE)
|
||||
file(GENERATE
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${fname}.cu
|
||||
CONTENT "#include \"${fullpath}\"")
|
||||
|
||||
add_executable(${exe_name} ${CMAKE_CURRENT_BINARY_DIR}/${fname}.cu)
|
||||
set_property(TARGET ${exe_name} PROPERTY CUDA_SEPARABLE_COMPILATION ON)
|
||||
else()
|
||||
add_executable(${exe_name} ${VTKm_AB_FILE})
|
||||
endif()
|
||||
|
||||
add_executable(${exe_name} ${VTKm_AB_FILE})
|
||||
target_link_libraries(${exe_name} PRIVATE ${VTKm_AB_LIBS})
|
||||
set_target_properties(${exe_name} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${VTKm_EXECUTABLE_OUTPUT_PATH}
|
||||
)
|
||||
|
||||
|
||||
if (TARGET vtkm::cuda)
|
||||
set_source_files_properties(${VTKm_AB_FILE} PROPERTIES LANGUAGE "CUDA")
|
||||
set_property(TARGET ${exe_name} PROPERTY CUDA_SEPARABLE_COMPILATION ON)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
set(benchmarks
|
||||
|
Loading…
Reference in New Issue
Block a user