From 787e56ab5c478fa3289f89f7d086137451b55cb1 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Sat, 13 Apr 2013 20:49:52 +0400 Subject: [PATCH] disabled gpucodec module on MacOS --- modules/gpucodec/CMakeLists.txt | 2 +- samples/gpu/CMakeLists.txt | 9 ++++++++- samples/gpu/video_reader.cpp | 15 +++++++++++++++ samples/gpu/video_writer.cpp | 15 +++++++++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/modules/gpucodec/CMakeLists.txt b/modules/gpucodec/CMakeLists.txt index f03c201b30..17202bd0e6 100644 --- a/modules/gpucodec/CMakeLists.txt +++ b/modules/gpucodec/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ANDROID OR IOS) +if(ANDROID OR IOS OR APPLE) ocv_module_disable(gpucodec) endif() diff --git a/samples/gpu/CMakeLists.txt b/samples/gpu/CMakeLists.txt index 1c6f6a9638..a14c5907ab 100644 --- a/samples/gpu/CMakeLists.txt +++ b/samples/gpu/CMakeLists.txt @@ -2,7 +2,7 @@ SET(OPENCV_GPU_SAMPLES_REQUIRED_DEPS opencv_core opencv_flann opencv_imgproc ope opencv_ml opencv_video opencv_objdetect opencv_features2d opencv_calib3d opencv_legacy opencv_contrib opencv_gpu opencv_nonfree opencv_softcascade opencv_superres - opencv_gpucodec opencv_gpuarithm opencv_gpufilters opencv_gpuwarping opencv_gpuimgproc + opencv_gpuarithm opencv_gpufilters opencv_gpuwarping opencv_gpuimgproc opencv_gpufeatures2d opencv_gpuoptflow opencv_gpubgsegm opencv_gpustereo opencv_gpulegacy) @@ -24,6 +24,10 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/nonfree/include") endif() + if(HAVE_opencv_gpucodec) + ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpucodec/include") + endif() + if(HAVE_CUDA) ocv_include_directories(${CUDA_INCLUDE_DIRS}) endif() @@ -43,6 +47,9 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) if(HAVE_opencv_nonfree) target_link_libraries(${the_target} opencv_nonfree) endif() + if(HAVE_opencv_gpucodec) + target_link_libraries(${the_target} opencv_gpucodec) + endif() set_target_properties(${the_target} PROPERTIES OUTPUT_NAME "${project}-example-${name}" diff --git a/samples/gpu/video_reader.cpp b/samples/gpu/video_reader.cpp index f9bbbbb334..7eea726399 100644 --- a/samples/gpu/video_reader.cpp +++ b/samples/gpu/video_reader.cpp @@ -1,4 +1,9 @@ #include + +#include "opencv2/opencv_modules.hpp" + +#if defined(HAVE_OPENCV_GPUCODEC) + #include #include #include @@ -69,3 +74,13 @@ int main(int argc, const char* argv[]) return 0; } + +#else + +int main() +{ + std::cout << "OpenCV was built without GPU Video decoding support\n" << std::endl; + return 0; +} + +#endif diff --git a/samples/gpu/video_writer.cpp b/samples/gpu/video_writer.cpp index aed76e04e4..d540d04093 100644 --- a/samples/gpu/video_writer.cpp +++ b/samples/gpu/video_writer.cpp @@ -1,4 +1,9 @@ #include + +#include "opencv2/opencv_modules.hpp" + +#if defined(HAVE_OPENCV_GPUCODEC) && defined(WIN32) + #include #include @@ -94,3 +99,13 @@ int main(int argc, const char* argv[]) return 0; } + +#else + +int main() +{ + std::cout << "OpenCV was built without GPU Video encoding support\n" << std::endl; + return 0; +} + +#endif