Commit 284b2fc1 authored by Alexander Smorkalov's avatar Alexander Smorkalov

Cut path to CUDA libraries to prevent generation of OpenCVModules.cmake with abs path.

parent a1e5bd71
...@@ -467,7 +467,6 @@ include(cmake/OpenCVFindLibsGUI.cmake) ...@@ -467,7 +467,6 @@ include(cmake/OpenCVFindLibsGUI.cmake)
include(cmake/OpenCVFindLibsVideo.cmake) include(cmake/OpenCVFindLibsVideo.cmake)
include(cmake/OpenCVFindLibsPerf.cmake) include(cmake/OpenCVFindLibsPerf.cmake)
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Detect other 3rd-party libraries/tools # Detect other 3rd-party libraries/tools
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -513,16 +512,6 @@ if(NOT HAVE_CUDA) ...@@ -513,16 +512,6 @@ if(NOT HAVE_CUDA)
set(ENABLE_DYNAMIC_CUDA OFF) set(ENABLE_DYNAMIC_CUDA OFF)
endif() endif()
if(HAVE_CUDA AND NOT ENABLE_DYNAMIC_CUDA)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
if(HAVE_CUBLAS)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cublas_LIBRARY})
endif()
if(HAVE_CUFFT)
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cufft_LIBRARY})
endif()
endif()
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Solution folders: # Solution folders:
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
......
...@@ -326,12 +326,12 @@ macro(add_android_project target path) ...@@ -326,12 +326,12 @@ macro(add_android_project target path)
# copy all needed CUDA libs to project if EMBED_CUDA flag is present # copy all needed CUDA libs to project if EMBED_CUDA flag is present
if(android_proj_EMBED_CUDA) if(android_proj_EMBED_CUDA)
set(android_proj_culibs ${CUDA_npp_LIBRARY} ${CUDA_LIBRARIES}) set(android_proj_culibs ${CUDA_npp_LIBRARY_ABS} ${CUDA_LIBRARIES_ABS})
if(HAVE_CUFFT) if(HAVE_CUFFT)
list(INSERT android_proj_culibs 0 ${CUDA_cufft_LIBRARY}) list(INSERT android_proj_culibs 0 ${CUDA_cufft_LIBRARY_ABS})
endif() endif()
if(HAVE_CUBLAS) if(HAVE_CUBLAS)
list(INSERT android_proj_culibs 0 ${CUDA_cublas_LIBRARY}) list(INSERT android_proj_culibs 0 ${CUDA_cublas_LIBRARY_ABS})
endif() endif()
foreach(lib ${android_proj_culibs}) foreach(lib ${android_proj_culibs})
get_filename_component(f "${lib}" NAME) get_filename_component(f "${lib}" NAME)
......
...@@ -219,3 +219,42 @@ else() ...@@ -219,3 +219,42 @@ else()
unset(CUDA_ARCH_BIN CACHE) unset(CUDA_ARCH_BIN CACHE)
unset(CUDA_ARCH_PTX CACHE) unset(CUDA_ARCH_PTX CACHE)
endif() endif()
if(HAVE_CUDA)
set(CUDA_LIBS_PATH "")
foreach(p ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
get_filename_component(_tmp ${p} PATH)
list(APPEND CUDA_LIBS_PATH ${_tmp})
endforeach()
if(HAVE_CUBLAS)
foreach(p ${CUDA_cublas_LIBRARY})
get_filename_component(_tmp ${p} PATH)
list(APPEND CUDA_LIBS_PATH ${_tmp})
endforeach()
endif()
if(HAVE_CUFFT)
foreach(p ${CUDA_cufft_LIBRARY})
get_filename_component(_tmp ${p} PATH)
list(APPEND CUDA_LIBS_PATH ${_tmp})
endforeach()
endif()
list(REMOVE_DUPLICATES CUDA_LIBS_PATH)
link_directories(${CUDA_LIBS_PATH})
set(CUDA_LIBRARIES_ABS ${CUDA_LIBRARIES})
ocv_convert_to_lib_name(CUDA_LIBRARIES ${CUDA_LIBRARIES})
set(CUDA_npp_LIBRARY_ABS ${CUDA_npp_LIBRARY})
ocv_convert_to_lib_name(CUDA_npp_LIBRARY ${CUDA_npp_LIBRARY})
if(HAVE_CUBLAS)
set(CUDA_cublas_LIBRARY_ABS ${CUDA_cublas_LIBRARY})
ocv_convert_to_lib_name(CUDA_cublas_LIBRARY ${CUDA_cublas_LIBRARY})
endif()
if(HAVE_CUFFT)
set(CUDA_cufft_LIBRARY_ABS ${CUDA_cufft_LIBRARY})
ocv_convert_to_lib_name(CUDA_cufft_LIBRARY ${CUDA_cufft_LIBRARY})
endif()
endif()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment