OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
OCV_OPTION(INSTALL_TO_MANGLED_PATHS "Enables mangled install paths, that help with side by side installs." OFF IF (UNIX AND NOT ANDROID AND NOT IOS AND BUILD_SHARED_LIBS) )
-
+OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binaries and test data" OFF)
# OpenCV build options
# ===================================================
else(OCV_DEPENDENCIES_FOUND)
# TODO: warn about unsatisfied dependencies
endif(OCV_DEPENDENCIES_FOUND)
+ if(INSTALL_TESTS)
+ if(ANDROID)
+ install(TARGETS ${the_target} RUNTIME DESTINATION sdk/etc/bin COMPONENT tests)
+ elseif(NOT WIN32)
+ install(TARGETS ${the_target} RUNTIME DESTINATION share/OpenCV/bin COMPONENT tests)
+ endif()
+ endif()
endif()
endfunction()
else(OCV_DEPENDENCIES_FOUND)
# TODO: warn about unsatisfied dependencies
endif(OCV_DEPENDENCIES_FOUND)
+
+ if(INSTALL_TESTS)
+ if(ANDROID)
+ install(TARGETS ${the_target} RUNTIME DESTINATION sdk/etc/bin COMPONENT tests)
+ elseif(NOT WIN32)
+ install(TARGETS ${the_target} RUNTIME DESTINATION share/OpenCV/bin COMPONENT tests)
+ endif()
+ endif()
endif()
endfunction()
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_SECTION "libs")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://opencv.org")
+if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
+ set(prefix "${CMAKE_INSTALL_PREFIX}")
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/postinst"
+ "${CMAKE_BINARY_DIR}/junk/postinst" @ONLY IMMEDIATE)
+ set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/junk/postinst")
+endif()
#depencencies
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
set(CPACK_COMPONENT_docs_DEPENDS libs)
set(CPACK_COMPONENT_java_DEPENDS libs)
set(CPACK_COMPONENT_python_DEPENDS libs)
+if(INSTALL_TESTS)
+set(CPACK_COMPONENT_tests_DEPENDS libs)
+endif()
if(HAVE_CUDA)
string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})
set(CPACK_COMPONENT_libs_DESCRIPTION "Open Computer Vision Library")
set(CPACK_COMPONENT_python_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-python")
- set(CPACK_COMPONENT_python_DESCRIPTION "Python bindings for Open Computer Vision Library")
+ set(CPACK_COMPONENT_python_DESCRIPTION "Python bindings for Open Source Computer Vision Library")
set(CPACK_COMPONENT_java_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-java")
- set(CPACK_COMPONENT_java_DESCRIPTION "Java bindings for Open Computer Vision Library")
+ set(CPACK_COMPONENT_java_DESCRIPTION "Java bindings for Open Source Computer Vision Library")
set(CPACK_COMPONENT_dev_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-dev")
- set(CPACK_COMPONENT_dev_DESCRIPTION "Development files for Open Computer Vision Library")
+ set(CPACK_COMPONENT_dev_DESCRIPTION "Development files for Open Source Computer Vision Library")
set(CPACK_COMPONENT_docs_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-docs")
- set(CPACK_COMPONENT_docs_DESCRIPTION "Documentation for Open Computer Vision Library")
+ set(CPACK_COMPONENT_docs_DESCRIPTION "Documentation for Open Source Computer Vision Library")
set(CPACK_COMPONENT_samples_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-samples")
- set(CPACK_COMPONENT_samples_DESCRIPTION "Samples for Open Computer Vision Library")
+ set(CPACK_COMPONENT_samples_DESCRIPTION "Samples for Open Source Computer Vision Library")
+
+ set(CPACK_COMPONENT_tests_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-tests")
+ set(CPACK_COMPONENT_tests_DESCRIPTION "Accuracy and performance tests for Open Source Computer Vision Library")
endif(NOT OPENCV_CUSTOM_PACKAGE_INFO)
if(NOT OPENCV_CUSTOM_PACKAGE_LAYOUT)
--- /dev/null
+#!/bin/sh
+
+echo "export OPENCV_TEST_DATA_PATH=@prefix@/share/OpenCV/testdata" >> /etc/profile
\ No newline at end of file
install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT libs)
install(FILES ${LBP_CASCADES} DESTINATION share/OpenCV/lbpcascades COMPONENT libs)
endif()
+
+if (OPENCV_TEST_DATA_PATH)
+ if(ANDROID)
+ install(FILES ${OPENCV_TEST_DATA_PATH} DESTINATION sdk/etc/testdata COMPONENT tests)
+ elseif(NOT WIN32)
+ install(FILES ${OPENCV_TEST_DATA_PATH} DESTINATION share/OpenCV/testdata COMPONENT tests)
+ endif()
+endif()
\ No newline at end of file
if (INSTALL_C_EXAMPLES AND NOT WIN32)
file(GLOB C_SAMPLES *.c *.cpp *.jpg *.png *.data makefile.* build_all.sh *.dsp *.cmd )
- install(FILES ${C_SAMPLES}
- DESTINATION share/OpenCV/samples/c
- PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ if (ANDROID)
+ install(FILES ${C_SAMPLES}
+ DESTINATION samples/native/c
+ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ else()
+ install(FILES ${C_SAMPLES}
+ DESTINATION share/OpenCV/samples/c
+ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ endif()
endif ()
if (INSTALL_C_EXAMPLES AND NOT WIN32)
file(GLOB C_SAMPLES *.c *.cpp *.jpg *.png *.data makefile.* build_all.sh *.dsp *.cmd )
- install(FILES ${C_SAMPLES}
- DESTINATION share/OpenCV/samples/cpp
- PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ if (ANDROID)
+ install(FILES ${C_SAMPLES}
+ DESTINATION samples/native/cpp
+ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ else()
+ install(FILES ${C_SAMPLES}
+ DESTINATION share/OpenCV/samples/cpp
+ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ endif()
endif()
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}
- PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ if(ANDROID)
+ install(FILES ${install_list}
+ DESTINATION samples/native/gpu
+ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ else()
+ install(FILES ${install_list}
+ DESTINATION share/OpenCV/samples/gpu
+ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ endif()
endif()
file(GLOB GPU_FILES performance/*.cpp performance/*.h)
install(FILES ${GPU_FILES}
DESTINATION share/OpenCV/samples/gpu/performance
- PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
+ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
+ COMPONENT samples)
endif()
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}
- PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ if(ANDROID)
+ install(FILES ${install_list}
+ DESTINATION samples/native/ocl
+ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ else()
+ install(FILES ${install_list}
+ DESTINATION share/OpenCV/samples/ocl
+ PERMISSIONS OWNER_READ GROUP_READ WORLD_READ COMPONENT samples)
+ endif()
endif()