Merge pull request #1101 from jet47:cudev-stub-lib

This commit is contained in:
Roman Donchenko 2013-07-12 11:39:24 +04:00 committed by OpenCV Buildbot
commit 3b8a13a1ed
3 changed files with 32 additions and 20 deletions

View File

@ -8,28 +8,14 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4189 /wd4505 -Wundef -Wmissing-declarati
ocv_add_module(cudev)
ocv_module_include_directories(opencv_core)
file(GLOB_RECURSE lib_hdrs "include/opencv2/*.hpp")
file(GLOB lib_srcs "src/*.cpp")
add_custom_target(${the_module} SOURCES ${lib_hdrs})
ocv_set_module_sources(HEADERS ${lib_hdrs} SOURCES ${lib_srcs})
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${the_module} PROPERTIES FOLDER "modules")
endif()
foreach(var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
# we remove /EHa as it generates warnings under windows
string(REPLACE "/EHa" "" ${var} "${${var}}")
# we remove -ggdb3 flag as it leads to preprocessor errors when compiling CUDA files (CUDA 4.1)
string(REPLACE "-ggdb3" "" ${var} "${${var}}")
# we remove -Wsign-promo as it generates warnings under linux
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
# we remove -fvisibility-inlines-hidden because it's used for C++ compiler
# but NVCC uses C compiler by default
string(REPLACE "-fvisibility-inlines-hidden" "" ${var} "${${var}}")
endforeach()
ocv_create_module()
if(BUILD_TESTS)
add_subdirectory(test)

View File

@ -0,0 +1,11 @@
#include <opencv2/core/cvdef.h>
namespace cv { namespace cudev {
CV_EXPORTS void stubFunc();
}}
void cv::cudev::stubFunc()
{
}

View File

@ -1,4 +1,4 @@
set(test_deps opencv_core opencv_imgproc opencv_highgui opencv_ts ${OPENCV_MODULE_opencv_ts_DEPS})
set(test_deps opencv_cudev opencv_core opencv_imgproc opencv_highgui opencv_ts ${OPENCV_MODULE_opencv_ts_DEPS})
ocv_check_dependencies(${test_deps})
@ -13,6 +13,21 @@ if(OCV_DEPENDENCIES_FOUND)
source_group("Include" FILES ${test_hdrs})
set(OPENCV_TEST_${the_module}_SOURCES ${test_srcs} ${test_hdrs})
foreach(var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
# we remove /EHa as it generates warnings under windows
string(REPLACE "/EHa" "" ${var} "${${var}}")
# we remove -ggdb3 flag as it leads to preprocessor errors when compiling CUDA files (CUDA 4.1)
string(REPLACE "-ggdb3" "" ${var} "${${var}}")
# we remove -Wsign-promo as it generates warnings under linux
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")
# we remove -fvisibility-inlines-hidden because it's used for C++ compiler
# but NVCC uses C compiler by default
string(REPLACE "-fvisibility-inlines-hidden" "" ${var} "${${var}}")
endforeach()
CUDA_ADD_EXECUTABLE(${the_target} ${OPENCV_TEST_${the_module}_SOURCES})
target_link_libraries(${the_target} ${test_deps} ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES})
add_dependencies(opencv_tests ${the_target})