Index: CMakeLists.txt =================================================================== --- CMakeLists.txt.orig +++ CMakeLists.txt @@ -866,7 +866,7 @@ endif() add_subdirectory(doc) add_subdirectory(data) -if(BUILD_EXAMPLES OR INSTALL_PYTHON_EXAMPLES OR INSTALL_OCTAVE_EXAMPLES) +if(BUILD_EXAMPLES OR INSTALL_C_EXAMPLES OR INSTALL_PYTHON_EXAMPLES OR INSTALL_OCTAVE_EXAMPLES) add_subdirectory(samples) endif() Index: samples/CMakeLists.txt =================================================================== --- samples/CMakeLists.txt.orig +++ samples/CMakeLists.txt @@ -3,6 +3,15 @@ # # ---------------------------------------------------------------------------- +if(BUILD_EXAMPLES OR INSTALL_C_EXAMPLES) add_subdirectory(c) +endif() +if(INSTALL_PYTHON_EXAMPLES AND BUILD_NEW_PYTHON_SUPPORT) +add_subdirectory(python) +endif() +if(INSTALL_PYTHON_EXAMPLES AND BUILD_SWIG_PYTHON_SUPPORT) add_subdirectory(swig_python) +endif() +if(INSTALL_OCTAVE_EXAMPLES) add_subdirectory(octave) +endif() Index: samples/python/CMakeLists.txt =================================================================== --- /dev/null +++ samples/python/CMakeLists.txt @@ -0,0 +1,13 @@ +# ------------------------------------------------------------------------- +# 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: samples/swig_python/CMakeLists.txt =================================================================== --- samples/swig_python/CMakeLists.txt.orig +++ samples/swig_python/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB PYTHON_SAMPLES *.py) if(NOT WIN32) install(FILES ${PYTHON_SAMPLES} - DESTINATION share/opencv/samples/python + DESTINATION share/opencv/samples/swig_python PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)