CMakeLists.txt 2.45 KB
Newer Older
wester committed
1 2 3
file(GLOB HAAR_CASCADES haarcascades/*.xml)
file(GLOB LBP_CASCADES lbpcascades/*.xml)

wester committed
4 5 6 7 8 9 10
if(ANDROID)
  install(FILES ${HAAR_CASCADES} DESTINATION sdk/etc/haarcascades COMPONENT libs)
  install(FILES ${LBP_CASCADES}  DESTINATION sdk/etc/lbpcascades  COMPONENT libs)
else()
  install(FILES ${HAAR_CASCADES} DESTINATION share/OpenCV/haarcascades COMPONENT libs)
  install(FILES ${LBP_CASCADES}  DESTINATION share/OpenCV/lbpcascades  COMPONENT libs)
endif()
wester committed
11 12

if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
wester committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
  if(ANDROID)
    install(DIRECTORY ${OPENCV_TEST_DATA_PATH} DESTINATION sdk/etc/testdata COMPONENT tests)
  else()
    # CPack does not set correct permissions by default, so we do it explicitly.
    install(DIRECTORY ${OPENCV_TEST_DATA_PATH}
            DIRECTORY_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE
              GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
            DESTINATION share/OpenCV/testdata COMPONENT tests)
    if(BUILD_opencv_python)
	  file(GLOB DATAFILES_CPP ../samples/cpp/left*.jpg)
      list(APPEND DATAFILES_CPP
          "../samples/cpp/board.jpg"
          "../samples/cpp/pic1.png"
          "../samples/cpp/pic6.png"
          "../samples/cpp/right01.jpg"
          "../samples/cpp/right02.jpg"
          "../samples/cpp/building.jpg"
          "../samples/cpp/tsukuba_l.png"
          "../samples/cpp/tsukuba_r.png"
          "../samples/cpp/letter-recognition.data")
      install(FILES ${DATAFILES_CPP} DESTINATION share/OpenCV/testdata/samples/cpp COMPONENT tests)
      set(DATAFILES_C
          "../samples/c/lena.jpg"
          "../samples/c/box.png")
      install(FILES ${DATAFILES_C} DESTINATION share/OpenCV/testdata/samples/c COMPONENT tests)
      set(DATAFILES_GPU
          "../samples/gpu/basketball1.png"
          "../samples/gpu/basketball2.png"
          "../samples/gpu/rubberwhale1.png")
      install(FILES ${DATAFILES_GPU} DESTINATION share/OpenCV/testdata/samples/gpu COMPONENT tests)
      set(DATAFILES_PYTHON
          "../samples/python2/data/graf1.png"
          "../samples/python2/data/pca_test1.jpg"
          "../samples/python2/data/digits.png")
      install(FILES ${DATAFILES_PYTHON} DESTINATION share/OpenCV/testdata/samples/python2/data COMPONENT tests)
      set(DATAFILES_CASCADES
          "haarcascades/haarcascade_frontalface_alt.xml"
          "haarcascades/haarcascade_eye.xml")
      install(FILES ${DATAFILES_CASCADES} DESTINATION share/OpenCV/testdata/data/haarcascades COMPONENT tests)
    endif()
  endif()
endif()