CMakeLists.txt 981 Bytes
# OpenCV
find_package(OpenCV REQUIRED)

# NPP
find_package(CUDAToolkit REQUIRED COMPONENTS nppif cudart)

# HDF5
find_package(HDF5 REQUIRED COMPONENTS CXX)

# Threads
find_package(Threads REQUIRED)

# Project files
file(GLOB_RECURSE source_files CONFIGURE_DEPENDS *.cpp)
file(GLOB_RECURSE header_files CONFIGURE_DEPENDS *.hpp)
file(GLOB_RECURSE cuda_files CONFIGURE_DEPENDS *.cu)

add_executable(executable ${source_files} ${header_files} ${cuda_files})

# CUDA compute architectures
set_property(TARGET executable PROPERTY CUDA_ARCHITECTURES 62) # 62 - Jetson TX2
set_property(TARGET executable PROPERTY CUDA_STANDARD 14)

# Allows to use absolute includes in regard to source directory
target_include_directories(executable PUBLIC ${PROJECT_SOURCE_DIR}/src ${HDF5_INCLUDE_DIRS})

target_link_libraries(executable PUBLIC
								project_options
								CUDA::cudart
								CUDA::nppif
								${OpenCV_LIBS}
								PRIVATE
								${HDF5_CXX_LIBRARIES}
								Threads::Threads)