1# ----------------------------------------------------------------------------
2#  Root CMake file for OpenCV
3#
4#    From the off-tree build directory, invoke:
5#      $ cmake <PATH_TO_OPENCV_ROOT>
6#
7# ----------------------------------------------------------------------------
8
9
10
11include(cmake/OpenCVMinDepVersions.cmake)
12
13if(CMAKE_GENERATOR MATCHES Xcode AND XCODE_VERSION VERSION_GREATER 4.3)
14  cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
15elseif(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
16  cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
17  #Required to resolve linker error issues due to incompatibility with CMake v3.0+ policies.
18  #CMake fails to find _fseeko() which leads to subsequent linker error.
19  #See details here: http://www.cmake.org/Wiki/CMake/Policies
20  cmake_policy(VERSION 2.8)
21else()
22  cmake_minimum_required(VERSION "${MIN_VER_CMAKE}" FATAL_ERROR)
23endif()
24
25# Following block can broke build in case of cross-compilng
26# but CMAKE_CROSSCOMPILING variable will be set only on project(OpenCV) command
27# so we will try to detect crosscompiling by presense of CMAKE_TOOLCHAIN_FILE
28if(NOT CMAKE_TOOLCHAIN_FILE)
29  # it _must_ go before project(OpenCV) in order to work
30  if(WIN32)
31    set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
32  else()
33    set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory")
34  endif()
35else(NOT CMAKE_TOOLCHAIN_FILE)
36  #Android: set output folder to ${CMAKE_BINARY_DIR}
37  set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are compiled to" )
38  # any crosscompiling
39  set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
40endif(NOT CMAKE_TOOLCHAIN_FILE)
41
42if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
43  set(WINRT TRUE)
44endif(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore)
45
46if(WINRT)
47  add_definitions(-DWINRT -DNO_GETENV)
48
49  # Making definitions available to other configurations and
50  # to filter dependency restrictions at compile time.
51  if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone)
52    set(WINRT_PHONE TRUE)
53    add_definitions(-DWINRT_PHONE)
54  elseif(CMAKE_SYSTEM_NAME MATCHES WindowsStore)
55    set(WINRT_STORE TRUE)
56    add_definitions(-DWINRT_STORE)
57  endif()
58
59  if(CMAKE_SYSTEM_VERSION MATCHES 8.1)
60    set(WINRT_8_1 TRUE)
61    add_definitions(-DWINRT_8_1)
62  elseif(CMAKE_SYSTEM_VERSION MATCHES 8.0)
63    set(WINRT_8_0 TRUE)
64    add_definitions(-DWINRT_8_0)
65  endif()
66endif()
67
68if(POLICY CMP0022)
69  cmake_policy(SET CMP0022 OLD)
70endif()
71
72if(POLICY CMP0026)
73  # silence cmake 3.0+ warnings about reading LOCATION attribute
74  cmake_policy(SET CMP0026 OLD)
75endif()
76
77if (POLICY CMP0042)
78  # silence cmake 3.0+ warnings about MACOSX_RPATH
79  cmake_policy(SET CMP0042 OLD)
80endif()
81
82# must go before the project command
83set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
84if(DEFINED CMAKE_BUILD_TYPE)
85  set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
86endif()
87
88project(OpenCV CXX C)
89
90if(MSVC)
91  set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
92endif()
93
94include(cmake/OpenCVUtils.cmake)
95
96ocv_clear_vars(OpenCVModules_TARGETS)
97
98# ----------------------------------------------------------------------------
99# Break in case of popular CMake configuration mistakes
100# ----------------------------------------------------------------------------
101if(NOT CMAKE_SIZEOF_VOID_P GREATER 0)
102  message(FATAL_ERROR "CMake fails to deterimine the bitness of target platform.
103  Please check your CMake and compiler installation. If you are crosscompiling then ensure that your CMake toolchain file correctly sets the compiler details.")
104endif()
105
106# ----------------------------------------------------------------------------
107# Detect compiler and target platform architecture
108# ----------------------------------------------------------------------------
109include(cmake/OpenCVDetectCXXCompiler.cmake)
110
111# Add these standard paths to the search paths for FIND_LIBRARY
112# to find libraries from these locations first
113if(UNIX AND NOT ANDROID)
114  if(X86_64 OR CMAKE_SIZEOF_VOID_P EQUAL 8)
115    if(EXISTS /lib64)
116      list(APPEND CMAKE_LIBRARY_PATH /lib64)
117    else()
118      list(APPEND CMAKE_LIBRARY_PATH /lib)
119    endif()
120    if(EXISTS /usr/lib64)
121      list(APPEND CMAKE_LIBRARY_PATH /usr/lib64)
122    else()
123      list(APPEND CMAKE_LIBRARY_PATH /usr/lib)
124    endif()
125  elseif(X86 OR CMAKE_SIZEOF_VOID_P EQUAL 4)
126    if(EXISTS /lib32)
127      list(APPEND CMAKE_LIBRARY_PATH /lib32)
128    else()
129      list(APPEND CMAKE_LIBRARY_PATH /lib)
130    endif()
131    if(EXISTS /usr/lib32)
132      list(APPEND CMAKE_LIBRARY_PATH /usr/lib32)
133    else()
134      list(APPEND CMAKE_LIBRARY_PATH /usr/lib)
135    endif()
136  endif()
137endif()
138
139# Add these standard paths to the search paths for FIND_PATH
140# to find include files from these locations first
141if(MINGW)
142  if(EXISTS /mingw)
143      list(APPEND CMAKE_INCLUDE_PATH /mingw)
144  endif()
145  if(EXISTS /mingw32)
146      list(APPEND CMAKE_INCLUDE_PATH /mingw32)
147  endif()
148  if(EXISTS /mingw64)
149      list(APPEND CMAKE_INCLUDE_PATH /mingw64)
150  endif()
151endif()
152
153# ----------------------------------------------------------------------------
154# OpenCV cmake options
155# ----------------------------------------------------------------------------
156
157# Optional 3rd party components
158# ===================================================
159OCV_OPTION(WITH_1394           "Include IEEE1394 support"                    ON   IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
160OCV_OPTION(WITH_AVFOUNDATION   "Use AVFoundation for Video I/O"              ON   IF IOS)
161OCV_OPTION(WITH_CARBON         "Use Carbon for UI instead of Cocoa"          OFF  IF APPLE )
162OCV_OPTION(WITH_VTK            "Include VTK library support (and build opencv_viz module eiher)"             ON  IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
163OCV_OPTION(WITH_CUDA           "Include NVidia Cuda Runtime support"                                         ON  IF (NOT IOS AND NOT WINRT) )
164OCV_OPTION(WITH_CUFFT          "Include NVidia Cuda Fast Fourier Transform (FFT) library support"            ON  IF (NOT IOS AND NOT WINRT) )
165OCV_OPTION(WITH_CUBLAS         "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (NOT IOS AND NOT WINRT) )
166OCV_OPTION(WITH_NVCUVID        "Include NVidia Video Decoding library support"                               OFF IF (NOT IOS AND NOT APPLE) )
167OCV_OPTION(WITH_EIGEN          "Include Eigen2/Eigen3 support"               ON   IF (NOT WINRT) )
168OCV_OPTION(WITH_VFW            "Include Video for Windows support"           ON   IF WIN32 )
169OCV_OPTION(WITH_FFMPEG         "Include FFMPEG support"                      ON   IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
170OCV_OPTION(WITH_GSTREAMER      "Include Gstreamer support"                   ON   IF (UNIX AND NOT ANDROID) )
171OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)"                              OFF )
172OCV_OPTION(WITH_GTK            "Include GTK support"                         ON   IF (UNIX AND NOT APPLE AND NOT ANDROID) )
173OCV_OPTION(WITH_GTK_2_X        "Use GTK version 2"                           OFF  IF (UNIX AND NOT APPLE AND NOT ANDROID) )
174OCV_OPTION(WITH_IPP            "Include Intel IPP support"                   ON   IF (X86_64 OR X86) AND NOT WINRT)
175OCV_OPTION(WITH_JASPER         "Include JPEG2K support"                      ON   IF (NOT IOS) )
176OCV_OPTION(WITH_JPEG           "Include JPEG support"                        ON)
177OCV_OPTION(WITH_WEBP           "Include WebP support"                        ON   IF (NOT IOS AND NOT WINRT) )
178OCV_OPTION(WITH_OPENEXR        "Include ILM support via OpenEXR"             ON   IF (NOT IOS AND NOT WINRT) )
179OCV_OPTION(WITH_OPENGL         "Include OpenGL support"                      OFF  IF (NOT ANDROID AND NOT WINRT) )
180OCV_OPTION(WITH_OPENNI         "Include OpenNI support"                      OFF  IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
181OCV_OPTION(WITH_OPENNI2        "Include OpenNI2 support"                     OFF  IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
182OCV_OPTION(WITH_PNG            "Include PNG support"                         ON)
183OCV_OPTION(WITH_PVAPI          "Include Prosilica GigE support"              ON   IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
184OCV_OPTION(WITH_GIGEAPI        "Include Smartek GigE support"                ON   IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
185OCV_OPTION(WITH_QT             "Build with Qt Backend support"               OFF  IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
186OCV_OPTION(WITH_WIN32UI        "Build with Win32 UI Backend support"         ON   IF WIN32 AND NOT WINRT)
187OCV_OPTION(WITH_QUICKTIME      "Use QuickTime for Video I/O insted of QTKit" OFF  IF APPLE )
188OCV_OPTION(WITH_TBB            "Include Intel TBB support"                   OFF  IF (NOT IOS AND NOT WINRT) )
189OCV_OPTION(WITH_OPENMP         "Include OpenMP support"                      OFF)
190OCV_OPTION(WITH_CSTRIPES       "Include C= support"                          OFF  IF (WIN32 AND NOT WINRT)  )
191OCV_OPTION(WITH_PTHREADS_PF    "Use pthreads-based parallel_for"             OFF  IF (NOT WIN32) )
192OCV_OPTION(WITH_TIFF           "Include TIFF support"                        ON   IF (NOT IOS) )
193OCV_OPTION(WITH_UNICAP         "Include Unicap support (GPL)"                OFF  IF (UNIX AND NOT APPLE AND NOT ANDROID) )
194OCV_OPTION(WITH_V4L            "Include Video 4 Linux support"               ON   IF (UNIX AND NOT ANDROID) )
195OCV_OPTION(WITH_LIBV4L         "Use libv4l for Video 4 Linux support"        ON   IF (UNIX AND NOT ANDROID) )
196OCV_OPTION(WITH_DSHOW          "Build VideoIO with DirectShow support"       ON   IF (WIN32 AND NOT ARM AND NOT WINRT) )
197OCV_OPTION(WITH_MSMF           "Build VideoIO with Media Foundation support" OFF  IF WIN32 )
198OCV_OPTION(WITH_XIMEA          "Include XIMEA cameras support"               OFF  IF (NOT ANDROID AND NOT WINRT) )
199OCV_OPTION(WITH_XINE           "Include Xine support (GPL)"                  OFF  IF (UNIX AND NOT APPLE AND NOT ANDROID) )
200OCV_OPTION(WITH_CLP            "Include Clp support (EPL)"                   OFF)
201OCV_OPTION(WITH_OPENCL         "Include OpenCL Runtime support"              NOT ANDROID IF (NOT IOS AND NOT WINRT) )
202OCV_OPTION(WITH_OPENCL_SVM     "Include OpenCL Shared Virtual Memory support" OFF ) # experimental
203OCV_OPTION(WITH_OPENCLAMDFFT   "Include AMD OpenCL FFT library support"      ON   IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
204OCV_OPTION(WITH_OPENCLAMDBLAS  "Include AMD OpenCL BLAS library support"     ON   IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
205OCV_OPTION(WITH_DIRECTX        "Include DirectX support"                     ON   IF (WIN32 AND NOT WINRT) )
206OCV_OPTION(WITH_INTELPERC      "Include Intel Perceptual Computing support"  OFF  IF (WIN32 AND NOT WINRT) )
207OCV_OPTION(WITH_IPP_A          "Include Intel IPP_A support"                 OFF  IF (MSVC OR X86 OR X86_64) )
208OCV_OPTION(WITH_GDAL           "Include GDAL Support"                        OFF  IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
209OCV_OPTION(WITH_GPHOTO2        "Include gPhoto2 library support"             ON   IF (UNIX AND NOT ANDROID) )
210
211# OpenCV build components
212# ===================================================
213OCV_OPTION(BUILD_SHARED_LIBS        "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" NOT (ANDROID OR IOS) )
214OCV_OPTION(BUILD_opencv_apps        "Build utility applications (used for example to train classifiers)" (NOT ANDROID AND NOT WINRT) IF (NOT IOS) )
215OCV_OPTION(BUILD_ANDROID_EXAMPLES   "Build examples for Android platform"         ON  IF ANDROID )
216OCV_OPTION(BUILD_DOCS               "Create build rules for OpenCV Documentation" ON  IF NOT WINRT)
217OCV_OPTION(BUILD_EXAMPLES           "Build all examples"                          OFF )
218OCV_OPTION(BUILD_PACKAGE            "Enables 'make package_source' command"       ON  IF NOT WINRT)
219OCV_OPTION(BUILD_PERF_TESTS         "Build performance tests"                     ON  IF (NOT IOS AND NOT WINRT) )
220OCV_OPTION(BUILD_TESTS              "Build accuracy & regression tests"           ON  IF (NOT IOS AND NOT WINRT) )
221OCV_OPTION(BUILD_WITH_DEBUG_INFO    "Include debug info into debug libs (not MSCV only)" ON )
222OCV_OPTION(BUILD_WITH_STATIC_CRT    "Enables use of staticaly linked CRT for staticaly linked OpenCV" ON IF MSVC )
223OCV_OPTION(BUILD_WITH_DYNAMIC_IPP   "Enables dynamic linking of IPP (only for standalone IPP)" OFF )
224OCV_OPTION(BUILD_FAT_JAVA_LIB       "Create fat java wrapper containing the whole OpenCV library" ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX )
225OCV_OPTION(BUILD_ANDROID_SERVICE    "Build OpenCV Manager for Google Play" OFF IF ANDROID )
226OCV_OPTION(BUILD_CUDA_STUBS         "Build CUDA modules stubs when no CUDA SDK" OFF  IF (NOT IOS) )
227
228# 3rd party libs
229OCV_OPTION(BUILD_ZLIB               "Build zlib from source"             WIN32 OR APPLE )
230OCV_OPTION(BUILD_TIFF               "Build libtiff from source"          WIN32 OR ANDROID OR APPLE )
231OCV_OPTION(BUILD_JASPER             "Build libjasper from source"        WIN32 OR ANDROID OR APPLE )
232OCV_OPTION(BUILD_JPEG               "Build libjpeg from source"          WIN32 OR ANDROID OR APPLE )
233OCV_OPTION(BUILD_PNG                "Build libpng from source"           WIN32 OR ANDROID OR APPLE )
234OCV_OPTION(BUILD_OPENEXR            "Build openexr from source"          (WIN32 OR ANDROID OR APPLE) AND NOT WINRT)
235OCV_OPTION(BUILD_TBB                "Download and build TBB from source" ANDROID )
236
237# OpenCV installation options
238# ===================================================
239OCV_OPTION(INSTALL_CREATE_DISTRIB   "Change install rules to build the distribution package" OFF )
240OCV_OPTION(INSTALL_C_EXAMPLES       "Install C examples"        OFF )
241OCV_OPTION(INSTALL_PYTHON_EXAMPLES  "Install Python examples"   OFF )
242OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples"  OFF IF ANDROID )
243OCV_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) )
244OCV_OPTION(INSTALL_TESTS            "Install accuracy and performance test binaries and test data" OFF)
245
246# OpenCV build options
247# ===================================================
248OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers"                                  ON   IF (NOT IOS) )
249OCV_OPTION(ENABLE_SOLUTION_FOLDERS    "Solution folder in Visual Studio or in other IDEs"        (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) )
250OCV_OPTION(ENABLE_PROFILING           "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF  IF CMAKE_COMPILER_IS_GNUCXX )
251OCV_OPTION(ENABLE_COVERAGE            "Enable coverage collection with  GCov"                    OFF  IF CMAKE_COMPILER_IS_GNUCXX )
252OCV_OPTION(ENABLE_OMIT_FRAME_POINTER  "Enable -fomit-frame-pointer for GCC"                      ON   IF CMAKE_COMPILER_IS_GNUCXX AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX) )
253OCV_OPTION(ENABLE_POWERPC             "Enable PowerPC for GCC"                                   ON   IF (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
254OCV_OPTION(ENABLE_FAST_MATH           "Enable -ffast-math (not recommended for GCC 4.6.x)"       OFF  IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
255OCV_OPTION(ENABLE_SSE                 "Enable SSE instructions"                                  ON   IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
256OCV_OPTION(ENABLE_SSE2                "Enable SSE2 instructions"                                 ON   IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
257OCV_OPTION(ENABLE_SSE3                "Enable SSE3 instructions"                                 ON   IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) AND (X86 OR X86_64)) )
258OCV_OPTION(ENABLE_SSSE3               "Enable SSSE3 instructions"                                OFF  IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
259OCV_OPTION(ENABLE_SSE41               "Enable SSE4.1 instructions"                               OFF  IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) AND (X86 OR X86_64)) )
260OCV_OPTION(ENABLE_SSE42               "Enable SSE4.2 instructions"                               OFF  IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
261OCV_OPTION(ENABLE_POPCNT              "Enable POPCNT instructions"                               OFF  IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
262OCV_OPTION(ENABLE_AVX                 "Enable AVX instructions"                                  OFF  IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
263OCV_OPTION(ENABLE_AVX2                "Enable AVX2 instructions"                                 OFF  IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
264OCV_OPTION(ENABLE_FMA3                "Enable FMA3 instructions"                                 OFF  IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
265OCV_OPTION(ENABLE_NEON                "Enable NEON instructions"                                 OFF  IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64 OR IOS) )
266OCV_OPTION(ENABLE_VFPV3               "Enable VFPv3-D32 instructions"                            OFF  IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64 OR IOS) )
267OCV_OPTION(ENABLE_NOISY_WARNINGS      "Show all warnings even if they are too noisy"             OFF )
268OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors"                                 OFF )
269OCV_OPTION(ANDROID_EXAMPLES_WITH_LIBS "Build binaries of Android examples with native libraries" OFF  IF ANDROID )
270OCV_OPTION(ENABLE_IMPL_COLLECTION     "Collect implementation data on function call"             OFF )
271OCV_OPTION(GENERATE_ABI_DESCRIPTOR    "Generate XML file for abi_compliance_checker tool" OFF IF UNIX)
272
273if(ENABLE_IMPL_COLLECTION)
274  add_definitions(-DCV_COLLECT_IMPL_DATA)
275endif()
276
277
278# ----------------------------------------------------------------------------
279#  Get actual OpenCV version number from sources
280# ----------------------------------------------------------------------------
281include(cmake/OpenCVVersion.cmake)
282
283
284# ----------------------------------------------------------------------------
285#  Build & install layouts
286# ----------------------------------------------------------------------------
287
288# Save libs and executables in the same place
289set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Output directory for applications" )
290
291if (ANDROID)
292  if (ANDROID_ABI MATCHES "NEON")
293    set(ENABLE_NEON ON)
294  endif()
295  if (ANDROID_ABI MATCHES "VFPV3")
296    set(ENABLE_VFPV3 ON)
297  endif()
298endif()
299
300if(ANDROID OR WIN32)
301  set(OPENCV_DOC_INSTALL_PATH doc)
302else()
303  set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
304endif()
305
306if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
307  if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH)
308    set(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/")
309  else()
310    message(STATUS "Can't detect runtime and/or arch")
311    set(OpenCV_INSTALL_BINARIES_PREFIX "")
312  endif()
313elseif(ANDROID)
314  set(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/")
315else()
316  set(OpenCV_INSTALL_BINARIES_PREFIX "")
317endif()
318
319if(ANDROID)
320  set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples/${ANDROID_NDK_ABI_NAME}")
321else()
322  set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")
323endif()
324
325if(ANDROID)
326  set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin/${ANDROID_NDK_ABI_NAME}")
327else()
328  set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")
329endif()
330
331if(NOT OPENCV_TEST_INSTALL_PATH)
332  set(OPENCV_TEST_INSTALL_PATH "${OPENCV_BIN_INSTALL_PATH}")
333endif()
334
335if (OPENCV_TEST_DATA_PATH)
336  get_filename_component(OPENCV_TEST_DATA_PATH ${OPENCV_TEST_DATA_PATH} ABSOLUTE)
337endif()
338
339if(OPENCV_TEST_DATA_PATH AND NOT OPENCV_TEST_DATA_INSTALL_PATH)
340  if(ANDROID)
341    set(OPENCV_TEST_DATA_INSTALL_PATH "sdk/etc/testdata")
342  elseif(WIN32)
343    set(OPENCV_TEST_DATA_INSTALL_PATH "testdata")
344  else()
345    set(OPENCV_TEST_DATA_INSTALL_PATH "share/OpenCV/testdata")
346  endif()
347endif()
348
349if(ANDROID)
350  set(LIBRARY_OUTPUT_PATH         "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
351  set(3P_LIBRARY_OUTPUT_PATH      "${OpenCV_BINARY_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}")
352  set(OPENCV_LIB_INSTALL_PATH     sdk/native/libs/${ANDROID_NDK_ABI_NAME})
353  set(OPENCV_3P_LIB_INSTALL_PATH  sdk/native/3rdparty/libs/${ANDROID_NDK_ABI_NAME})
354  set(OPENCV_CONFIG_INSTALL_PATH  sdk/native/jni)
355  set(OPENCV_INCLUDE_INSTALL_PATH sdk/native/jni/include)
356  set(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native)
357  set(OPENCV_OTHER_INSTALL_PATH   sdk/etc)
358else()
359  set(LIBRARY_OUTPUT_PATH         "${OpenCV_BINARY_DIR}/lib")
360  set(3P_LIBRARY_OUTPUT_PATH      "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
361
362  if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
363    if(OpenCV_STATIC)
364      set(OPENCV_LIB_INSTALL_PATH   "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
365    else()
366      set(OPENCV_LIB_INSTALL_PATH   "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}")
367    endif()
368    set(OPENCV_3P_LIB_INSTALL_PATH  "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
369    set(OPENCV_SAMPLES_SRC_INSTALL_PATH    samples/native)
370    set(OPENCV_JAR_INSTALL_PATH java)
371    set(OPENCV_OTHER_INSTALL_PATH   etc)
372  else()
373    set(OPENCV_LIB_INSTALL_PATH     lib${LIB_SUFFIX})
374    set(OPENCV_3P_LIB_INSTALL_PATH  share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
375    set(OPENCV_SAMPLES_SRC_INSTALL_PATH    share/OpenCV/samples)
376    set(OPENCV_JAR_INSTALL_PATH share/OpenCV/java)
377    set(OPENCV_OTHER_INSTALL_PATH   share/OpenCV)
378  endif()
379  set(OPENCV_INCLUDE_INSTALL_PATH "include")
380
381  math(EXPR SIZEOF_VOID_P_BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
382  if(LIB_SUFFIX AND NOT SIZEOF_VOID_P_BITS EQUAL LIB_SUFFIX)
383    set(OPENCV_CONFIG_INSTALL_PATH lib${LIB_SUFFIX}/cmake/opencv)
384  else()
385    set(OPENCV_CONFIG_INSTALL_PATH share/OpenCV)
386  endif()
387endif()
388
389set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
390set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
391
392if(INSTALL_TO_MANGLED_PATHS)
393  set(OPENCV_INCLUDE_INSTALL_PATH ${OPENCV_INCLUDE_INSTALL_PATH}/opencv-${OPENCV_VERSION})
394  string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_3P_LIB_INSTALL_PATH "${OPENCV_3P_LIB_INSTALL_PATH}")
395  string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_SAMPLES_SRC_INSTALL_PATH "${OPENCV_SAMPLES_SRC_INSTALL_PATH}")
396  string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_CONFIG_INSTALL_PATH "${OPENCV_CONFIG_INSTALL_PATH}")
397  string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_DOC_INSTALL_PATH "${OPENCV_DOC_INSTALL_PATH}")
398  string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_JAR_INSTALL_PATH "${OPENCV_JAR_INSTALL_PATH}")
399  string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_TEST_DATA_INSTALL_PATH "${OPENCV_TEST_DATA_INSTALL_PATH}")
400  string(REPLACE "OpenCV" "OpenCV-${OPENCV_VERSION}" OPENCV_OTHER_INSTALL_PATH "${OPENCV_OTHER_INSTALL_PATH}")
401endif()
402
403
404if(WIN32)
405  # Postfix of DLLs:
406  set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}")
407  set(OPENCV_DEBUG_POSTFIX d)
408else()
409  # Postfix of so's:
410  set(OPENCV_DLLVERSION "")
411  set(OPENCV_DEBUG_POSTFIX "")
412endif()
413
414if(DEFINED CMAKE_DEBUG_POSTFIX)
415  set(OPENCV_DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
416endif()
417
418if(INSTALL_CREATE_DISTRIB AND BUILD_SHARED_LIBS AND NOT DEFINED BUILD_opencv_world)
419  set(BUILD_opencv_world ON CACHE INTERNAL "")
420endif()
421
422# ----------------------------------------------------------------------------
423#  Path for build/platform -specific headers
424# ----------------------------------------------------------------------------
425set(OPENCV_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to create the platform-dependant cvconfig.h")
426ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
427
428# ----------------------------------------------------------------------------
429#  Path for additional modules
430# ----------------------------------------------------------------------------
431set(OPENCV_EXTRA_MODULES_PATH "" CACHE PATH "Where to look for additional OpenCV modules")
432
433# ----------------------------------------------------------------------------
434#  Autodetect if we are in a GIT repository
435# ----------------------------------------------------------------------------
436find_host_package(Git QUIET)
437
438if(GIT_FOUND)
439  execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*"
440    WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
441    OUTPUT_VARIABLE OPENCV_VCSVERSION
442    RESULT_VARIABLE GIT_RESULT
443    ERROR_QUIET
444    OUTPUT_STRIP_TRAILING_WHITESPACE
445  )
446  if(NOT GIT_RESULT EQUAL 0)
447    set(OPENCV_VCSVERSION "unknown")
448  endif()
449else()
450  # We don't have git:
451  set(OPENCV_VCSVERSION "unknown")
452endif()
453
454
455# ----------------------------------------------------------------------------
456# OpenCV compiler and linker options
457# ----------------------------------------------------------------------------
458# In case of Makefiles if the user does not setup CMAKE_BUILD_TYPE, assume it's Release:
459if(CMAKE_GENERATOR MATCHES "Makefiles|Ninja" AND "${CMAKE_BUILD_TYPE}" STREQUAL "")
460  set(CMAKE_BUILD_TYPE Release)
461endif()
462
463include(cmake/OpenCVCompilerOptions.cmake)
464
465
466# ----------------------------------------------------------------------------
467# Use statically or dynamically linked CRT?
468# Default: dynamic
469# ----------------------------------------------------------------------------
470if(MSVC)
471  include(cmake/OpenCVCRTLinkage.cmake)
472endif(MSVC)
473
474if(WIN32 AND NOT MINGW)
475  add_definitions(-D_VARIADIC_MAX=10)
476endif(WIN32 AND NOT MINGW)
477
478
479# ----------------------------------------------------------------------------
480#       CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
481# ----------------------------------------------------------------------------
482if(UNIX)
483  find_package(PkgConfig QUIET)
484  include(CheckFunctionExists)
485  include(CheckIncludeFile)
486
487  if(NOT APPLE)
488    CHECK_INCLUDE_FILE(pthread.h HAVE_LIBPTHREAD)
489    if(ANDROID)
490      set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
491    elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|DragonFly")
492      set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m pthread)
493    elseif(EMSCRIPTEN)
494      # no need to link to system libs with emscripten
495    else()
496      set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m pthread rt)
497    endif()
498  else()
499    set(HAVE_LIBPTHREAD YES)
500  endif()
501endif()
502
503include(cmake/OpenCVPCHSupport.cmake)
504include(cmake/OpenCVModule.cmake)
505
506# ----------------------------------------------------------------------------
507#  Detect endianness of build platform
508# ----------------------------------------------------------------------------
509
510if(IOS)
511  # test_big_endian needs try_compile, which doesn't work for iOS
512  # http://public.kitware.com/Bug/view.php?id=12288
513  set(WORDS_BIGENDIAN 0)
514else()
515  include(TestBigEndian)
516  test_big_endian(WORDS_BIGENDIAN)
517endif()
518
519# ----------------------------------------------------------------------------
520#  Detect 3rd-party libraries
521# ----------------------------------------------------------------------------
522
523include(cmake/OpenCVFindLibsGrfmt.cmake)
524include(cmake/OpenCVFindLibsGUI.cmake)
525include(cmake/OpenCVFindLibsVideo.cmake)
526include(cmake/OpenCVFindLibsPerf.cmake)
527
528# ----------------------------------------------------------------------------
529#  Detect other 3rd-party libraries/tools
530# ----------------------------------------------------------------------------
531
532# --- Doxygen and PlantUML for documentation ---
533unset(DOXYGEN_FOUND CACHE)
534if(BUILD_DOCS)
535  find_package(Doxygen)
536  if (PLANTUML_JAR)
537    message(STATUS "Using PlantUML path from command line: ${PLANTUML_JAR}")
538  elseif(DEFINED ENV{PLANTUML_JAR})
539    set(PLANTUML_JAR $ENV{PLANTUML_JAR})
540    message(STATUS "Using PLantUML path from environment: ${PLANTUML_JAR}")
541  else()
542    message(STATUS "To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake")
543  endif()
544  if (PLANTUML_JAR AND DOXYGEN_VERSION VERSION_LESS 1.8.8)
545    message(STATUS "You need Doxygen version 1.8.8 or later to use PlantUML")
546    unset(PLANTUML_JAR)
547  endif()
548endif(BUILD_DOCS)
549
550# --- Python Support ---
551include(cmake/OpenCVDetectPython.cmake)
552
553# --- Java Support ---
554include(cmake/OpenCVDetectApacheAnt.cmake)
555if(ANDROID)
556  include(cmake/OpenCVDetectAndroidSDK.cmake)
557
558  if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
559    message(WARNING "OpenCV requires Android SDK tools revision 14 or newer. Otherwise tests and samples will no be compiled.")
560  endif()
561else()
562  find_package(JNI)
563endif()
564
565if(ANDROID AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND (ANT_VERSION VERSION_GREATER 1.7) AND (ANDROID_TOOLS_Pkg_Revision GREATER 13))
566  SET(CAN_BUILD_ANDROID_PROJECTS TRUE)
567else()
568  SET(CAN_BUILD_ANDROID_PROJECTS FALSE)
569endif()
570
571# --- OpenCL ---
572if(WITH_OPENCL)
573  include(cmake/OpenCVDetectOpenCL.cmake)
574endif()
575
576# --- DirectX ---
577if(WITH_DIRECTX)
578  include(cmake/OpenCVDetectDirectX.cmake)
579endif()
580
581# --- Matlab/Octave ---
582include(cmake/OpenCVFindMatlab.cmake)
583
584include(cmake/OpenCVDetectVTK.cmake)
585
586# ----------------------------------------------------------------------------
587# Add CUDA libraries (needed for apps/tools, samples)
588# ----------------------------------------------------------------------------
589if(HAVE_CUDA)
590  set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
591  if(HAVE_CUBLAS)
592    set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cublas_LIBRARY})
593  endif()
594  if(HAVE_CUFFT)
595    set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cufft_LIBRARY})
596  endif()
597endif()
598# ----------------------------------------------------------------------------
599# Solution folders:
600# ----------------------------------------------------------------------------
601if(ENABLE_SOLUTION_FOLDERS)
602  set_property(GLOBAL PROPERTY USE_FOLDERS ON)
603  set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets")
604endif()
605
606# Extra OpenCV targets: uninstall, package_source, perf, etc.
607include(cmake/OpenCVExtraTargets.cmake)
608
609
610# ----------------------------------------------------------------------------
611# Process subdirectories
612# ----------------------------------------------------------------------------
613
614# opencv.hpp and legacy headers
615add_subdirectory(include)
616
617# OpenCV modules
618add_subdirectory(modules)
619
620# Generate targets for documentation
621add_subdirectory(doc)
622
623# various data that is used by cv libraries and/or demo applications.
624add_subdirectory(data)
625
626# extra applications
627if(BUILD_opencv_apps)
628  add_subdirectory(apps)
629endif()
630
631# examples
632if(BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES)
633  add_subdirectory(samples)
634endif()
635
636if(ANDROID)
637  add_subdirectory(platforms/android/service)
638endif()
639
640# ----------------------------------------------------------------------------
641# Finalization: generate configuration-based files
642# ----------------------------------------------------------------------------
643
644# Generate platform-dependent and configuration-dependent headers
645include(cmake/OpenCVGenHeaders.cmake)
646
647# Generate opencv.pc for pkg-config command
648include(cmake/OpenCVGenPkgconfig.cmake)
649
650# Generate OpenCV.mk for ndk-build (Android build tool)
651include(cmake/OpenCVGenAndroidMK.cmake)
652
653# Generate OpenCVСonfig.cmake and OpenCVConfig-version.cmake for cmake projects
654include(cmake/OpenCVGenConfig.cmake)
655
656# Generate Info.plist for the IOS framework
657include(cmake/OpenCVGenInfoPlist.cmake)
658
659# Generate ABI descriptor
660include(cmake/OpenCVGenABI.cmake)
661
662# Generate environment setup file
663if(INSTALL_TESTS AND OPENCV_TEST_DATA_PATH)
664  if(ANDROID)
665    get_filename_component(TEST_PATH ${OPENCV_TEST_INSTALL_PATH} DIRECTORY)
666    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_android.sh.in"
667                   "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
668    install(PROGRAMS "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
669            DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT tests)
670  elseif(WIN32)
671    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_windows.cmd.in"
672                   "${CMAKE_BINARY_DIR}/win-install/opencv_run_all_tests.cmd" @ONLY)
673    install(PROGRAMS "${CMAKE_BINARY_DIR}/win-install/opencv_run_all_tests.cmd"
674            DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
675  elseif(UNIX)
676    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/opencv_run_all_tests_unix.sh.in"
677                   "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh" @ONLY)
678    install(PROGRAMS "${CMAKE_BINARY_DIR}/unix-install/opencv_run_all_tests.sh"
679            DESTINATION ${OPENCV_TEST_INSTALL_PATH} COMPONENT tests)
680  endif()
681endif()
682
683if(NOT OPENCV_README_FILE)
684  if(ANDROID)
685    set(OPENCV_README_FILE ${CMAKE_CURRENT_SOURCE_DIR}/platforms/android/README.android)
686  endif()
687endif()
688
689if(NOT OPENCV_LICENSE_FILE)
690  set(OPENCV_LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
691endif()
692
693# for UNIX it does not make sense as LICENSE and readme will be part of the package automatically
694if(ANDROID OR NOT UNIX)
695  install(FILES ${OPENCV_LICENSE_FILE}
696        PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
697        DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT libs)
698  if(OPENCV_README_FILE)
699    install(FILES ${OPENCV_README_FILE}
700            PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
701            DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT libs)
702  endif()
703endif()
704
705# ----------------------------------------------------------------------------
706# Summary:
707# ----------------------------------------------------------------------------
708status("")
709status("General configuration for OpenCV ${OPENCV_VERSION} =====================================")
710if(OPENCV_VCSVERSION)
711  status("  Version control:" ${OPENCV_VCSVERSION})
712endif()
713
714# ========================== build platform ==========================
715status("")
716status("  Platform:")
717status("    Host:"             ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
718if(CMAKE_CROSSCOMPILING)
719  status("    Target:"         ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})
720endif()
721status("    CMake:"            ${CMAKE_VERSION})
722status("    CMake generator:"  ${CMAKE_GENERATOR})
723status("    CMake build tool:" ${CMAKE_BUILD_TOOL})
724if(MSVC)
725  status("    MSVC:"           ${MSVC_VERSION})
726endif()
727if(CMAKE_GENERATOR MATCHES Xcode)
728  status("    Xcode:"          ${XCODE_VERSION})
729endif()
730if(NOT CMAKE_GENERATOR MATCHES "Xcode|Visual Studio")
731  status("    Configuration:"  ${CMAKE_BUILD_TYPE})
732endif()
733
734# ========================== C/C++ options ==========================
735if(CMAKE_CXX_COMPILER_VERSION)
736  set(OPENCV_COMPILER_STR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} (ver ${CMAKE_CXX_COMPILER_VERSION})")
737elseif(CMAKE_COMPILER_IS_CLANGCXX)
738  set(OPENCV_COMPILER_STR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} (ver ${CMAKE_CLANG_REGEX_VERSION})")
739elseif(CMAKE_COMPILER_IS_GNUCXX)
740  set(OPENCV_COMPILER_STR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} (ver ${CMAKE_GCC_REGEX_VERSION})")
741else()
742  set(OPENCV_COMPILER_STR "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}")
743endif()
744string(STRIP "${OPENCV_COMPILER_STR}" OPENCV_COMPILER_STR)
745
746status("")
747status("  C/C++:")
748status("    Built as dynamic libs?:" BUILD_SHARED_LIBS THEN YES ELSE NO)
749status("    C++ Compiler:"           ${OPENCV_COMPILER_STR})
750status("    C++ flags (Release):"    ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
751status("    C++ flags (Debug):"      ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
752status("    C Compiler:"             ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
753status("    C flags (Release):"      ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE})
754status("    C flags (Debug):"        ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG})
755if(WIN32)
756  status("    Linker flags (Release):" ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE})
757  status("    Linker flags (Debug):"   ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG})
758else()
759  status("    Linker flags (Release):" ${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_RELEASE})
760  status("    Linker flags (Debug):"   ${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_DEBUG})
761endif()
762status("    Precompiled headers:"     PCHSupport_FOUND AND ENABLE_PRECOMPILED_HEADERS THEN YES ELSE NO)
763
764# ========================== Dependencies ============================
765ocv_get_all_libs(deps_modules deps_extra deps_3rdparty)
766status("    Extra dependencies:" ${deps_extra})
767status("    3rdparty dependencies:" ${deps_3rdparty})
768
769# ========================== OpenCV modules ==========================
770status("")
771status("  OpenCV modules:")
772string(REPLACE "opencv_" "" OPENCV_MODULES_BUILD_ST          "${OPENCV_MODULES_BUILD}")
773string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_USER_ST  "${OPENCV_MODULES_DISABLED_USER}")
774string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_FORCE_ST "${OPENCV_MODULES_DISABLED_FORCE}")
775set(OPENCV_MODULES_DISABLED_AUTO_ST "")
776foreach(m ${OPENCV_MODULES_DISABLED_AUTO})
777  set(__mdeps "")
778  foreach(d ${OPENCV_MODULE_${m}_DEPS})
779    if(d MATCHES "^opencv_" AND NOT HAVE_${d})
780      list(APPEND __mdeps ${d})
781    endif()
782  endforeach()
783  if(__mdeps)
784    list(APPEND OPENCV_MODULES_DISABLED_AUTO_ST "${m}(deps: ${__mdeps})")
785  else()
786    list(APPEND OPENCV_MODULES_DISABLED_AUTO_ST "${m}")
787  endif()
788endforeach()
789string(REPLACE "opencv_" "" OPENCV_MODULES_DISABLED_AUTO_ST  "${OPENCV_MODULES_DISABLED_AUTO_ST}")
790
791status("    To be built:"            OPENCV_MODULES_BUILD          THEN ${OPENCV_MODULES_BUILD_ST}          ELSE "-")
792status("    Disabled:"               OPENCV_MODULES_DISABLED_USER  THEN ${OPENCV_MODULES_DISABLED_USER_ST}  ELSE "-")
793status("    Disabled by dependency:" OPENCV_MODULES_DISABLED_AUTO  THEN ${OPENCV_MODULES_DISABLED_AUTO_ST}  ELSE "-")
794status("    Unavailable:"            OPENCV_MODULES_DISABLED_FORCE THEN ${OPENCV_MODULES_DISABLED_FORCE_ST} ELSE "-")
795
796# ========================== Android details ==========================
797if(ANDROID)
798  status("")
799  status("  Android: ")
800  status("    Android ABI:" ${ANDROID_ABI})
801  status("    STL type:" ${ANDROID_STL})
802  status("    Native API level:" android-${ANDROID_NATIVE_API_LEVEL})
803  android_get_compatible_target(android_sdk_target_status ${ANDROID_NATIVE_API_LEVEL} ${ANDROID_SDK_TARGET} 11)
804  status("    SDK target:" "${android_sdk_target_status}")
805  if(BUILD_WITH_ANDROID_NDK)
806    status("    Android NDK:" "${ANDROID_NDK} (toolchain: ${ANDROID_TOOLCHAIN_NAME})")
807  elseif(BUILD_WITH_STANDALONE_TOOLCHAIN)
808    status("    Android toolchain:" "${ANDROID_STANDALONE_TOOLCHAIN}")
809  endif()
810  status("    android tool:"  ANDROID_EXECUTABLE  THEN "${ANDROID_EXECUTABLE} (${ANDROID_TOOLS_Pkg_Desc})" ELSE NO)
811  status("    Google Play manager:" BUILD_ANDROID_SERVICE                                         THEN YES ELSE NO)
812  status("    Android examples:"    BUILD_ANDROID_EXAMPLES AND CAN_BUILD_ANDROID_PROJECTS         THEN YES ELSE NO)
813endif()
814
815# ================== Windows RT features ==================
816if(WIN32)
817status("")
818status("  Windows RT support:" WINRT THEN YES ELSE NO)
819  if(WINRT)
820    status("    Building for Microsoft platform: " ${CMAKE_SYSTEM_NAME})
821    status("    Building for architectures: " ${CMAKE_VS_EFFECTIVE_PLATFORMS})
822    status("    Building for version: " ${CMAKE_SYSTEM_VERSION})
823  endif()
824endif(WIN32)
825
826# ========================== GUI ==========================
827status("")
828status("  GUI: ")
829
830if(HAVE_QT5)
831  status("    QT 5.x:"            HAVE_QT        THEN "YES (ver ${Qt5Core_VERSION_STRING})" ELSE NO)
832  status("    QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${Qt5OpenGL_LIBRARIES} ${Qt5OpenGL_VERSION_STRING})" ELSE NO)
833elseif(HAVE_QT)
834  status("    QT 4.x:"            HAVE_QT        THEN "YES (ver ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} ${QT_EDITION})" ELSE NO)
835  status("    QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${QT_QTOPENGL_LIBRARY})" ELSE NO)
836else()
837  if(DEFINED WITH_QT)
838    status("    QT:" NO)
839  endif()
840  if(DEFINED WITH_WIN32UI)
841    status("    Win32 UI:" HAVE_WIN32UI THEN YES ELSE NO)
842  else()
843    if(APPLE)
844      if(WITH_CARBON)
845        status("    Carbon:" YES)
846      else()
847        status("    Cocoa:"  YES)
848      endif()
849    else()
850      if(HAVE_GTK3)
851        status("    GTK+ 3.x:" HAVE_GTK THEN "YES (ver ${ALIASOF_gtk+-3.0_VERSION})" ELSE NO)
852      elseif(HAVE_GTK)
853        status("    GTK+ 2.x:" HAVE_GTK THEN "YES (ver ${ALIASOF_gtk+-2.0_VERSION})" ELSE NO)
854      else()
855        status("    GTK+:" NO)
856      endif()
857      status("    GThread :" HAVE_GTHREAD THEN "YES (ver ${ALIASOF_gthread-2.0_VERSION})" ELSE NO)
858      status("    GtkGlExt:" HAVE_GTKGLEXT THEN "YES (ver ${ALIASOF_gtkglext-1.0_VERSION})" ELSE NO)
859    endif()
860  endif()
861endif()
862
863status("    OpenGL support:" HAVE_OPENGL THEN "YES (${OPENGL_LIBRARIES})" ELSE NO)
864status("    VTK support:" HAVE_VTK THEN "YES (ver ${VTK_VERSION})" ELSE NO)
865
866# ========================== MEDIA IO ==========================
867status("")
868status("  Media I/O: ")
869status("    ZLib:"         BUILD_ZLIB    THEN "build (ver ${ZLIB_VERSION_STRING})"               ELSE "${ZLIB_LIBRARIES} (ver ${ZLIB_VERSION_STRING})")
870
871if(WITH_JPEG)
872  status("    JPEG:"       JPEG_FOUND    THEN "${JPEG_LIBRARY} (ver ${JPEG_LIB_VERSION})"        ELSE "build (ver ${JPEG_LIB_VERSION})")
873else()
874  status("    JPEG:"       "NO")
875endif()
876
877if(WITH_WEBP)
878  status("    WEBP:"       WEBP_FOUND    THEN "${WEBP_LIBRARY} (ver ${WEBP_VERSION})"        ELSE "build (ver ${WEBP_VERSION})")
879else()
880  status("    WEBP:"       "NO")
881endif()
882
883if(WITH_PNG)
884  status("    PNG:"        PNG_FOUND     THEN "${PNG_LIBRARY} (ver ${PNG_VERSION})"              ELSE "build (ver ${PNG_VERSION})")
885else()
886  status("    PNG:"        "NO")
887endif()
888if(WITH_TIFF)
889  if(TIFF_VERSION_STRING AND TIFF_FOUND)
890    status("    TIFF:"     "${TIFF_LIBRARY} (ver ${TIFF_VERSION} - ${TIFF_VERSION_STRING})")
891  else()
892    status("    TIFF:"     TIFF_FOUND    THEN "${TIFF_LIBRARY} (ver ${TIFF_VERSION})"            ELSE "build (ver ${TIFF_VERSION} - ${TIFF_VERSION_STRING})")
893  endif()
894else()
895  status("    TIFF:"       "NO")
896endif()
897if(WITH_JASPER)
898  status("    JPEG 2000:"  JASPER_FOUND  THEN "${JASPER_LIBRARY} (ver ${JASPER_VERSION_STRING})" ELSE "build (ver ${JASPER_VERSION_STRING})")
899else()
900  status("    JPEG 2000:"  "NO")
901endif()
902if(WITH_OPENEXR)
903  status("    OpenEXR:"  OPENEXR_FOUND  THEN "${OPENEXR_LIBRARIES} (ver ${OPENEXR_VERSION})" ELSE "build (ver ${OPENEXR_VERSION})")
904else()
905  status("    OpenEXR:"  "NO")
906endif()
907
908if( WITH_GDAL )
909  status("    GDAL:"   GDAL_FOUND THEN "${GDAL_LIBRARY}" ELSE "NO")
910else()
911  status("    GDAL:"     "NO")
912endif()
913
914# ========================== VIDEO IO ==========================
915status("")
916status("  Video I/O:")
917
918if (DEFINED WITH_VFW)
919  status("    Video for Windows:" HAVE_VFW         THEN YES                                        ELSE NO)
920endif(DEFINED WITH_VFW)
921
922if(DEFINED WITH_1394)
923  status("    DC1394 1.x:"     HAVE_DC1394         THEN "YES (ver ${ALIASOF_libdc1394_VERSION})"   ELSE NO)
924  status("    DC1394 2.x:"     HAVE_DC1394_2       THEN "YES (ver ${ALIASOF_libdc1394-2_VERSION})" ELSE NO)
925endif(DEFINED WITH_1394)
926
927if(DEFINED WITH_AVFOUNDATION)
928  status("    AVFoundation:"   WITH_AVFOUNDATION   THEN YES                                        ELSE NO)
929endif(DEFINED WITH_AVFOUNDATION)
930
931if(DEFINED WITH_FFMPEG)
932  if(WIN32)
933    status("    FFMPEG:"       WITH_FFMPEG         THEN "YES (prebuilt binaries)"                  ELSE NO)
934  else()
935    status("    FFMPEG:"       HAVE_FFMPEG         THEN YES ELSE NO)
936  endif()
937  status("      codec:"        HAVE_FFMPEG_CODEC   THEN "YES (ver ${ALIASOF_libavcodec_VERSION})"  ELSE NO)
938  status("      format:"       HAVE_FFMPEG_FORMAT  THEN "YES (ver ${ALIASOF_libavformat_VERSION})" ELSE NO)
939  status("      util:"         HAVE_FFMPEG_UTIL    THEN "YES (ver ${ALIASOF_libavutil_VERSION})"   ELSE NO)
940  status("      swscale:"      HAVE_FFMPEG_SWSCALE THEN "YES (ver ${ALIASOF_libswscale_VERSION})"  ELSE NO)
941  status("      resample:"     HAVE_FFMPEG_RESAMPLE THEN "YES (ver ${ALIASOF_libavresample_VERSION})"  ELSE NO)
942  status("      gentoo-style:" HAVE_GENTOO_FFMPEG  THEN YES                                        ELSE NO)
943endif(DEFINED WITH_FFMPEG)
944
945if(DEFINED WITH_GSTREAMER)
946  status("    GStreamer:"      HAVE_GSTREAMER      THEN ""                                         ELSE NO)
947  if(HAVE_GSTREAMER)
948    status("      base:"       "YES (ver ${GSTREAMER_BASE_VERSION})")
949    status("      video:"      "YES (ver ${GSTREAMER_VIDEO_VERSION})")
950    status("      app:"        "YES (ver ${GSTREAMER_APP_VERSION})")
951    status("      riff:"       "YES (ver ${GSTREAMER_RIFF_VERSION})")
952    status("      pbutils:"    "YES (ver ${GSTREAMER_PBUTILS_VERSION})")
953  endif(HAVE_GSTREAMER)
954endif(DEFINED WITH_GSTREAMER)
955
956if(DEFINED WITH_OPENNI)
957  status("    OpenNI:"         HAVE_OPENNI         THEN "YES (ver ${OPENNI_VERSION_STRING}, build ${OPENNI_VERSION_BUILD})"
958                                                                                                   ELSE NO)
959  status("    OpenNI PrimeSensor Modules:" HAVE_OPENNI_PRIME_SENSOR_MODULE
960                                                   THEN "YES (${OPENNI_PRIME_SENSOR_MODULE})"      ELSE NO)
961endif(DEFINED WITH_OPENNI)
962
963if(DEFINED WITH_OPENNI2)
964  status("    OpenNI2:"		   HAVE_OPENNI2	   THEN "YES (ver ${OPENNI2_VERSION_STRING}, build ${OPENNI2_VERSION_BUILD})"
965                                                                                                   ELSE NO)
966endif(DEFINED WITH_OPENNI2)
967
968if(DEFINED WITH_PVAPI)
969  status("    PvAPI:"          HAVE_PVAPI          THEN YES                                        ELSE NO)
970endif(DEFINED WITH_PVAPI)
971
972if(DEFINED WITH_GIGEAPI)
973  status("    GigEVisionSDK:"  HAVE_GIGE_API       THEN YES                                        ELSE NO)
974endif(DEFINED WITH_GIGEAPI)
975
976if(DEFINED WITH_QUICKTIME)
977  status("    QuickTime:"      HAVE_QUICKTIME      THEN YES                                        ELSE NO)
978  status("    QTKit:"          HAVE_QTKIT          THEN YES                                        ELSE NO)
979endif(DEFINED WITH_QUICKTIME)
980
981if(DEFINED WITH_UNICAP)
982  status("    UniCap:"         HAVE_UNICAP         THEN "YES (ver ${ALIASOF_libunicap_VERSION})"   ELSE NO)
983  status("    UniCap ucil:"    HAVE_UNICAP_UCIL    THEN "YES (ver ${ALIASOF_libucil_VERSION})"     ELSE NO)
984endif(DEFINED WITH_UNICAP)
985
986if(DEFINED WITH_V4L)
987  if(HAVE_CAMV4L)
988    set(HAVE_CAMV4L_STR "YES")
989  else()
990    set(HAVE_CAMV4L_STR "NO")
991  endif()
992  if(HAVE_CAMV4L2)
993    set(HAVE_CAMV4L2_STR "YES")
994  elseif(HAVE_VIDEOIO)
995    set(HAVE_CAMV4L2_STR "YES(videoio)")
996  else()
997    set(HAVE_CAMV4L2_STR "NO")
998  endif()
999  status("    V4L/V4L2:"       HAVE_LIBV4L
1000             THEN "Using libv4l1 (ver ${ALIASOF_libv4l1_VERSION}) / libv4l2 (ver ${ALIASOF_libv4l2_VERSION})"
1001             ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
1002endif(DEFINED WITH_V4L)
1003
1004if(DEFINED WITH_DSHOW)
1005  status("    DirectShow:"     HAVE_DSHOW     THEN YES                                        ELSE NO)
1006endif(DEFINED WITH_DSHOW)
1007
1008if(DEFINED WITH_MSMF)
1009  status("    Media Foundation:" HAVE_MSMF    THEN YES                                        ELSE NO)
1010endif(DEFINED WITH_MSMF)
1011
1012if(DEFINED WITH_XIMEA)
1013  status("    XIMEA:"          HAVE_XIMEA          THEN YES                                        ELSE NO)
1014endif(DEFINED WITH_XIMEA)
1015
1016if(DEFINED WITH_XINE)
1017  status("    Xine:"           HAVE_XINE           THEN "YES (ver ${ALIASOF_libxine_VERSION})"     ELSE NO)
1018endif(DEFINED WITH_XINE)
1019
1020if(DEFINED WITH_INTELPERC)
1021  status("    Intel PerC:"     HAVE_INTELPERC      THEN "YES"                                 ELSE NO)
1022endif(DEFINED WITH_INTELPERC)
1023
1024if(DEFINED WITH_GPHOTO2)
1025  status("    gPhoto2:"        HAVE_GPHOTO2        THEN "YES"                                 ELSE NO)
1026endif(DEFINED WITH_GPHOTO2)
1027
1028
1029# ========================== Other third-party libraries ==========================
1030status("")
1031status("  Other third-party libraries:")
1032
1033if(WITH_IPP AND HAVE_IPP)
1034  status("    Use IPP:" "${IPP_VERSION_STR} [${IPP_VERSION_MAJOR}.${IPP_VERSION_MINOR}.${IPP_VERSION_BUILD}]")
1035  status("         at:" "${IPP_ROOT_DIR}")
1036  if(NOT HAVE_IPP_ICV_ONLY)
1037    status("     linked:" BUILD_WITH_DYNAMIC_IPP THEN "dynamic" ELSE "static")
1038  endif()
1039else()
1040  status("    Use IPP:"   WITH_IPP AND NOT HAVE_IPP THEN "IPP not found or implicitly disabled" ELSE NO)
1041endif()
1042
1043if(DEFINED WITH_IPP_A)
1044status("    Use IPP Async:"  HAVE_IPP_A       THEN "YES" ELSE NO)
1045endif(DEFINED WITH_IPP_A)
1046
1047status("    Use Eigen:"      HAVE_EIGEN       THEN "YES (ver ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})" ELSE NO)
1048status("    Use TBB:"        HAVE_TBB         THEN "YES (ver ${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR} interface ${TBB_INTERFACE_VERSION})" ELSE NO)
1049status("    Use OpenMP:"     HAVE_OPENMP      THEN YES ELSE NO)
1050status("    Use GCD"         HAVE_GCD         THEN YES ELSE NO)
1051status("    Use Concurrency" HAVE_CONCURRENCY THEN YES ELSE NO)
1052status("    Use C=:"         HAVE_CSTRIPES    THEN YES ELSE NO)
1053status("    Use pthreads for parallel for:"   HAVE_PTHREADS_PF THEN YES ELSE NO)
1054status("    Use Cuda:"       HAVE_CUDA        THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO)
1055status("    Use OpenCL:"     HAVE_OPENCL      THEN YES ELSE NO)
1056
1057if(HAVE_CUDA)
1058  status("")
1059  status("  NVIDIA CUDA")
1060
1061  status("    Use CUFFT:"            HAVE_CUFFT   THEN YES ELSE NO)
1062  status("    Use CUBLAS:"           HAVE_CUBLAS  THEN YES ELSE NO)
1063  status("    USE NVCUVID:"          HAVE_NVCUVID THEN YES ELSE NO)
1064  status("    NVIDIA GPU arch:"      ${OPENCV_CUDA_ARCH_BIN})
1065  status("    NVIDIA PTX archs:"     ${OPENCV_CUDA_ARCH_PTX})
1066  status("    Use fast math:"        CUDA_FAST_MATH THEN YES ELSE NO)
1067endif()
1068
1069if(HAVE_OPENCL)
1070  status("")
1071  status("  OpenCL:")
1072  if(HAVE_OPENCL_STATIC)
1073    set(__opencl_ver "static")
1074  else()
1075    set(__opencl_ver "dynamic")
1076  endif()
1077  status("    Version:"       ${__opencl_ver})
1078  if(OPENCL_INCLUDE_DIR)
1079    status("    Include path:"       ${OPENCL_INCLUDE_DIRS})
1080  endif()
1081  if(OPENCL_LIBRARIES)
1082    set(__libs "")
1083    foreach(l ${OPENCL_LIBRARIES})
1084      if(TARGET ${l})
1085        get_target_property(p ${l} LOCATION)
1086        if(p MATCHES NOTFOUND)
1087          list(APPEND __libs "${l}")
1088        else()
1089          list(APPEND __libs "${p}")
1090        endif()
1091      else()
1092        list(APPEND __libs "${l}")
1093      endif()
1094    endforeach()
1095    status("    libraries:"          ${__libs})
1096  endif()
1097  status("    Use AMDFFT:"           HAVE_CLAMDFFT  THEN YES ELSE NO)
1098  status("    Use AMDBLAS:"          HAVE_CLAMDBLAS THEN YES ELSE NO)
1099endif()
1100
1101# ========================== python ==========================
1102status("")
1103status("  Python 2:")
1104status("    Interpreter:"     PYTHON2INTERP_FOUND  THEN "${PYTHON2_EXECUTABLE} (ver ${PYTHON2_VERSION_STRING})"       ELSE NO)
1105if(BUILD_opencv_python2)
1106  if(PYTHON2LIBS_VERSION_STRING)
1107    status("    Libraries:"   HAVE_opencv_python2  THEN  "${PYTHON2_LIBRARIES} (ver ${PYTHON2LIBS_VERSION_STRING})"   ELSE NO)
1108  else()
1109    status("    Libraries:"   HAVE_opencv_python2  THEN  "${PYTHON2_LIBRARIES}"                                      ELSE NO)
1110  endif()
1111  status("    numpy:"         PYTHON2_NUMPY_INCLUDE_DIRS THEN "${PYTHON2_NUMPY_INCLUDE_DIRS} (ver ${PYTHON2_NUMPY_VERSION})" ELSE "NO (Python wrappers can not be generated)")
1112  status("    packages path:" PYTHON2_EXECUTABLE         THEN "${PYTHON2_PACKAGES_PATH}"                                    ELSE "-")
1113endif()
1114
1115status("")
1116status("  Python 3:")
1117status("    Interpreter:"     PYTHON3INTERP_FOUND  THEN "${PYTHON3_EXECUTABLE} (ver ${PYTHON3_VERSION_STRING})"       ELSE NO)
1118if(BUILD_opencv_python3)
1119  if(PYTHON3LIBS_VERSION_STRING)
1120    status("    Libraries:"   HAVE_opencv_python3  THEN  "${PYTHON3_LIBRARIES} (ver ${PYTHON3LIBS_VERSION_STRING})"   ELSE NO)
1121  else()
1122    status("    Libraries:"   HAVE_opencv_python3  THEN  "${PYTHON3_LIBRARIES}"                                      ELSE NO)
1123  endif()
1124  status("    numpy:"         PYTHON3_NUMPY_INCLUDE_DIRS THEN "${PYTHON3_NUMPY_INCLUDE_DIRS} (ver ${PYTHON3_NUMPY_VERSION})" ELSE "NO (Python3 wrappers can not be generated)")
1125  status("    packages path:" PYTHON3_EXECUTABLE         THEN "${PYTHON3_PACKAGES_PATH}"                                    ELSE "-")
1126endif()
1127
1128status("")
1129status("  Python (for build):"  PYTHON_DEFAULT_AVAILABLE THEN "${PYTHON_DEFAULT_EXECUTABLE}" ELSE NO)
1130
1131# ========================== java ==========================
1132status("")
1133status("  Java:")
1134status("    ant:"           ANT_EXECUTABLE      THEN "${ANT_EXECUTABLE} (ver ${ANT_VERSION})"                    ELSE NO)
1135if(NOT ANDROID)
1136  status("    JNI:"         JNI_INCLUDE_DIRS    THEN "${JNI_INCLUDE_DIRS}"                                       ELSE NO)
1137endif()
1138status("    Java wrappers:" HAVE_opencv_java                                                            THEN YES ELSE NO)
1139status("    Java tests:"    BUILD_TESTS AND opencv_test_java_BINARY_DIR                                 THEN YES ELSE NO)
1140
1141# ========================= matlab =========================
1142status("")
1143status("  Matlab:")
1144status("    mex:"         MATLAB_MEX_SCRIPT  THEN  "${MATLAB_MEX_SCRIPT}"   ELSE NO)
1145if (MATLAB_FOUND)
1146  status("    Compiler/generator:" MEX_WORKS    THEN  "Working"                ELSE "Not working (bindings will not be generated)")
1147endif()
1148
1149# ========================== documentation ==========================
1150if(BUILD_DOCS)
1151  status("")
1152  status("  Documentation:")
1153  status("    Doxygen:"             DOXYGEN_FOUND             THEN "${DOXYGEN_EXECUTABLE} (ver ${DOXYGEN_VERSION})" ELSE NO)
1154  status("    PlantUML:"            PLANTUML_JAR              THEN "${PLANTUML_JAR}" ELSE NO)
1155endif()
1156
1157# ========================== samples and tests ==========================
1158status("")
1159status("  Tests and samples:")
1160status("    Tests:"             BUILD_TESTS AND HAVE_opencv_ts       THEN YES ELSE NO)
1161status("    Performance tests:" BUILD_PERF_TESTS AND HAVE_opencv_ts  THEN YES ELSE NO)
1162status("    C/C++ Examples:"    BUILD_EXAMPLES                       THEN YES ELSE NO)
1163
1164# ========================== auxiliary ==========================
1165status("")
1166status("  Install path:" "${CMAKE_INSTALL_PREFIX}")
1167status("")
1168status("  cvconfig.h is in:" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}")
1169status("-----------------------------------------------------------------")
1170status("")
1171
1172ocv_finalize_status()
1173
1174# ----------------------------------------------------------------------------
1175# Warn in the case of in-source build
1176# ----------------------------------------------------------------------------
1177if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
1178  message(WARNING "The source directory is the same as binary directory. \"make clean\" may damage the source tree")
1179endif()
1180
1181# ----------------------------------------------------------------------------
1182# CPack stuff
1183# ----------------------------------------------------------------------------
1184
1185include(cmake/OpenCVPackaging.cmake)
1186