|
|
|
@ -1,23 +1,12 @@ |
|
|
|
|
|
|
|
|
|
include(FindCUDA) |
|
|
|
|
|
|
|
|
|
if (CUDA_FOUND) |
|
|
|
|
include_directories(${CUDA_INCLUDE_DIRS}) |
|
|
|
|
link_directories(${CUDA_LIBRARIES}) |
|
|
|
|
|
|
|
|
|
#message ("CUDA_LIBRARIES = ${CUDA_LIBRARIES}") |
|
|
|
|
#message ("CUDA_INCLUDE_DIRS = ${CUDA_INCLUDE_DIRS}") |
|
|
|
|
#message ("CUDA_TARGET_LINK = ${CUDA_TARGET_LINK}") |
|
|
|
|
set(name "gpu") |
|
|
|
|
set(DEPS "opencv_core") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR) |
|
|
|
|
set(the_target "opencv_${name}") |
|
|
|
|
|
|
|
|
|
#==================================================================================== |
|
|
|
|
project(${the_target}) |
|
|
|
|
|
|
|
|
|
set(name "gpu") |
|
|
|
|
set(DEPS "opencv_core") |
|
|
|
|
|
|
|
|
|
project(opencv_${name}) |
|
|
|
|
add_definitions(-DCVAPI_EXPORTS) |
|
|
|
|
|
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include" |
|
|
|
@ -42,16 +31,19 @@ if (CUDA_FOUND) |
|
|
|
|
file(GLOB lib_hdrs "include/opencv2/${name}/*.h*") |
|
|
|
|
source_group("Include" FILES ${lib_hdrs}) |
|
|
|
|
|
|
|
|
|
if (HAVE_CUDA) |
|
|
|
|
include_directories(${CUDA_INCLUDE_DIRS}) |
|
|
|
|
link_directories(${CUDA_LIBRARIES}) |
|
|
|
|
|
|
|
|
|
if (UNIX OR APPLE) |
|
|
|
|
set (CUDA_NVCC_FLAGS "-Xcompiler;-fPIC") |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
CUDA_COMPILE(cuda_objs ${lib_cuda}) |
|
|
|
|
#message ("lib cuda : ${cuda_objs}") |
|
|
|
|
#CUDA_BUILD_CLEAN_TARGET() |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set(the_target "opencv_${name}") |
|
|
|
|
#message ("cuda_add_library : ${the_target} ${lib_srcs} ${lib_hdrs} ${lib_int_hdrs} ${lib_cuda} ${lib_cuda_hdrs}") |
|
|
|
|
add_library(${the_target} ${lib_srcs} ${lib_hdrs} ${lib_int_hdrs} ${lib_cuda} ${lib_cuda_hdrs} ${cuda_objs}) |
|
|
|
|
|
|
|
|
|
if(PCHSupport_FOUND) |
|
|
|
@ -82,7 +74,6 @@ if (CUDA_FOUND) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
# Add the required libraries for linking: |
|
|
|
|
#message (" ++++ target_link_libraries = ${the_target} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${DEPS} ${CUDA_LIBRARIES}") |
|
|
|
|
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${DEPS} ${CUDA_LIBRARIES}) |
|
|
|
|
|
|
|
|
|
if(MSVC) |
|
|
|
@ -108,5 +99,4 @@ if (CUDA_FOUND) |
|
|
|
|
DESTINATION include/opencv2/${name} |
|
|
|
|
COMPONENT main) |
|
|
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|