## @brief Builds the Circle Hough GPU version (and a bit more) # @author Andreas Herten ## find_package(CUDA) message(STATUS "-CH- Running with CUDA = " ${DO_THE_CUDA_DANCE} ) # Set include paths (passed to nvcc in form of nvcc -Ipath1 -Ipath2 ...) # Usually current source dir - with more complex project structures also more CUDA_INCLUDE_DIRECTORIES( ${ROOT_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) # Needed to switch between proper ROOT TVector2 or fake TVector2 if (ROOT_FOUND) add_definitions(-DTHERE_IS_ROOT) message (STATUS "-CH- There is ROOT") endif (ROOT_FOUND) # Provide a list of actual .cu files set(CUDA_SRC cudaExample.cu core/CircleHough.cu ) # Stear compiler flags - eg different compute capabilites list(APPEND CUDA_NVCC_FLAGS --gpu-architecture sm_20) # The name of the shared library set(PNDHOUGHCUDA "PndHoughCuda") # Propagate it to parent scope so we can make a dependency there (and don't actually need to know the name string of the dependency) set(PNDHOUGHCUDA ${PNDHOUGHCUDA} PARENT_SCOPE) # Generate the actual library (object) CUDA_ADD_LIBRARY(${PNDHOUGHCUDA} ${CUDA_SRC} SHARED # This seems to be, for our case, equivalent with set(BUILD_SHARED_LIBS ON) ) set_target_properties(${PNDHOUGHCUDA} PROPERTIES ${FAIRROOT_LIBRARY_PROPERTIES})