SHA256
1
0
forked from pool/opencv
opencv/opencv-samples.patch

98 lines
3.5 KiB
Diff

Index: opencv-2.4.11/CMakeLists.txt
===================================================================
--- opencv-2.4.11.orig/CMakeLists.txt
+++ opencv-2.4.11/CMakeLists.txt
@@ -576,7 +576,7 @@ if(BUILD_opencv_apps)
endif()
# examples
-if(BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES)
+if(BUILD_EXAMPLES OR INSTALL_C_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES)
add_subdirectory(samples)
endif()
Index: opencv-2.4.11/samples/CMakeLists.txt
===================================================================
--- opencv-2.4.11.orig/samples/CMakeLists.txt
+++ opencv-2.4.11/samples/CMakeLists.txt
@@ -10,6 +10,7 @@ if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_C
#
# ----------------------------------------------------------------------------
+if(BUILD_EXAMPLES OR INSTALL_C_EXAMPLES)
add_subdirectory(c)
add_subdirectory(cpp)
add_subdirectory(gpu)
@@ -19,11 +20,17 @@ if(ANDROID AND BUILD_ANDROID_EXAMPLES)
add_subdirectory(android)
endif()
+if(INSTALL_PYTHON_EXAMPLES)
+add_subdirectory(python)
+add_subdirectory(python2)
+endif()
+
if(INSTALL_C_EXAMPLES)
install(FILES "CMakeLists.txt"
DESTINATION ${OPENCV_SAMPLES_SRC_INSTALL_PATH}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
endif()
+endif()
#
# END OF BUILD CASE 1: Build samples with library sources
@@ -70,4 +77,4 @@ add_subdirectory(gpu)
#
# END OF BUILD CASE 2: Build samples with library binaries
#
-endif()
\ No newline at end of file
+endif()
Index: opencv-2.4.11/samples/python/CMakeLists.txt
===================================================================
--- /dev/null
+++ opencv-2.4.11/samples/python/CMakeLists.txt
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------------------
+# CMake file for Python samples. See root CMakeLists.txt
+# -------------------------------------------------------------------------
+
+file(GLOB PYTHON_SAMPLES *.py)
+if(NOT WIN32)
+install(FILES ${PYTHON_SAMPLES}
+ DESTINATION share/OpenCV/samples/python
+ PERMISSIONS OWNER_READ OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+endif()
Index: opencv-2.4.11/samples/python2/CMakeLists.txt
===================================================================
--- /dev/null
+++ opencv-2.4.11/samples/python2/CMakeLists.txt
@@ -0,0 +1,12 @@
+# -------------------------------------------------------------------------
+# CMake file for Python samples. See root CMakeLists.txt
+# -------------------------------------------------------------------------
+
+file(GLOB PYTHON_SAMPLES *.py)
+if(NOT WIN32)
+install(FILES ${PYTHON_SAMPLES}
+ DESTINATION share/OpenCV/samples/python2
+ PERMISSIONS OWNER_READ OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
+endif()
Index: opencv-2.4.11/samples/gpu/CMakeLists.txt
===================================================================
--- opencv-2.4.11.orig/samples/gpu/CMakeLists.txt
+++ opencv-2.4.11/samples/gpu/CMakeLists.txt
@@ -100,7 +100,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_F
include("performance/CMakeLists.txt")
endif()
-if (OCV_DEPENDENCIES_FOUND AND INSTALL_C_EXAMPLES AND NOT WIN32)
+if (BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND AND INSTALL_C_EXAMPLES AND NOT WIN32)
file(GLOB install_list *.c *.cpp *.jpg *.png *.data makefile.* build_all.sh *.dsp *.cmd *.txt)
if(NOT HAVE_OPENGL)
list_filterout(install_list ".*opengl.cpp")