External_opencv.cmake 3.68 KB
Newer Older
1
#
Julien Michel's avatar
Julien Michel committed
2
# Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#
# This file is part of Orfeo Toolbox
#
#     https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

21
INCLUDE_ONCE_MACRO(OPENCV)
22

23
SETUP_SUPERBUILD(OPENCV)
24

25 26
# declare dependencies
ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OPENCV ZLIB TIFF PNG)
Rashad Kanavath's avatar
Rashad Kanavath committed
27

28 29 30 31 32 33
ADD_SUPERBUILD_CMAKE_VAR(OPENCV ZLIB_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV ZLIB_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV TIFF_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV TIFF_LIBRARY)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV PNG_INCLUDE_DIR)
ADD_SUPERBUILD_CMAKE_VAR(OPENCV PNG_LIBRARY)
Rashad Kanavath's avatar
Rashad Kanavath committed
34

35 36
ExternalProject_Add(OPENCV
  PREFIX OPENCV
37 38
  URL "https://github.com/opencv/opencv/archive/3.4.1.tar.gz"
  URL_MD5 a0b7a47899e67b3490ea31edc4f6e8e6
39 40 41 42 43 44 45 46 47 48 49 50 51 52
  BINARY_DIR ${OPENCV_SB_BUILD_DIR}
  INSTALL_DIR ${SB_INSTALL_PREFIX}
  DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
  CMAKE_CACHE_ARGS
  ${SB_CMAKE_CACHE_ARGS}
  -DBUILD_DOCS:BOOL=OFF
  -DBUILD_EXAMPLES:BOOL=OFF
  -DBUILD_JASPER:BOOL=OFF
  -DWITH_JASPER:BOOL=OFF
  -DBUILD_JPEG:BOOL=OFF
  -DWITH_JPEG:BOOL=OFF
  -DWITH_FFMPEG:BOOL=OFF
  -DWITH_VFW:BOOL=OFF
  -DBUILD_OPENEXR:BOOL=OFF
53
  -DBUILD_PACKAGE:BOOL=OFF
54 55 56 57 58 59
  -DBUILD_PERF_TESTS:BOOL=OFF
  -DBUILD_PNG:BOOL=OFF
  -DBUILD_TBB:BOOL=OFF
  -DBUILD_TESTS:BOOL=OFF
  -DBUILD_TIFF:BOOL=OFF
  -DBUILD_ZLIB:BOOL=OFF
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
  -DWITH_CUDA:BOOL=OFF
  -DWITH_OPENCL:BOOL=OFF
  -DWITH_CUFFT:BOOL=OFF
  -DWITH_GIGEAPI:BOOL=OFF
  -DWITH_GSTREAMER:BOOL=OFF
  -DWITH_GTK:BOOL=OFF
  -DWITH_OPENCLAMDBLAS:BOOL=OFF
  -DWITH_OPENCLAMDFFT:BOOL=OFF
  -DWITH_OPENEXR:BOOL=OFF
  -DWITH_PVAPI:BOOL=OFF
  -DWITH_QT:BOOL=OFF
  -DWITH_UNICAP:BOOL=OFF
  -DWITH_LIBV4L:BOOL=OFF
  -DWITH_V4L:BOOL=OFF
  -DWITH_VTK:BOOL=OFF
  -DWITH_XIMEA:BOOL=OFF
  -DWITH_XINE:BOOL=OFF
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
  -DBUILD_opencv_apps:BOOL=OFF
  -DBUILD_opencv_calib3d:BOOL=OFF
  -DBUILD_opencv_contrib:BOOL=OFF
  -DBUILD_opencv_core:BOOL=ON
  -DBUILD_opencv_features2d:BOOL=OFF
  -DBUILD_opencv_flann:BOOL=OFF
  -DBUILD_opencv_gpu:BOOL=OFF
  -DBUILD_opencv_highgui:BOOL=OFF
  -DBUILD_opencv_imgproc:BOOL=OFF
  -DBUILD_opencv_java:BOOL=OFF
  -DBUILD_opencv_legacy:BOOL=OFF
  -DBUILD_opencv_ml:BOOL=ON
  -DBUILD_opencv_nonfree:BOOL=OFF
  -DBUILD_opencv_objdetect:BOOL=OFF
  -DBUILD_opencv_ocl:BOOL=OFF
  -DBUILD_opencv_photo:BOOL=OFF
  -DBUILD_opencv_python:BOOL=OFF
  -DBUILD_opencv_stitching:BOOL=OFF
  -DBUILD_opencv_superres:BOOL=OFF
  -DBUILD_opencv_ts:BOOL=OFF
  -DBUILD_opencv_video:BOOL=OFF
  -DBUILD_opencv_videostab:BOOL=OFF
  -DBUILD_opencv_world:BOOL=OFF
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
  -DWITH_CUBLAS:BOOL=OFF
  -DWITH_DIRECTX:BOOL=OFF
  -DWITH_DSHOW:BOOL=OFF
  -DWITH_EIGEN:BOOL=OFF
  -DWITH_IPP:BOOL=OFF
  -DWITH_ITT:BOOL=OFF
  -DWITH_LAPACK:BOOL=OFF
  -DWITH_MATLAB:BOOL=OFF
  -DWITH_NVCUVID:BOOL=OFF
  -DWITH_WEBP:BOOL=OFF
  -DWITH_WIN32UI:BOOL=OFF
  -DBUILD_PROTOBUF:BOOL=OFF
  -DBUILD_WEBP:BOOL=OFF
  -DBUILD_opencv_java_bindings_generator:BOOL=OFF
  -DBUILD_opencv_python_bindings_generator:BOOL=OFF
  -DBUILD_opencv_python3:BOOL=OFF
  -DBUILD_opencv_python2:BOOL=OFF
117
  -DCMAKE_INSTALL_LIBDIR:PATH=lib
118 119 120
  ${OPENCV_SB_CONFIG}
  DEPENDS ${OPENCV_DEPENDENCIES}
  CMAKE_COMMAND ${SB_CMAKE_COMMAND}
121
  LOG_DOWNLOAD 1
122 123 124
  LOG_CONFIGURE 1
  LOG_BUILD 1
  LOG_INSTALL 1
125
  )
Rashad Kanavath's avatar
Rashad Kanavath committed
126

127
SUPERBUILD_PATCH_SOURCE(OPENCV)
128

129
set(_SB_OpenCV_DIR ${SB_INSTALL_PREFIX}/share/OpenCV)