diff -Naur opencv-2.4.7.orig/CMakeLists.txt opencv-2.4.7/CMakeLists.txt --- opencv-2.4.7.orig/CMakeLists.txt 2013-11-06 15:26:39.000000000 +0100 +++ opencv-2.4.7/CMakeLists.txt 2013-11-12 23:58:52.378443609 +0100 @@ -504,7 +504,7 @@ 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() diff -Naur opencv-2.4.7.orig/samples/CMakeLists.txt opencv-2.4.7/samples/CMakeLists.txt --- opencv-2.4.7.orig/samples/CMakeLists.txt 2013-11-06 15:26:39.000000000 +0100 +++ opencv-2.4.7/samples/CMakeLists.txt 2013-11-13 00:01:39.970348422 +0100 @@ -10,6 +10,7 @@ # # ---------------------------------------------------------------------------- +if(BUILD_EXAMPLES OR INSTALL_C_EXAMPLES) add_subdirectory(c) add_subdirectory(cpp) add_subdirectory(gpu) @@ -18,7 +19,12 @@ if(ANDROID AND BUILD_ANDROID_EXAMPLES) add_subdirectory(android) endif() +endif() +if(INSTALL_PYTHON_EXAMPLES) +add_subdirectory(python) +add_subdirectory(python2) +endif() # # END OF BUILD CASE 1: Build samples with library sources diff -Naur opencv-2.4.7.orig/samples/gpu/CMakeLists.txt opencv-2.4.7/samples/gpu/CMakeLists.txt --- opencv-2.4.7.orig/samples/gpu/CMakeLists.txt 2013-11-06 15:26:39.000000000 +0100 +++ opencv-2.4.7/samples/gpu/CMakeLists.txt 2013-11-13 00:02:21.474829545 +0100 @@ -83,6 +83,6 @@ if (INSTALL_C_EXAMPLES AND NOT WIN32) file(GLOB install_list *.c *.cpp *.jpg *.png *.data makefile.* build_all.sh *.dsp *.cmd ) install(FILES ${install_list} - DESTINATION share/OpenCV/samples/${project} + DESTINATION share/OpenCV/samples/gpu PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) endif() diff -Naur opencv-2.4.7.orig/samples/python/CMakeLists.txt opencv-2.4.7/samples/python/CMakeLists.txt --- opencv-2.4.7.orig/samples/python/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ opencv-2.4.7/samples/python/CMakeLists.txt 2013-11-13 00:03:21.049084764 +0100 @@ -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() diff -Naur opencv-2.4.7.orig/samples/python2/CMakeLists.txt opencv-2.4.7/samples/python2/CMakeLists.txt --- opencv-2.4.7.orig/samples/python2/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ opencv-2.4.7/samples/python2/CMakeLists.txt 2013-11-13 00:03:51.490704191 +0100 @@ -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()