2012-02-03 19:26:49 +08:00
|
|
|
set(the_description "The Core Functionality")
|
2012-02-03 19:54:16 +08:00
|
|
|
|
2013-12-20 13:46:03 +08:00
|
|
|
if (NOT HAVE_CUDA OR ENABLE_DYNAMIC_CUDA)
|
2013-12-19 14:27:38 +08:00
|
|
|
ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES})
|
|
|
|
else()
|
|
|
|
ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
|
|
|
|
endif()
|
2013-12-19 20:42:11 +08:00
|
|
|
|
|
|
|
ocv_module_include_directories("${OpenCV_SOURCE_DIR}/modules/dynamicuda/include/" ${ZLIB_INCLUDE_DIR})
|
2013-12-13 21:28:29 +08:00
|
|
|
|
2013-12-23 00:28:50 +08:00
|
|
|
if(HAVE_WINRT_CX)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW")
|
|
|
|
endif()
|
2013-08-07 16:53:48 +08:00
|
|
|
if(HAVE_WINRT)
|
2013-12-23 00:28:50 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GS /Gm- /AI\"${WINDOWS_SDK_PATH}/References/CommonConfiguration/Neutral\" /AI\"${VISUAL_STUDIO_PATH}/vcpackages\"")
|
2013-07-19 17:43:05 +08:00
|
|
|
endif()
|
|
|
|
|
2013-12-19 21:41:04 +08:00
|
|
|
if(ENABLE_DYNAMIC_CUDA)
|
2013-12-11 20:38:30 +08:00
|
|
|
add_definitions(-DDYNAMIC_CUDA_SUPPORT)
|
2013-12-13 21:28:29 +08:00
|
|
|
else()
|
2013-12-20 13:46:03 +08:00
|
|
|
if (HAVE_CUDA)
|
|
|
|
add_definitions(-DUSE_CUDA)
|
|
|
|
endif()
|
2013-12-11 20:38:30 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(HAVE_CUDA)
|
|
|
|
ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpu/include")
|
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
|
|
|
|
endif()
|
|
|
|
|
2013-12-13 21:28:29 +08:00
|
|
|
file(GLOB lib_cuda_hdrs "include/opencv2/${name}/cuda/*.hpp" "include/opencv2/${name}/cuda/*.h")
|
|
|
|
file(GLOB lib_cuda_hdrs_detail "include/opencv2/${name}/cuda/detail/*.hpp" "include/opencv2/${name}/cuda/detail/*.h")
|
|
|
|
|
2013-12-20 20:32:34 +08:00
|
|
|
if(HAVE_CUDA AND NOT ENABLE_DYNAMIC_CUDA)
|
2013-12-20 13:46:03 +08:00
|
|
|
file(GLOB lib_cuda "../dynamicuda/src/cuda/*.cu*")
|
2013-12-20 20:32:34 +08:00
|
|
|
ocv_include_directories(${CUDA_INCLUDE_DIRS})
|
|
|
|
ocv_cuda_compile(cuda_objs ${lib_cuda})
|
2013-12-19 20:42:11 +08:00
|
|
|
endif()
|
|
|
|
|
2013-12-13 21:28:29 +08:00
|
|
|
source_group("Cuda Headers" FILES ${lib_cuda_hdrs})
|
|
|
|
source_group("Cuda Headers\\Detail" FILES ${lib_cuda_hdrs_detail})
|
|
|
|
|
2013-12-20 13:46:03 +08:00
|
|
|
if (HAVE_CUDA AND NOT ENABLE_DYNAMIC_CUDA)
|
2013-12-19 20:42:11 +08:00
|
|
|
source_group("Src\\Cuda" FILES ${lib_cuda} ${lib_cuda_hdrs})
|
|
|
|
endif()
|
|
|
|
|
2013-12-20 13:46:03 +08:00
|
|
|
if (NOT HAVE_CUDA OR ENABLE_DYNAMIC_CUDA)
|
2013-12-13 21:28:29 +08:00
|
|
|
ocv_glob_module_sources(SOURCES "${opencv_core_BINARY_DIR}/version_string.inc"
|
|
|
|
HEADERS ${lib_cuda_hdrs} ${lib_cuda_hdrs_detail})
|
2013-12-19 20:42:11 +08:00
|
|
|
else()
|
2013-12-20 20:32:34 +08:00
|
|
|
ocv_glob_module_sources(SOURCES "${opencv_core_BINARY_DIR}/version_string.inc" ${lib_cuda} ${cuda_objs}
|
2013-12-19 20:42:11 +08:00
|
|
|
HEADERS ${lib_cuda_hdrs} ${lib_cuda_hdrs_detail})
|
2013-12-13 21:28:29 +08:00
|
|
|
endif()
|
2012-02-03 19:26:49 +08:00
|
|
|
|
2013-04-10 16:20:54 +08:00
|
|
|
ocv_create_module()
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_add_precompiled_headers(${the_module})
|
|
|
|
|
|
|
|
ocv_add_accuracy_tests()
|
|
|
|
ocv_add_perf_tests()
|