14 |
14 |
# Add these standard paths to the search paths for FIND_LIBRARY
|
15 |
15 |
# to find libraries from these locations first
|
16 |
16 |
if(UNIX)
|
17 |
|
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib /usr/lib)
|
|
17 |
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib${LIB_SUFFIX} /usr/lib${LIB_SUFFIX})
|
18 |
18 |
endif()
|
19 |
19 |
|
20 |
20 |
|
... | ... | |
77 |
77 |
# Build static or dynamic libs?
|
78 |
78 |
# Default: dynamic libraries
|
79 |
79 |
# ----------------------------------------------------------------------------
|
80 |
|
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)")
|
|
80 |
OPTION(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" ON)
|
81 |
81 |
|
82 |
82 |
# ----------------------------------------------------------------------------
|
83 |
83 |
# Include debug info into debug libs?
|
84 |
84 |
# Default: yes
|
85 |
85 |
# ----------------------------------------------------------------------------
|
86 |
|
set(BUILD_WITH_DEBUG_INFO ON CACHE BOOL "Include debug info into debug libs")
|
|
86 |
OPTION(BUILD_WITH_DEBUG_INFO "Include debug info into debug libs" ON)
|
87 |
87 |
|
88 |
88 |
# ----------------------------------------------------------------------------
|
89 |
89 |
# Current version number:
|
... | ... | |
285 |
285 |
|
286 |
286 |
# Build/install (or not) some apps:
|
287 |
287 |
# ===================================================
|
288 |
|
set(BUILD_EXAMPLES OFF CACHE BOOL "Build all examples")
|
289 |
|
set(INSTALL_C_EXAMPLES OFF CACHE BOOL "Install C examples")
|
290 |
|
set(INSTALL_PYTHON_EXAMPLES OFF CACHE BOOL "Install Python examples")
|
|
288 |
option(BUILD_EXAMPLES "Build all examples" OFF)
|
|
289 |
option(INSTALL_C_EXAMPLES "Install C examples" OFF)
|
|
290 |
option(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF)
|
291 |
291 |
|
292 |
292 |
# Build tests:
|
293 |
293 |
# ===================================================
|
294 |
|
set(BUILD_TESTS ON CACHE BOOL "Build tests")
|
|
294 |
option(BUILD_TESTS "Build tests" ON)
|
295 |
295 |
|
296 |
296 |
# Build 3rdparty libraries under unix
|
297 |
297 |
# ===================================================
|
298 |
298 |
if(WIN32)
|
299 |
|
set(OPENCV_BUILD_3RDPARTY_LIBS TRUE CACHE BOOL "Build 3rd party libraries")
|
|
299 |
option(OPENCV_BUILD_3RDPARTY_LIBS "Build 3rd party libraries" TRUE)
|
300 |
300 |
else()
|
301 |
|
set(OPENCV_BUILD_3RDPARTY_LIBS FALSE CACHE BOOL "Build 3rd party libraries")
|
|
301 |
option(OPENCV_BUILD_3RDPARTY_LIBS "Build 3rd party libraries" FALSE)
|
302 |
302 |
endif()
|
303 |
303 |
|
304 |
304 |
include(OpenCVPCHSupport.cmake REQUIRED)
|
... | ... | |
324 |
324 |
#set(ENABLE_OPENMP ${DEFAULT_ENABLE_OPENMP} CACHE BOOL "")
|
325 |
325 |
|
326 |
326 |
if(CMAKE_COMPILER_IS_GNUCXX)
|
327 |
|
set(ENABLE_PROFILING OFF CACHE BOOL "Enable profiling in the GCC compiler (Add flags: -g -pg)")
|
328 |
|
set(USE_OMIT_FRAME_POINTER ON CACHE BOOL "Enable -fomit-frame-pointer for GCC")
|
|
327 |
option(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF)
|
|
328 |
option(USE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON)
|
329 |
329 |
|
330 |
330 |
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES amd64*|x86_64*)
|
331 |
331 |
set(X86_64 1)
|
... | ... | |
341 |
341 |
|
342 |
342 |
if(X86 OR X86_64)
|
343 |
343 |
# enable everything, since the available set of instructions is checked at runtime
|
344 |
|
set(USE_FAST_MATH ON CACHE BOOL "Enable -ffast-math")
|
345 |
|
set(ENABLE_SSE ON CACHE BOOL "Enable SSE instructions")
|
346 |
|
set(ENABLE_SSE2 ON CACHE BOOL "Enable SSE2 instructions")
|
347 |
|
set(ENABLE_SSE3 OFF CACHE BOOL "Enable SSE3 instructions")
|
348 |
|
set(ENABLE_SSSE3 OFF CACHE BOOL "Enable SSSE3 instructions")
|
349 |
|
set(ENABLE_SSE41 OFF CACHE BOOL "Enable SSE4.1 instructions")
|
350 |
|
set(ENABLE_SSE42 OFF CACHE BOOL "Enable SSE4.2 instructions")
|
|
344 |
option(USE_FAST_MATH "Enable -ffast-math for GCC" ON)
|
|
345 |
option(ENABLE_SSE "Enable SSE instructions" ON)
|
|
346 |
option(ENABLE_SSE2 "Enable SSE2 instructions" ON)
|
|
347 |
option(ENABLE_SSE3 "Enable SSE3 instructions" OFF)
|
|
348 |
option(ENABLE_SSSE3 "Enable SSSE3 instructions" OFF)
|
|
349 |
option(ENABLE_SSE41 "Enable SSE4.1 instructions" OFF)
|
|
350 |
option(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF)
|
351 |
351 |
endif()
|
352 |
352 |
endif()
|
353 |
353 |
|
354 |
354 |
if(MSVC)
|
355 |
|
set(ENABLE_SSE ON CACHE BOOL "Enable SSE instructions for MSVC")
|
356 |
|
set(ENABLE_SSE2 ON CACHE BOOL "Enable SSE2 instructions for MSVC")
|
|
355 |
option(ENABLE_SSE "Enable SSE instructions for MSVC" ON)
|
|
356 |
option(ENABLE_SSE2 "Enable SSE2 instructions for MSVC" ON)
|
357 |
357 |
if(CMAKE_C_COMPILER MATCHES "icc")
|
358 |
|
set(ENABLE_SSE3 OFF CACHE BOOL "Enable SSE3 instructions for ICC")
|
359 |
|
set(ENABLE_SSE4_1 OFF CACHE BOOL "Enable SSE4.1 instructions for ICC")
|
|
358 |
option(ENABLE_SSE3 "Enable SSE3 instructions for ICC" OFF)
|
|
359 |
option(ENABLE_SSE4_1 "Enable SSE4.1 instructions for ICC" OFF)
|
360 |
360 |
endif()
|
361 |
361 |
endif()
|
362 |
362 |
|
363 |
363 |
# allow fine grained control over which libraries not to link, even if
|
364 |
364 |
# they are available on the system
|
365 |
365 |
# ====================================================================
|
366 |
|
set(WITH_PNG ON CACHE BOOL "Include PNG support")
|
367 |
|
set(WITH_JPEG ON CACHE BOOL "Include JPEG support")
|
368 |
|
set(WITH_JASPER ON CACHE BOOL "Include JPEG2K support")
|
369 |
|
set(WITH_TIFF ON CACHE BOOL "Include TIFF support")
|
370 |
|
set(WITH_OPENEXR ON CACHE BOOL "Include ILM support via OpenEXR")
|
|
366 |
option(WITH_PNG "Include PNG support" ON)
|
|
367 |
option(WITH_JPEG "Include JPEG support" ON)
|
|
368 |
option(WITH_JASPER "Include JPEG2K support" ON)
|
|
369 |
option(WITH_TIFF "Include TIFF support" ON)
|
|
370 |
option(WITH_OPENEXR "Include ILM support via OpenEXR" ON)
|
371 |
371 |
|
372 |
372 |
if(UNIX)
|
373 |
|
set(WITH_FFMPEG ON CACHE BOOL "Include FFMPEG support")
|
|
373 |
option(WITH_FFMPEG "Include FFMPEG support" ON)
|
374 |
374 |
if(NOT APPLE)
|
375 |
|
set(WITH_UNICAP OFF CACHE BOOL "Include Unicap support (GPL)")
|
376 |
|
set(WITH_GTK ON CACHE BOOL "Include GTK support")
|
377 |
|
set(WITH_GSTREAMER ON CACHE BOOL "Include Gstreamer support")
|
378 |
|
set(WITH_V4L ON CACHE BOOL "Include Video 4 Linux support")
|
379 |
|
set(WITH_XINE OFF CACHE BOOL "Include Xine support (GPL)")
|
|
375 |
option(WITH_UNICAP "Include Unicap support (GPL)" OFF)
|
|
376 |
option(WITH_GTK "Include GTK support" ON)
|
|
377 |
option(WITH_GSTREAMER "Include Gstreamer support" ON)
|
|
378 |
option(WITH_V4L "Include Video 4 Linux support" ON)
|
|
379 |
option(WITH_XINE "Include Xine support (GPL)" OFF)
|
380 |
380 |
endif()
|
381 |
|
set(WITH_PVAPI ON CACHE BOOL "Include Prosilica GigE support")
|
382 |
|
set(WITH_1394 ON CACHE BOOL "Include IEEE1394 support")
|
|
381 |
option(WITH_PVAPI "Include Prosilica GigE support" ON)
|
|
382 |
option(WITH_1394 "Include IEEE1394 support" ON)
|
383 |
383 |
endif()
|
384 |
384 |
|
385 |
385 |
if(APPLE)
|
386 |
|
set(WITH_CARBON OFF CACHE BOOL "Use Carbon for UI instead of Cocoa")
|
387 |
|
set(WITH_QUICKTIME OFF CACHE BOOL "Use QuickTime for Video I/O insted of QTKit")
|
|
386 |
option(WITH_CARBON "Use Carbon for UI instead of Cocoa" OFF)
|
|
387 |
option(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF)
|
388 |
388 |
endif()
|
389 |
389 |
|
390 |
|
set(WITH_TBB OFF CACHE BOOL "Include Intel TBB support")
|
391 |
|
set(WITH_IPP OFF CACHE BOOL "Include Intel IPP support")
|
392 |
|
set(WITH_EIGEN ON CACHE BOOL "Include Eigen2/Eigen3 support")
|
393 |
|
set(WITH_CUDA ON CACHE BOOL "Include NVidia Cuda Runtime support")
|
|
390 |
option(WITH_TBB "Include TBB support" OFF)
|
|
391 |
option(WITH_IPP "Include Intel IPP support" OFF)
|
|
392 |
option(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
|
|
393 |
option(WITH_CUDA "Include NVidia Cuda Runtime support" ON)
|
394 |
394 |
|
395 |
|
set(WITH_OPENNI OFF CACHE BOOL "Include OpenNI support")
|
|
395 |
option(WITH_OPENNI "Include OpenNI support" OFF)
|
396 |
396 |
|
397 |
397 |
# ===================================================
|
398 |
398 |
# Macros that checks if module have been installed.
|
... | ... | |
586 |
586 |
include(OpenCVFindOpenEXR.cmake)
|
587 |
587 |
endif()
|
588 |
588 |
|
589 |
|
set(BUILD_DOCS ON CACHE BOOL "Build OpenCV Documentation")
|
|
589 |
option(BUILD_DOCS "Build OpenCV Documentation" ON)
|
590 |
590 |
|
591 |
591 |
if(BUILD_DOCS)
|
592 |
592 |
include(OpenCVFindLATEX.cmake REQUIRED)
|
593 |
593 |
endif()
|
594 |
594 |
|
595 |
|
set(BUILD_NEW_PYTHON_SUPPORT ON CACHE BOOL "Build with Python support")
|
|
595 |
option(BUILD_NEW_PYTHON_SUPPORT "Build with Python support" ON)
|
596 |
596 |
|
597 |
597 |
if (WIN32)
|
598 |
598 |
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
... | ... | |
619 |
619 |
|
620 |
620 |
string(REGEX MATCH "[0-9].[0-9]" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")
|
621 |
621 |
if(UNIX)
|
622 |
|
set(PYTHON_PLUGIN_INSTALL_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv)
|
|
622 |
set(PYTHON_PLUGIN_INSTALL_PATH lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv)
|
623 |
623 |
if(APPLE)
|
624 |
624 |
set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages CACHE PATH "Where to install the python packages.")
|
625 |
625 |
else() #debian based assumed, install to the dist-packages.
|
626 |
|
set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages CACHE PATH "Where to install the python packages.")
|
|
626 |
set(PYTHON_PACKAGES_PATH lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages)
|
627 |
627 |
endif()
|
628 |
628 |
endif()
|
629 |
629 |
if(WIN32)
|
... | ... | |
665 |
665 |
#YV
|
666 |
666 |
############################### QT ################################
|
667 |
667 |
|
668 |
|
set(WITH_QT OFF CACHE BOOL "Build with Qt Backend support")
|
669 |
|
set(WITH_QT_OPENGL OFF CACHE BOOL "Add OpenGL extension to Qt")
|
|
668 |
option(WITH_QT "Build with Qt Backend support" OFF)
|
|
669 |
option(WITH_QT_OPENGL "Add OpenGL extension to Qt" OFF)
|
670 |
670 |
|
671 |
671 |
set(HAVE_QT 0)
|
672 |
672 |
set(HAVE_QT_OPENGL 0)
|
... | ... | |
876 |
876 |
################## Extra HighGUI libs on Windows ###################
|
877 |
877 |
|
878 |
878 |
if(WIN32)
|
879 |
|
set(WITH_VIDEOINPUT ON CACHE BOOL "Build HighGUI with DirectShow support")
|
880 |
|
|
|
879 |
option(WITH_VIDEOINPUT "Build HighGUI with DirectShow support" ON)
|
|
880 |
|
881 |
881 |
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} comctl32 gdi32 ole32)
|
882 |
882 |
|
883 |
883 |
if(WITH_VIDEOINPUT)
|
... | ... | |
956 |
956 |
# Set the maximum level of warnings:
|
957 |
957 |
# ----------------------------------------------------------------------------
|
958 |
958 |
# Should be set to true for development
|
959 |
|
set(OPENCV_WARNINGS_ARE_ERRORS OFF CACHE BOOL "Treat warnings as errors")
|
|
959 |
option(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF)
|
960 |
960 |
|
961 |
961 |
set(EXTRA_C_FLAGS "")
|
962 |
962 |
set(EXTRA_C_FLAGS_RELEASE "")
|
... | ... | |
1197 |
1197 |
if(WIN32)
|
1198 |
1198 |
set(OPENCV_DOC_INSTALL_PATH doc)
|
1199 |
1199 |
else()
|
1200 |
|
set(OPENCV_DOC_INSTALL_PATH share/opencv/doc)
|
|
1200 |
set(OPENCV_DOC_INSTALL_PATH share/doc/opencv-${OPENCV_VERSION}/ CACHE PATH "Directory for documentation to install (without prefix)")
|
1201 |
1201 |
endif()
|
1202 |
1202 |
|
1203 |
1203 |
|
... | ... | |
1232 |
1232 |
set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/../../include/opencv" "\${THIS_OPENCV_CONFIG_PATH}/../../include\"")
|
1233 |
1233 |
set(CMAKE_BASE_INCLUDE_DIRS_CONFIGCMAKE "\"\"")
|
1234 |
1234 |
|
1235 |
|
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/../../lib\"")
|
|
1235 |
set(CMAKE_LIB_DIRS_CONFIGCMAKE "\"\${THIS_OPENCV_CONFIG_PATH}/../../lib${LIB_SUFFIX}\"")
|
1236 |
1236 |
|
1237 |
1237 |
exec_program(mkdir ARGS "-p \"${CMAKE_BINARY_DIR}/unix-install/\"" OUTPUT_VARIABLE RET_VAL)
|
1238 |
1238 |
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
|
... | ... | |
1327 |
1327 |
# -------------------------------------------------------------------------------------------
|
1328 |
1328 |
set(prefix ${CMAKE_INSTALL_PREFIX})
|
1329 |
1329 |
set(exec_prefix "\${prefix}")
|
1330 |
|
set(libdir "\${exec_prefix}/lib")
|
|
1330 |
set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
|
1331 |
1331 |
set(includedir "\${prefix}/include")
|
1332 |
1332 |
set(VERSION ${OPENCV_VERSION})
|
1333 |
1333 |
|
1334 |
1334 |
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/opencv.pc.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/opencv.pc" @ONLY IMMEDIATE)
|
1335 |
1335 |
|
1336 |
1336 |
if(UNIX)
|
1337 |
|
install(FILES ${CMAKE_BINARY_DIR}/unix-install/opencv.pc DESTINATION lib/pkgconfig)
|
|
1337 |
install(FILES ${CMAKE_BINARY_DIR}/unix-install/opencv.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig)
|
1338 |
1338 |
endif()
|
1339 |
1339 |
|
1340 |
1340 |
|
... | ... | |
1354 |
1354 |
# CPack target
|
1355 |
1355 |
# ----------------------------------------------------------------------------
|
1356 |
1356 |
|
1357 |
|
set(BUILD_PACKAGE ON CACHE BOOL "Enables 'make package_source' command")
|
|
1357 |
option(BUILD_PACKAGE "Build a installer with the SDK" ON)
|
1358 |
1358 |
|
1359 |
1359 |
if(BUILD_PACKAGE)
|
1360 |
1360 |
|