|
|
@@ -479,12 +479,13 @@ endmacro()
|
|
|
|
# finds and sets headers and sources for the standard OpenCV module
|
|
|
|
# finds and sets headers and sources for the standard OpenCV module
|
|
|
|
# Usage:
|
|
|
|
# Usage:
|
|
|
|
# ocv_glob_module_sources(<extra sources&headers in the same format as used in ocv_set_module_sources>)
|
|
|
|
# ocv_glob_module_sources(<extra sources&headers in the same format as used in ocv_set_module_sources>)
|
|
|
|
macro(ocv_glob_module_sources)
|
|
|
|
macro(ocv_glob_module_sources EXCLUDE_CUDA EXCLUDE_OPENCL)
|
|
|
|
file(GLOB_RECURSE lib_srcs "src/*.cpp")
|
|
|
|
file(GLOB_RECURSE lib_srcs "src/*.cpp")
|
|
|
|
file(GLOB_RECURSE lib_int_hdrs "src/*.hpp" "src/*.h")
|
|
|
|
file(GLOB_RECURSE lib_int_hdrs "src/*.hpp" "src/*.h")
|
|
|
|
file(GLOB lib_hdrs "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
|
|
|
|
file(GLOB lib_hdrs "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h")
|
|
|
|
file(GLOB lib_hdrs_detail "include/opencv2/${name}/detail/*.hpp" "include/opencv2/${name}/detail/*.h")
|
|
|
|
file(GLOB lib_hdrs_detail "include/opencv2/${name}/detail/*.hpp" "include/opencv2/${name}/detail/*.h")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (NOT ${EXCLUDE_CUDA})
|
|
|
|
file(GLOB lib_cuda_srcs "src/cuda/*.cu")
|
|
|
|
file(GLOB lib_cuda_srcs "src/cuda/*.cu")
|
|
|
|
set(cuda_objs "")
|
|
|
|
set(cuda_objs "")
|
|
|
|
set(lib_cuda_hdrs "")
|
|
|
|
set(lib_cuda_hdrs "")
|
|
|
@@ -495,9 +496,15 @@ macro(ocv_glob_module_sources)
|
|
|
|
ocv_cuda_compile(cuda_objs ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
|
|
|
ocv_cuda_compile(cuda_objs ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
|
|
|
source_group("Src\\Cuda" FILES ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
|
|
|
source_group("Src\\Cuda" FILES ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
else()
|
|
|
|
|
|
|
|
set(cuda_objs "")
|
|
|
|
|
|
|
|
set(lib_cuda_srcs "")
|
|
|
|
|
|
|
|
set(lib_cuda_hdrs "")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
source_group("Src" FILES ${lib_srcs} ${lib_int_hdrs})
|
|
|
|
source_group("Src" FILES ${lib_srcs} ${lib_int_hdrs})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (NOT ${EXCLUDE_OPENCL})
|
|
|
|
file(GLOB cl_kernels "src/opencl/*.cl")
|
|
|
|
file(GLOB cl_kernels "src/opencl/*.cl")
|
|
|
|
if(HAVE_opencv_ocl AND cl_kernels)
|
|
|
|
if(HAVE_opencv_ocl AND cl_kernels)
|
|
|
|
ocv_include_directories(${OPENCL_INCLUDE_DIRS})
|
|
|
|
ocv_include_directories(${OPENCL_INCLUDE_DIRS})
|
|
|
@@ -508,10 +515,13 @@ macro(ocv_glob_module_sources)
|
|
|
|
source_group("OpenCL" FILES ${cl_kernels} "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp")
|
|
|
|
source_group("OpenCL" FILES ${cl_kernels} "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp")
|
|
|
|
list(APPEND lib_srcs ${cl_kernels} "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp")
|
|
|
|
list(APPEND lib_srcs ${cl_kernels} "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.cpp" "${CMAKE_CURRENT_BINARY_DIR}/opencl_kernels.hpp")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
source_group("Include" FILES ${lib_hdrs})
|
|
|
|
source_group("Include" FILES ${lib_hdrs})
|
|
|
|
source_group("Include\\detail" FILES ${lib_hdrs_detail})
|
|
|
|
source_group("Include\\detail" FILES ${lib_hdrs_detail})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
message(":${EXCLUDE_CUDA}: ${lib_cuda_srcs}")
|
|
|
|
|
|
|
|
|
|
|
|
ocv_set_module_sources(${ARGN} HEADERS ${lib_hdrs} ${lib_hdrs_detail}
|
|
|
|
ocv_set_module_sources(${ARGN} HEADERS ${lib_hdrs} ${lib_hdrs_detail}
|
|
|
|
SOURCES ${lib_srcs} ${lib_int_hdrs} ${cuda_objs} ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
|
|
|
SOURCES ${lib_srcs} ${lib_int_hdrs} ${cuda_objs} ${lib_cuda_srcs} ${lib_cuda_hdrs})
|
|
|
|
endmacro()
|
|
|
|
endmacro()
|
|
|
@@ -614,9 +624,25 @@ endmacro()
|
|
|
|
# Usage:
|
|
|
|
# Usage:
|
|
|
|
# ocv_define_module(module_name [INTERNAL] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
|
|
|
|
# ocv_define_module(module_name [INTERNAL] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
|
|
|
|
macro(ocv_define_module module_name)
|
|
|
|
macro(ocv_define_module module_name)
|
|
|
|
ocv_add_module(${module_name} ${ARGN})
|
|
|
|
set(_tmp_argn ${ARGN})
|
|
|
|
|
|
|
|
set(exclude_cuda 0)
|
|
|
|
|
|
|
|
set(exclude_opencl 0)
|
|
|
|
|
|
|
|
set(argv0 ${ARGV1})
|
|
|
|
|
|
|
|
set(argv1 ${ARGV2})
|
|
|
|
|
|
|
|
set(argv2 ${ARGV3})
|
|
|
|
|
|
|
|
foreach(i RANGE 0 2)
|
|
|
|
|
|
|
|
if("${argv${i}}" STREQUAL "EXCLUDE_CUDA")
|
|
|
|
|
|
|
|
set(exclude_cuda 1)
|
|
|
|
|
|
|
|
list(REMOVE_AT _tmp_argn ${i})
|
|
|
|
|
|
|
|
elseif ("${argv${i}}" STREQUAL "EXCLUDE_OPENCL")
|
|
|
|
|
|
|
|
set(exclude_opencl 1)
|
|
|
|
|
|
|
|
list(REMOVE_AT _tmp_argn ${i})
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ocv_add_module(${module_name} ${_tmp_argn})
|
|
|
|
ocv_module_include_directories()
|
|
|
|
ocv_module_include_directories()
|
|
|
|
ocv_glob_module_sources()
|
|
|
|
ocv_glob_module_sources(${exclude_cuda} ${exclude_opencl})
|
|
|
|
ocv_create_module()
|
|
|
|
ocv_create_module()
|
|
|
|
ocv_add_precompiled_headers(${the_module})
|
|
|
|
ocv_add_precompiled_headers(${the_module})
|
|
|
|
|
|
|
|
|
|
|
|