# Include directories and libraries
include_directories(../../../Common)

find_package(OpenGL)
find_package(GLUT)

# Source file
set(SRC_FILES
    boxFilter.cpp
    boxFilter_cpu.cpp
    boxFilter_kernel.cu
)

if(${OpenGL_FOUND})
    if (${GLUT_FOUND})
        # Add target for boxFilter
        add_executable(boxFilter ${SRC_FILES})
        set_target_properties(boxFilter PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

        target_include_directories(boxFilter PUBLIC
            ${OPENGL_INCLUDE_DIR}
            ${CUDAToolkit_INCLUDE_DIRS}
            ${GLUT_INCLUDE_DIRS}
        )

        target_link_libraries(boxFilter
            ${OPENGL_LIBRARIES}
            ${GLUT_LIBRARIES}
        )
    else()
        message(STATUS "GLUT not found - will not build sample 'boxFilter'")
    endif()
else()
    message(STATUS "OpenGL not found - will not build sample 'boxFilter'")
endif()
