Skip to content
Snippets Groups Projects
Commit 01ce56d7 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Jakub Klinkovský
Browse files

Refactoring CMakeLists for smart pointers examples.

parent 2ea8dc33
No related branches found
No related tags found
1 merge request!105TO/matrices-adaptive-csr
IF( BUILD_CUDA ) set( COMMON_EXAMPLES
CUDA_ADD_EXECUTABLE(UniquePointerExampleCuda UniquePointerExample.cu) UniquePointerExample
ADD_CUSTOM_COMMAND( COMMAND UniquePointerExampleCuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/UniquePointerExample.out OUTPUT UniquePointerExample.out ) SharedPointerExample
CUDA_ADD_EXECUTABLE(SharedPointerExampleCuda SharedPointerExample.cu) DevicePointerExample
ADD_CUSTOM_COMMAND( COMMAND SharedPointerExampleCuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/SharedPointerExample.out OUTPUT SharedPointerExample.out ) )
CUDA_ADD_EXECUTABLE(DevicePointerExampleCuda DevicePointerExample.cu)
ADD_CUSTOM_COMMAND( COMMAND DevicePointerExampleCuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/DevicePointerExample.out OUTPUT DevicePointerExample.out )
ADD_CUSTOM_TARGET( RunPointersExamples ALL DEPENDS if( BUILD_CUDA )
UniquePointerExample.out foreach( target IN ITEMS ${COMMON_EXAMPLES} )
SharedPointerExample.out cuda_add_executable( ${target}-cuda ${target}.cu OPTIONS )
DevicePointerExample.out add_custom_command( COMMAND ${target}-cuda > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/${target}.out OUTPUT ${target}.out )
) set( CUDA_OUTPUTS ${CUDA_OUTPUTS} ${target}.out )
endforeach()
else()
foreach( target IN ITEMS ${COMMON_EXAMPLES} )
add_executable( ${target} ${target}.cpp )
add_custom_command( COMMAND ${target} > ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/${target}.out OUTPUT ${target}.out )
set( HOST_OUTPUTS ${HOST_OUTPUTS} ${target}.out )
endforeach()
endif()
IF( BUILD_CUDA )
ADD_CUSTOM_TARGET( RunPointersExamples-cuda ALL DEPENDS ${CUDA_OUTPUTS} )
ELSE()
ADD_CUSTOM_TARGET( RunPointersExamples ALL DEPENDS ${HOST_OUTPUTS} )
ENDIF() ENDIF()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment