set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib /usr/lib)
endif()
-
# it _must_ go before PROJECT(OpenCV) in order to work
if(WIN32)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory")
endif()
-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+# SUBDIRECTORIES:
+# Save libs and executables in the same place
+set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE PATH "Output directory for libraries" )
+set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Output directory for applications" )
+
+if(ANDROID)
+ set(OPENCV_DOC_INSTALL_PATH doc)
+elseif(WIN32)
+ set(OPENCV_DOC_INSTALL_PATH doc)
+else()
+ set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
+endif()
+
+if(ANDROID)
+ set(OPENCV_LIB_INSTALL_PATH libs/${ARMEABI_NDK_NAME})
+else()
+ set(OPENCV_LIB_INSTALL_PATH lib)
+endif()
+
+# build configuration
+set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_LIB_INSTALL_PATH}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
+set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES} )
+
set(CMAKE_C_FLAGS_MINSIZEREL "" CACHE INTERNAL "" FORCE)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "" FORCE)
set(CMAKE_CXX_FLAGS_MINSIZEREL "" CACHE INTERNAL "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "" CACHE INTERNAL "" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "" FORCE)
-set(CMAKE_VERBOSE OFF CACHE BOOL "Verbose mode")
+set(CMAKE_VERBOSE OFF CACHE BOOL "Verbose mode")
+if(CMAKE_VERBOSE)
+ set(CMAKE_VERBOSE_MAKEFILE 1)
+endif()
if (WIN32)
if(${CMAKE_GENERATOR} MATCHES "(MinGW)|(MSYS)")
endif()
endif()
-if(CMAKE_VERBOSE)
- set(CMAKE_VERBOSE_MAKEFILE 1)
-endif()
-
project(OpenCV)
-
-
cmake_minimum_required(VERSION 2.4)
endmacro()
endif()
-
# --------------------------------------------------------------
# Indicate CMake 2.7 and above that we don't want to mix relative
# and absolute paths in linker lib lists.
cmake_policy(SET CMP0003 NEW)
endif()
-
# ----------------------------------------------------------------------------
# Current version number:
# ----------------------------------------------------------------------------
set(OPENCV_VERSION "2.3.0")
-string(REGEX MATCHALL "[0-9]" OPENCV_VERSION_PARTS "${OPENCV_VERSION}")
+string(REGEX MATCHALL "[0-9]+" OPENCV_VERSION_PARTS "${OPENCV_VERSION}")
list(GET OPENCV_VERSION_PARTS 0 OPENCV_VERSION_MAJOR)
list(GET OPENCV_VERSION_PARTS 1 OPENCV_VERSION_MINOR)
set(OPENCV_DEBUG_POSTFIX)
endif()
-
# ----------------------------------------------------------------------------
# Build static or dynamic libs?
-# Default: dynamic libraries:
+# Default: dynamic libraries
# ----------------------------------------------------------------------------
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)")
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
- endif(${flag_var} MATCHES "/MD")
-
+ endif()
if(${flag_var} MATCHES "/MDd")
string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}")
- endif(${flag_var} MATCHES "/MDd")
+ endif()
endforeach(flag_var)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib")
-
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libcmtd.lib")
-
else(BUILD_WITH_STATIC_CRT)
foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MT")
string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}")
- endif(${flag_var} MATCHES "/MT")
-
+ endif()
if(${flag_var} MATCHES "/MTd")
string(REGEX REPLACE "/MTd" "/MDd" ${flag_var} "${${flag_var}}")
- endif(${flag_var} MATCHES "/MTd")
+ endif()
endforeach(flag_var)
-
endif(BUILD_WITH_STATIC_CRT)
endif(MSVC)
-
-
# ----------------------------------------------------------------------------
# Variables for cvconfig.h.cmake
# ----------------------------------------------------------------------------
set(PACKAGE_TARNAME "${PACKAGE}")
set(PACKAGE_VERSION "${OPENCV_VERSION}")
-
# ----------------------------------------------------------------------------
# Autodetect if we are in a SVN repository
# ----------------------------------------------------------------------------
if(SVNVERSION_RESULT MATCHES "exported")
# This is NOT a svn repository:
set(OPENCV_SVNVERSION "")
+ message(STATUS "SVNVERSION: exported")
else()
set(OPENCV_SVNVERSION " svn:${SVNVERSION_RESULT}")
+ message(STATUS "SVNVERSION: ${OPENCV_SVNVERSION}")
endif()
-
- message(STATUS "SVNVERSION: ${OPENCV_SVNVERSION}")
else()
# We don't have svnversion:
set(OPENCV_SVNVERSION "")
# Typical output in CMAKE_OPENCV_GCC_VERSION_FULL: "c+//0 (whatever) 4.2.3 (...)"
# Look for the version number
- string(REGEX MATCH "[0-9].[0-9].[0-9]" CMAKE_GCC_REGEX_VERSION "${CMAKE_OPENCV_GCC_VERSION_FULL}")
+ string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" CMAKE_GCC_REGEX_VERSION "${CMAKE_OPENCV_GCC_VERSION_FULL}")
# Split the three parts:
- string(REGEX MATCHALL "[0-9]" CMAKE_OPENCV_GCC_VERSIONS "${CMAKE_GCC_REGEX_VERSION}")
+ string(REGEX MATCHALL "[0-9]+" CMAKE_OPENCV_GCC_VERSIONS "${CMAKE_GCC_REGEX_VERSION}")
list(GET CMAKE_OPENCV_GCC_VERSIONS 0 CMAKE_OPENCV_GCC_VERSION_MAJOR)
list(GET CMAKE_OPENCV_GCC_VERSIONS 1 CMAKE_OPENCV_GCC_VERSION_MINOR)
set(MINGW64 1)
endif()
endif()
-
endif()
-
# ----------------------------------------------------------------------------
# Detect Intel ICC compiler -- for -fPIC in 3rdparty ( UNIX ONLY ):
# see include/opencv/cxtypes.h file for related ICC & CV_ICC defines.
endif()
endif()
-
# ----------------------------------------------------------------------------
# CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
# ----------------------------------------------------------------------------
include(CheckIncludeFile)
endif()
-#if(MSVC)
-# set(DEFAULT_ENABLE_OPENMP ON)
-#else()
-# set(DEFAULT_ENABLE_OPENMP OFF)
-#endif()
-#set(ENABLE_OPENMP ${DEFAULT_ENABLE_OPENMP} CACHE BOOL "")
-
if(CMAKE_COMPILER_IS_GNUCXX)
set(ENABLE_PROFILING OFF CACHE BOOL "Enable profiling in the GCC compiler (Add flags: -g -pg)")
set(USE_OMIT_FRAME_POINTER ON CACHE BOOL "Enable -fomit-frame-pointer for GCC")
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES amd64*|x86_64*)
set(X86_64 1)
endif()
-
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES i686*|i386*|x86*)
set(X86 1)
endif()
-
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES powerpc*)
set(ENABLE_POWERPC ON CACHE BOOL "Enable PowerPC for GCC")
endif ()
# cmake 2.4 (at least on Ubuntu 8.04 (hardy)) don't define PYTHONLIBS_FOUND
if(NOT PYTHONLIBS_FOUND AND PYTHON_INCLUDE_PATH)
set(PYTHONLIBS_FOUND ON)
-endif(NOT PYTHONLIBS_FOUND AND PYTHON_INCLUDE_PATH)
+endif()
execute_process(COMMAND ${PYTHON_EXECUTABLE} --version
ERROR_VARIABLE PYTHON_VERSION_FULL
OUTPUT_STRIP_TRAILING_WHITESPACE)
-string(REGEX MATCH "[0-9].[0-9]" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")
+string(REGEX MATCH "[0-9]+.[0-9]+" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")
if(UNIX)
set(PYTHON_PLUGIN_INSTALL_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv)
if(APPLE)
############################## Eigen ##############################
if(WITH_EIGEN)
- find_path(EIGEN_INCLUDE_PATH "Eigen/Core"
+ find_path(EIGEN_INCLUDE_PATH "Eigen/Core"
PATHS "/usr/local/include/eigen2" "/opt/include/eigen2" "/usr/include/eigen2"
"/usr/local/include/eigen3" "/opt/include/eigen3" "/usr/include/eigen3"
DOC "The path to Eigen2/Eigen3 headers")
if(WIN32)
set(WITH_VIDEOINPUT ON CACHE BOOL "Build HighGUI with DirectShow support")
-
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} comctl32 gdi32 ole32)
if(WITH_VIDEOINPUT)
endif()
endif()
-
############## Android source tree for native camera ###############
if(ANDROID)
SET (ANDROID_SOURCE_TREE "ANDROID_SOURCE_TREE-NOTFOUND" CACHE PATH
endif()
endif()
-
-################### DOXYGEN ###############
-
-#find_package(Doxygen)
-#
-#if(DOXYGEN_FOUND)
-# set(BUILD_DOXYGEN_DOCS ON CACHE BOOL "Generate HTML docs using Doxygen")
-#endif()
-
-
# ----------------------------------------------------------------------------
# UPDATE CONFIG FILES & SCRIPTS:
#
# CONFIGURE_FILE(InputFile OutputFile [COPYONLY] [ESCAPE_QUOTES] [@ONLY])
-# If @ONLY is specified, only variables of the form @VAR@ will be
+# If @ONLY is specified, only variables of the form @VAR@ will be
# replaces and ${VAR} will be ignored.
#
# A directory will be created for each platform so the "cvconfig.h" file is
-# not overwritten if cmake generates code in the same path.
+# not overwritten if cmake generates code in the same path.
# ----------------------------------------------------------------------------
add_definitions(-DHAVE_CVCONFIG_H)
message(STATUS "Parsing 'cvconfig.h.cmake'")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cvconfig.h.cmake" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h")
-
# ---------------------------------------------------------------------------
# The C+//0 include & link directories:
# ---------------------------------------------------------------------------
"${CMAKE_CURRENT_SOURCE_DIR}/include/opencv"
)
-
# ----------------------------------------------------------------------------
# Set the maximum level of warnings:
# ----------------------------------------------------------------------------
# 64-bit portability warnings, in MSVC8
if(MSVC80)
set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /Wp64")
-
endif()
#if(MSVC90)
# set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /D _BIND_TO_CURRENT_CRT_VERSION=1 /D _BIND_TO_CURRENT_VCLIBS_VERSION=1")
set(EXTRA_EXE_LINKER_FLAGS_RELEASE "${EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug")
- #if(ENABLE_OPENMP)
- # set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} /openmp")
- #endif()
-
# Remove unreferenced functions: function level linking
set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} /Gy")
set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} /Zi")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
-
# High level of warnings.
set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Wall")
# The -Wno-long-long is required in 64bit systems when including sytem headers.
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES x86_64*)
- set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Wno-long-long")
+ set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Wno-long-long")
endif()
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES amd64*)
- set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Wno-long-long")
+ set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Wno-long-long")
endif()
# We need pthread's
- if(UNIX)
- if(NOT ANDROID)
+ if(UNIX AND NOT ANDROID)
set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -pthread")
- endif()
endif()
if(OPENCV_WARNINGS_ARE_ERRORS)
set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror")
endif()
- if(X86)
- if(NOT MINGW64)
- if(NOT X86_64)
- if(NOT APPLE)
- set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -march=i686")
- endif()
- endif()
- endif()
+ if(X86 AND NOT MINGW64 AND NOT X86_64 AND NOT APPLE)
+ set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -march=i686")
endif()
# Other optimizations
endif()
if(X86 OR X86_64)
- if(NOT APPLE)
- if(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
- set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -mfpmath=387")
- endif()
+ if(NOT APPLE AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4)
+ set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -mfpmath=387")
endif()
endif()
# Profiling?
if(ENABLE_PROFILING)
set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -pg -g")
- else()
- # Remove unreferenced functions: function level linking
- if(NOT APPLE)
- set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -ffunction-sections")
- endif()
+ elseif(NOT APPLE)
+ # Remove unreferenced functions: function level linking
+ set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -ffunction-sections")
endif()
- # Parallel mode
- #if(ENABLE_OPENMP)
- # set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -D_GLIBCXX_PARALLEL -fopenmp")
- # set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} gomp)
- #endif()
-
set(EXTRA_C_FLAGS_RELEASE "${EXTRA_C_FLAGS_RELEASE} -DNDEBUG")
set(EXTRA_C_FLAGS_DEBUG "${EXTRA_C_FLAGS_DEBUG} -O0 -ggdb3 -DDEBUG -D_DEBUG")
-
endif()
if(MSVC)
endif()
# Extra link libs if the user selects building static libs:
-if(NOT BUILD_SHARED_LIBS)
- if(CMAKE_COMPILER_IS_GNUCXX)
- set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} stdc++)
- set(OPENCV_EXTRA_C_FLAGS "-fPIC ${OPENCV_EXTRA_C_FLAGS}")
- endif()
+if(NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID)
+ # Android does not need these settings because they are already set by toolchain file
+ set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} stdc++)
+ set(OPENCV_EXTRA_C_FLAGS "-fPIC ${OPENCV_EXTRA_C_FLAGS}")
endif()
-
# Add user supplied extra options (optimization, etc...)
# ==========================================================
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS}" CACHE STRING "Extra compiler options")
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "Extra linker flags for Release build" FORCE)
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG "${OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING "Extra linker flags for Debug build" FORCE)
+#combine all "extra" options
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS} ${OPENCV_EXTRA_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_C_FLAGS} ${OPENCV_EXTRA_C_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${EXTRA_C_FLAGS_RELEASE} ${OPENCV_EXTRA_C_FLAGS_RELEASE}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${EXTRA_EXE_LINKER_FLAGS_DEBUG} ${OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG}")
# In case of Makefiles if the user does not setup CMAKE_BUILD_TYPE, assume it's Release:
-if (${CMAKE_GENERATOR} MATCHES ".*Makefiles")
- if("${CMAKE_BUILD_TYPE}" STREQUAL "")
- set(CMAKE_BUILD_TYPE Release)
- endif()
+if (${CMAKE_GENERATOR} MATCHES ".*Makefiles" AND "${CMAKE_BUILD_TYPE}" STREQUAL "")
+ set(CMAKE_BUILD_TYPE Release)
endif()
if (WIN32 AND MSVC)
string(REPLACE "/EHsc" "/EHsc-" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "/EHsc" "/EHsc-" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
- string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- string(REPLACE "/Zm1000" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+ string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ string(REPLACE "/Zm1000" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
endif()
if("${CMAKE_CONFIGURE_LDFLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_CONFIGURE_LDFLAGS}")
endif("${CMAKE_CONFIGURE_LDFLAGS}")
-
-# ----------------------------------------------------------------------------
-# PROCESS SUBDIRECTORIES:
-# ----------------------------------------------------------------------------
-# Save libs and executables in the same place
-set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE PATH "Output directory for libraries" )
-set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Output directory for applications" )
-
-if(ANDROID)
-set(OPENCV_DOC_INSTALL_PATH doc)
-elseif(WIN32)
-set(OPENCV_DOC_INSTALL_PATH doc)
-else()
-set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
-endif()
-
-if(ANDROID)
-set(OPENCV_LIB_INSTALL_PATH libs/${ARMEABI_NDK_NAME})
-else()
-set(OPENCV_LIB_INSTALL_PATH lib)
-endif()
-
-
# --------------------------------------------------------------------------------------------
-# Installation for CMake Module: OpenCVConfig.cmake
+# Installation for CMake Module: OpenCVConfig.cmake
# Part 1/3: ${BIN_DIR}/OpenCVConfig.cmake -> For use *without* "make install"
# Part 2/3: ${BIN_DIR}/unix-install/OpenCVConfig.cmake -> For use with "make install"
# Part 3/3: ${BIN_DIR}/win-install/OpenCVConfig.cmake -> For use within binary installers/packages
if(UNIX)
# For a command "FIND_PACKAGE(FOO)", CMake will look at the directory /usr/share|lib/FOO/FOOConfig.cmake, so:
- install(FILES ${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake DESTINATION share/OpenCV/)
+ install(FILES "${CMAKE_BINARY_DIR}/unix-install/OpenCVConfig.cmake" DESTINATION share/OpenCV/)
+endif()
+
+if(ANDROID)
+ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/android/android.toolchain.cmake" DESTINATION share/OpenCV)
endif()
# --------------------------------------------------------------------------------------------
endif()
endif()
endif(ANDROID)
+
# -------------------------------------------------------------------------------------------
# Part 1/2: ${BIN_DIR}/OpenCV.mk -> For use *without* "make install"
# -------------------------------------------------------------------------------------------
# includedir=${prefix}/include/opencv
# -------------------------------------------------------------------------------------------
set(prefix ${CMAKE_INSTALL_PREFIX})
-set(exec_prefix "\${prefix}")
+set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/lib")
-set(includedir "\${prefix}/include")
-set(VERSION ${OPENCV_VERSION})
+set(includedir "\${prefix}/include")
+set(VERSION ${OPENCV_VERSION})
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/opencv.pc.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/opencv.pc" @ONLY IMMEDIATE)
install(FILES ${CMAKE_BINARY_DIR}/unix-install/opencv.pc DESTINATION ${OPENCV_LIB_INSTALL_PATH}/pkgconfig)
endif()
-if(ANDROID)
- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/android/android.toolchain.cmake" DESTINATION share/OpenCV)
-endif()
-
# ----------------------------------------------------------------------------
# Uninstall target, for "make uninstall"
# ----------------------------------------------------------------------------
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
-ADD_CUSTOM_TARGET(uninstall
- "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
-
+ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
# ----------------------------------------------------------------------------
# CPack target
set(BUILD_PACKAGE OFF CACHE BOOL "Build a installer with the SDK")
if(BUILD_PACKAGE)
-
configure_file(
- Package.cmake.in
- ${CMAKE_BINARY_DIR}/.cpack/Package.cmake
- @ONLY
- )
-
+ Package.cmake.in
+ ${CMAKE_BINARY_DIR}/.cpack/Package.cmake
+ @ONLY
+ )
include(${CMAKE_BINARY_DIR}/.cpack/Package.cmake)
set(root_files README)
-
file(GLOB root_src_files *.in *.cmake CMakeLists.txt)
if (NOT WIN32)
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
foreach(m calib3d core contrib features2d ffmpeg flann gpu highgui imgproc legacy ml objdetect video)
install(FILES ${EXECUTABLE_OUTPUT_PATH}/Debug/opencv_${m}${OPENCV_DLLVERSION}d.dll
- DESTINATION bin COMPONENT main)
+ DESTINATION bin COMPONENT main)
install(FILES ${LIBRARY_OUTPUT_PATH}/Debug/opencv_${m}${OPENCV_DLLVERSION}d.lib
- DESTINATION lib COMPONENT main)
+ DESTINATION lib COMPONENT main)
endforeach()
endif()
endif()
endif()
-
#-----------------------------------
# Solution folders:
#-----------------------------------
add_subdirectory(modules)
add_subdirectory(doc)
add_subdirectory(data)
+add_subdirectory(3rdparty)
if(BUILD_EXAMPLES OR INSTALL_PYTHON_EXAMPLES)
add_subdirectory(samples)
endif()
-add_subdirectory(3rdparty)
-
-
# ----------------------------------------------------------------------------
# Summary:
# ----------------------------------------------------------------------------
else(ARMEABI_V7A)
message(STATUS " AndroidNativeCamera: NO")
endif(ARMEABI_V7A)
-endif()
-endif() #if(UNIX AND NOT APPLE)
+endif(ANDROID)
+endif(UNIX AND NOT APPLE)
if(APPLE)
message(STATUS "")
else()
message(STATUS " Video I/O: QTKit")
endif()
-endif()
+endif(APPLE)
if(WIN32 AND HAVE_VIDEOINPUT)
message(STATUS "")
message(STATUS " Build Documentation: NO")
endif()
-#if(BUILD_DOXYGEN_DOCS AND DOXYGEN_FOUND)
-#message(STATUS " Doxygen HTMLs YES")
-#else()
-#message(STATUS " Doxygen HTMLs NO")
-#endif()
-
message(STATUS "")
message(STATUS " Install path: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "")
message(STATUS " cvconfig.h is in: ${OPENCV_CONFIG_FILE_INCLUDE_DIR}")
message(STATUS "-----------------------------------------------------------------")
message(STATUS "")
-
-#----------------------------------------------------------------------------
-# Generate the OpenCVConfig.cmake file for unix
-# installation in CMAKE_INSTALL_PREFIX
-#----------------------------------------------------------------------------