2012-01-25 17:04:49 +08:00
|
|
|
if(ANDROID OR IOS)
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_module_disable(gpu)
|
2012-01-25 17:04:49 +08:00
|
|
|
endif()
|
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
set(the_description "GPU-accelerated Computer Vision")
|
2013-04-08 22:51:06 +08:00
|
|
|
|
2013-04-18 14:26:16 +08:00
|
|
|
ocv_add_module(gpu opencv_imgproc opencv_calib3d opencv_objdetect opencv_video opencv_photo opencv_legacy opencv_gpuarithm opencv_gpufilters opencv_gpuimgproc opencv_gpufeatures2d OPTIONAL opencv_gpunvidia)
|
2010-12-07 00:37:32 +08:00
|
|
|
|
2013-01-23 19:32:49 +08:00
|
|
|
ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/cuda")
|
2012-04-17 15:12:16 +08:00
|
|
|
|
2013-03-13 20:22:44 +08:00
|
|
|
file(GLOB lib_hdrs "include/opencv2/*.hpp" "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
|
2012-10-05 22:04:23 +08:00
|
|
|
file(GLOB lib_int_hdrs "src/*.hpp" "src/*.h")
|
2012-02-03 19:26:49 +08:00
|
|
|
file(GLOB lib_cuda_hdrs "src/cuda/*.hpp" "src/cuda/*.h")
|
|
|
|
file(GLOB lib_srcs "src/*.cpp")
|
|
|
|
file(GLOB lib_cuda "src/cuda/*.cu*")
|
2010-12-07 00:37:32 +08:00
|
|
|
|
2013-01-23 19:32:49 +08:00
|
|
|
source_group("Include" FILES ${lib_hdrs})
|
|
|
|
source_group("Src\\Host" FILES ${lib_srcs} ${lib_int_hdrs})
|
|
|
|
source_group("Src\\Cuda" FILES ${lib_cuda} ${lib_cuda_hdrs})
|
2010-12-07 00:37:32 +08:00
|
|
|
|
2013-02-13 19:58:24 +08:00
|
|
|
if(HAVE_CUDA)
|
2013-04-08 22:51:06 +08:00
|
|
|
ocv_include_directories(${CUDA_INCLUDE_DIRS})
|
2013-03-26 16:33:13 +08:00
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations -Wshadow -Wunused-parameter /wd4211 /wd4201 /wd4100 /wd4505 /wd4408)
|
2012-04-24 22:15:38 +08:00
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
if(MSVC)
|
2012-04-14 05:50:59 +08:00
|
|
|
if(NOT ENABLE_NOISY_WARNINGS)
|
|
|
|
foreach(var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
|
|
|
|
string(REPLACE "/W4" "/W3" ${var} "${${var}}")
|
|
|
|
endforeach()
|
2012-04-24 22:15:38 +08:00
|
|
|
|
2012-04-14 05:50:59 +08:00
|
|
|
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler /wd4251)
|
|
|
|
endif()
|
2012-02-03 19:26:49 +08:00
|
|
|
endif()
|
2012-10-17 07:18:30 +08:00
|
|
|
|
2012-05-22 21:15:22 +08:00
|
|
|
ocv_cuda_compile(cuda_objs ${lib_cuda} ${ncv_cuda})
|
2012-08-23 19:46:19 +08:00
|
|
|
|
2012-05-22 21:15:22 +08:00
|
|
|
set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
2012-02-03 19:26:49 +08:00
|
|
|
else()
|
|
|
|
set(lib_cuda "")
|
|
|
|
set(cuda_objs "")
|
|
|
|
set(cuda_link_libs "")
|
2010-12-07 00:37:32 +08:00
|
|
|
endif()
|
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_set_module_sources(
|
2013-03-31 18:54:23 +08:00
|
|
|
HEADERS ${lib_hdrs}
|
2013-04-08 22:51:06 +08:00
|
|
|
SOURCES ${lib_int_hdrs} ${lib_cuda_hdrs} ${lib_srcs} ${lib_cuda} ${cuda_objs}
|
2012-02-03 19:26:49 +08:00
|
|
|
)
|
2012-04-24 22:15:38 +08:00
|
|
|
|
2012-04-24 15:49:55 +08:00
|
|
|
ocv_create_module(${cuda_link_libs})
|
2012-04-24 22:15:38 +08:00
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_add_precompiled_headers(${the_module})
|
2011-02-18 20:23:18 +08:00
|
|
|
|
|
|
|
################################################################################################################
|
|
|
|
################################ GPU Module Tests #####################################################
|
|
|
|
################################################################################################################
|
2012-02-03 19:26:49 +08:00
|
|
|
file(GLOB test_srcs "test/*.cpp")
|
|
|
|
file(GLOB test_hdrs "test/*.hpp" "test/*.h")
|
2012-06-09 23:00:04 +08:00
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_add_accuracy_tests(FILES "Include" ${test_hdrs}
|
2013-04-08 22:51:06 +08:00
|
|
|
FILES "Src" ${test_srcs})
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_add_perf_tests()
|
2013-02-13 19:58:24 +08:00
|
|
|
|
|
|
|
if(HAVE_CUDA)
|
|
|
|
add_subdirectory(perf4au)
|
|
|
|
endif()
|