include_directories(${CUDA_INCLUDE_DIRS})\r
link_directories(${CUDA_LIBRARIES})\r
\r
+ #message ("CUDA_LIBRARIES = ${CUDA_LIBRARIES}")\r
+ #message ("CUDA_INCLUDE_DIRS = ${CUDA_INCLUDE_DIRS}")\r
+ #message ("CUDA_TARGET_LINK = ${CUDA_TARGET_LINK}")\r
+\r
+\r
#CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)\r
\r
#====================================================================================\r
-\r
\r
set(name "gpu") \r
set(DEPS "opencv_core")\r
\r
file(GLOB lib_srcs "src/*.cpp")\r
file(GLOB lib_int_hdrs "src/*.h*")\r
- file(GLOB lib_cuda "cuda/*.cu")\r
+ file(GLOB lib_cuda "cuda/*.cu")\r
file(GLOB lib_cuda_hdrs "cuda/*.h*") \r
source_group("Src" FILES ${lib_srcs} ${lib_int_hdrs})\r
source_group("Cuda" FILES ${lib_cuda} ${lib_cuda_hdrs})\r
file(GLOB lib_hdrs "include/opencv2/${name}/*.h*") \r
source_group("Include" FILES ${lib_hdrs})\r
\r
+ if (UNIX OR APPLE)\r
+ set (CUDA_NVCC_FLAGS "-Xcompiler;-fPIC")\r
+ endif()\r
+\r
CUDA_COMPILE(cuda_objs ${lib_cuda})\r
+ #message ("lib cuda : ${cuda_objs}")\r
#CUDA_BUILD_CLEAN_TARGET()\r
\r
set(the_target "opencv_${name}")\r
- add_library(${the_target} ${lib_srcs} ${lib_hdrs} ${lib_int_hdrs} ${lib_cuda} ${lib_cuda_hdrs} ${cuda_objs})\r
+ #message ("cuda_add_library : ${the_target} ${lib_srcs} ${lib_hdrs} ${lib_int_hdrs} ${lib_cuda} ${lib_cuda_hdrs}")\r
+ add_library(${the_target} ${lib_srcs} ${lib_hdrs} ${lib_int_hdrs} ${lib_cuda} ${lib_cuda_hdrs} ${cuda_objs})\r
\r
if(PCHSupport_FOUND)\r
set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp)\r
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"\r
)\r
\r
- # Add the required libraries for linking:\r
+ # Add the required libraries for linking:\r
+ #message (" ++++ target_link_libraries = ${the_target} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${DEPS} ${CUDA_LIBRARIES}")\r
target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${DEPS} ${CUDA_LIBRARIES})\r
\r
if(MSVC)\r