disabled gpucodec module on MacOS
authorVladislav Vinogradov <vlad.vinogradov@itseez.com>
Sat, 13 Apr 2013 16:49:52 +0000 (20:49 +0400)
committerVladislav Vinogradov <vlad.vinogradov@itseez.com>
Thu, 18 Apr 2013 09:28:34 +0000 (13:28 +0400)
modules/gpucodec/CMakeLists.txt
samples/gpu/CMakeLists.txt
samples/gpu/video_reader.cpp
samples/gpu/video_writer.cpp

index f03c201..17202bd 100644 (file)
@@ -1,4 +1,4 @@
-if(ANDROID OR IOS)
+if(ANDROID OR IOS OR APPLE)
   ocv_module_disable(gpucodec)
 endif()
 
index 1c6f6a9..a14c590 100644 (file)
@@ -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}"
index f9bbbbb..7eea726 100644 (file)
@@ -1,4 +1,9 @@
 #include <iostream>
+
+#include "opencv2/opencv_modules.hpp"
+
+#if defined(HAVE_OPENCV_GPUCODEC)
+
 #include <string>
 #include <vector>
 #include <algorithm>
@@ -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
index aed76e0..d540d04 100644 (file)
@@ -1,4 +1,9 @@
 #include <iostream>
+
+#include "opencv2/opencv_modules.hpp"
+
+#if defined(HAVE_OPENCV_GPUCODEC) && defined(WIN32)
+
 #include <vector>
 #include <numeric>
 
@@ -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