Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.4' into merge-2.4
Browse files Browse the repository at this point in the history
* opencv#1538 from StevenPuttemans:bugfix_3283
* opencv#1545 from alalek:ocl_test_fix_rng
* opencv#1551 from alalek:cmake_install_win
* opencv#1570 from ilya-lavrenov:ipp_warn_fix
* opencv#1573 from alalek:perf_simple_strategy
* opencv#1574 from alalek:svm_workaround
* opencv#1576 from alalek:ocl_fix_cl_double
* opencv#1577 from ilya-lavrenov:ocl_setto_opencl12
* opencv#1578 from asmorkalov:android_fd_cp_fix
* opencv#1579 from ilya-lavrenov:ocl_norm
* opencv#1582 from sperrholz:ocl-arithm-additions
* opencv#1586 from ilya-lavrenov:ocl_setto_win_fix
* opencv#1589 from ilya-lavrenov:pr1582_fix
* opencv#1591 from alalek:ocl_remove_cl_hpp_h
* opencv#1592 from alalek:ocl_program_cache_update
* opencv#1593 from ilya-lavrenov:ocl_war_on_double
* opencv#1594 from ilya-lavrenov:ocl_perf
* opencv#1595 from alalek:cl_code_cleanup
* opencv#1596 from alalek:test_fix_run_py
* opencv#1597 from alalek:ocl_fix_cleanup
* opencv#1598 from alalek:ocl_fix_build_mac
* opencv#1599 from ilya-lavrenov:ocl_mac_kernel_warnings
* opencv#1601 from ilya-lavrenov:ocl_fix_tvl1_and_sparse
* opencv#1602 from alalek:ocl_test_dump_info
* opencv#1603 from ilya-lavrenov:ocl_disable_svm_noblas
* opencv#1605 from alalek:ocl_fixes
* opencv#1606 from ilya-lavrenov:ocl_imgproc
* opencv#1607 from ilya-lavrenov:ocl_fft_cleanup
* opencv#1608 from alalek:fix_warn_upd_haar
* opencv#1609 from ilya-lavrenov:ocl_some_optimization
* opencv#1610 from alalek:ocl_fix_perf_kalman
* opencv#1612 from alalek:ocl_fix_string_info
* opencv#1614 from ilya-lavrenov:ocl_svm_misprint
* opencv#1616 from ilya-lavrenov:ocl_cvtColor
* opencv#1617 from ilya-lavrenov:ocl_info
* opencv#1622 from a0byte:2.4
* opencv#1625 from ilya-lavrenov:to_string

Conflicts:
	cmake/OpenCVConfig.cmake
	cmake/OpenCVDetectPython.cmake
	cmake/OpenCVGenConfig.cmake
	modules/core/CMakeLists.txt
	modules/nonfree/src/surf.ocl.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/include/opencv2/ocl/private/util.hpp
	modules/ocl/perf/main.cpp
	modules/ocl/src/arithm.cpp
	modules/ocl/src/cl_operations.cpp
	modules/ocl/src/cl_programcache.cpp
	modules/ocl/src/color.cpp
	modules/ocl/src/fft.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/src/gemm.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/matrix_operations.cpp
	modules/ocl/src/pyrlk.cpp
	modules/ocl/src/split_merge.cpp
	modules/ocl/src/svm.cpp
	modules/ocl/test/main.cpp
	modules/ocl/test/test_fft.cpp
	modules/ocl/test/test_moments.cpp
	modules/ocl/test/test_objdetect.cpp
	modules/ocl/test/test_optflow.cpp
	modules/ocl/test/utility.hpp
	modules/python/CMakeLists.txt
	modules/ts/include/opencv2/ts.hpp
	modules/ts/src/ts_perf.cpp
	samples/android/face-detection/jni/DetectionBasedTracker_jni.cpp
  • Loading branch information
alalek committed Oct 15, 2013
2 parents 3f8db9d + 98d55f3 commit e845184
Show file tree
Hide file tree
Showing 124 changed files with 3,137 additions and 3,188 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/libjasper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()

if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${JASPER_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
endif()
2 changes: 1 addition & 1 deletion 3rdparty/libjpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()

if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${JPEG_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
endif()
2 changes: 1 addition & 1 deletion 3rdparty/libpng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()

if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${PNG_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${PNG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
endif()
4 changes: 2 additions & 2 deletions 3rdparty/libtiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ if(WIN32 AND NOT HAVE_WINRT)
else()
list(APPEND lib_srcs tif_unix.c)
endif()

ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef -Wunused -Wsign-compare
-Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
Expand Down Expand Up @@ -115,5 +115,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()

if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${TIFF_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${TIFF_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
endif()
3 changes: 2 additions & 1 deletion 3rdparty/libwebp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()

if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${WEBP_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${WEBP_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
endif()

2 changes: 1 addition & 1 deletion 3rdparty/openexr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()

if(NOT BUILD_SHARED_LIBS)
install(TARGETS IlmImf ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(IlmImf EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
endif()

set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATHS} PARENT_SCOPE)
Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/tbb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(tbb PROPERTIES FOLDER "3rdparty")
endif()

install(TARGETS tbb
RUNTIME DESTINATION bin COMPONENT main
install(TARGETS tbb EXPORT OpenCVModules
RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main
)
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ if(ENABLE_SOLUTION_FOLDERS)
endif()

if(NOT BUILD_SHARED_LIBS)
install(TARGETS ${ZLIB_LIBRARY} ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
ocv_install_target(${ZLIB_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT main)
endif()
54 changes: 46 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ if(NOT CMAKE_TOOLCHAIN_FILE)
else()
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory")
endif()

if(MSVC)
set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
endif()
else(NOT CMAKE_TOOLCHAIN_FILE)
#Android: set output folder to ${CMAKE_BINARY_DIR}
set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are compiled to" )
Expand All @@ -44,6 +40,10 @@ endif()

project(OpenCV CXX C)

if(MSVC)
set(CMAKE_USE_RELATIVE_PATHS ON CACHE INTERNAL "" FORCE)
endif()

include(cmake/OpenCVUtils.cmake)

# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -176,6 +176,7 @@ OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID

# OpenCV installation options
# ===================================================
OCV_OPTION(INSTALL_CREATE_DISTRIB "Change install rules to build the distribution package" OFF )
OCV_OPTION(INSTALL_C_EXAMPLES "Install C examples" OFF )
OCV_OPTION(INSTALL_PYTHON_EXAMPLES "Install Python examples" OFF )
OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
Expand Down Expand Up @@ -224,6 +225,21 @@ else()
set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc)
endif()

if(WIN32)
if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH)
set(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/")
else()
message(STATUS "Can't detect runtime and/or arch")
set(OpenCV_INSTALL_BINARIES_PREFIX "")
endif()
else()
set(OpenCV_INSTALL_BINARIES_PREFIX "")
endif()

set(OPENCV_SAMPLES_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}samples")

set(OPENCV_BIN_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}bin")

if(ANDROID)
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib/${ANDROID_NDK_ABI_NAME}")
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib/${ANDROID_NDK_ABI_NAME}")
Expand All @@ -234,9 +250,18 @@ if(ANDROID)
else()
set(LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/lib")
set(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}")
set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
set(OPENCV_INCLUDE_INSTALL_PATH include)
if(WIN32)
if(OpenCV_STATIC)
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
else()
set(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}")
endif()
set(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}")
else()
set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX})
set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH})
endif()
set(OPENCV_INCLUDE_INSTALL_PATH "include")

math(EXPR SIZEOF_VOID_P_BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
if(LIB_SUFFIX AND NOT SIZEOF_VOID_P_BITS EQUAL LIB_SUFFIX)
Expand Down Expand Up @@ -812,7 +837,20 @@ if(HAVE_OPENCL)
status(" Include path:" ${OPENCL_INCLUDE_DIRS})
endif()
if(OPENCL_LIBRARIES)
status(" libraries:" ${OPENCL_LIBRARIES})
set(__libs "")
foreach(l ${OPENCL_LIBRARIES})
if(TARGET ${l})
get_target_property(p ${l} LOCATION)
if(p MATCHES NOTFOUND)
list(APPEND __libs "${l}")
else()
list(APPEND __libs "${p}")
endif()
else()
list(APPEND __libs "${l}")
endif()
endforeach()
status(" libraries:" ${__libs})
endif()
status(" Use AMDFFT:" HAVE_CLAMDFFT THEN YES ELSE NO)
status(" Use AMDBLAS:" HAVE_CLAMDBLAS THEN YES ELSE NO)
Expand Down
14 changes: 11 additions & 3 deletions apps/haartraining/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,17 @@ set_target_properties(opencv_performance PROPERTIES
# Install part
# -----------------------------------------------------------

install(TARGETS opencv_haartraining RUNTIME DESTINATION bin COMPONENT main)
install(TARGETS opencv_createsamples RUNTIME DESTINATION bin COMPONENT main)
install(TARGETS opencv_performance RUNTIME DESTINATION bin COMPONENT main)
if(INSTALL_CREATE_DISTRIB)
if(BUILD_SHARED_LIBS)
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
endif()
else()
install(TARGETS opencv_haartraining RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
install(TARGETS opencv_createsamples RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
install(TARGETS opencv_performance RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
endif()

if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(opencv_performance PROPERTIES FOLDER "applications")
Expand Down
8 changes: 7 additions & 1 deletion apps/traincascade/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(${the_target} PROPERTIES FOLDER "applications")
endif()

install(TARGETS ${the_target} RUNTIME DESTINATION bin COMPONENT main)
if(INSTALL_CREATE_DISTRIB)
if(BUILD_SHARED_LIBS)
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT main)
endif()
else()
install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT main)
endif()
166 changes: 166 additions & 0 deletions cmake/OpenCVConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# ===================================================================================
# The OpenCV CMake configuration file
#
# ** File generated automatically, do not modify **
#
# Usage from an external project:
# In your CMakeLists.txt, add these lines:
#
# FIND_PACKAGE(OpenCV REQUIRED)
# TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${OpenCV_LIBS})
#
# Or you can search for specific OpenCV modules:
#
# FIND_PACKAGE(OpenCV REQUIRED core highgui)
#
# If the module is found then OPENCV_<MODULE>_FOUND is set to TRUE.
#
# This file will define the following variables:
# - OpenCV_LIBS : The list of libraries to links against.
# - OpenCV_LIB_DIR : The directory(es) where lib files are. Calling LINK_DIRECTORIES
# with this path is NOT needed.
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories.
# - OpenCV_COMPUTE_CAPABILITIES : The version of compute capability
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API
# - OpenCV_VERSION : The version of this OpenCV build. Example: "2.4.0"
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION. Example: "2"
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION. Example: "4"
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION. Example: "0"
#
# Advanced variables:
# - OpenCV_SHARED
# - OpenCV_CONFIG_PATH
# - OpenCV_LIB_COMPONENTS
#
# ===================================================================================
#
# Windows pack specific options:
# - OpenCV_STATIC
# - OpenCV_CUDA

if(CMAKE_VERSION VERSION_GREATER 2.6)
get_property(OpenCV_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
if(NOT ";${OpenCV_LANGUAGES};" MATCHES ";CXX;")
enable_language(CXX)
endif()
endif()

if(NOT DEFINED OpenCV_STATIC)
# look for global setting
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
set(OpenCV_STATIC OFF)
else()
set(OpenCV_STATIC ON)
endif()
endif()

if(NOT DEFINED OpenCV_CUDA)
# if user' app uses CUDA, then it probably wants CUDA-enabled OpenCV binaries
if(CUDA_FOUND)
set(OpenCV_CUDA ON)
endif()
endif()

if(MSVC)
if(CMAKE_CL_64)
set(OpenCV_ARCH x64)
set(OpenCV_TBB_ARCH intel64)
else()
set(OpenCV_ARCH x86)
set(OpenCV_TBB_ARCH ia32)
endif()
if(MSVC_VERSION EQUAL 1400)
set(OpenCV_RUNTIME vc8)
elseif(MSVC_VERSION EQUAL 1500)
set(OpenCV_RUNTIME vc9)
elseif(MSVC_VERSION EQUAL 1600)
set(OpenCV_RUNTIME vc10)
elseif(MSVC_VERSION EQUAL 1700)
set(OpenCV_RUNTIME vc11)
endif()
elseif(MINGW)
set(OpenCV_RUNTIME mingw)

execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64")
set(MINGW64 1)
set(OpenCV_ARCH x64)
else()
set(OpenCV_ARCH x86)
endif()
endif()

if(CMAKE_VERSION VERSION_GREATER 2.6.2)
unset(OpenCV_CONFIG_PATH CACHE)
endif()

if(NOT OpenCV_FIND_QUIETLY)
message(STATUS "OpenCV ARCH: ${OpenCV_ARCH}")
message(STATUS "OpenCV RUNTIME: ${OpenCV_RUNTIME}")
message(STATUS "OpenCV STATIC: ${OpenCV_STATIC}")
endif()

get_filename_component(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE)
if(OpenCV_RUNTIME AND OpenCV_ARCH)
if(OpenCV_STATIC AND EXISTS "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
if(OpenCV_CUDA AND EXISTS "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib/OpenCVConfig.cmake")
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib")
else()
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/staticlib")
endif()
elseif(EXISTS "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib/OpenCVConfig.cmake")
if(OpenCV_CUDA AND EXISTS "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib/OpenCVConfig.cmake")
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib")
else()
set(OpenCV_LIB_PATH "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}/lib")
endif()
endif()
endif()

if(OpenCV_LIB_PATH AND EXISTS "${OpenCV_LIB_PATH}/OpenCVConfig.cmake")
set(OpenCV_LIB_DIR_OPT "${OpenCV_LIB_PATH}" CACHE PATH "Path where release OpenCV libraries are located" FORCE)
set(OpenCV_LIB_DIR_DBG "${OpenCV_LIB_PATH}" CACHE PATH "Path where debug OpenCV libraries are located" FORCE)
set(OpenCV_3RDPARTY_LIB_DIR_OPT "${OpenCV_LIB_PATH}" CACHE PATH "Path where release 3rdpaty OpenCV dependencies are located" FORCE)
set(OpenCV_3RDPARTY_LIB_DIR_DBG "${OpenCV_LIB_PATH}" CACHE PATH "Path where debug 3rdpaty OpenCV dependencies are located" FORCE)

include("${OpenCV_LIB_PATH}/OpenCVConfig.cmake")

if(OpenCV_CUDA)
set(_OpenCV_LIBS "")
foreach(_lib ${OpenCV_LIBS})
string(REPLACE "${OpenCV_CONFIG_PATH}/gpu/${OpenCV_ARCH}/${OpenCV_RUNTIME}" "${OpenCV_CONFIG_PATH}/${OpenCV_ARCH}/${OpenCV_RUNTIME}" _lib2 "${_lib}")
if(NOT EXISTS "${_lib}" AND EXISTS "${_lib2}")
list(APPEND _OpenCV_LIBS "${_lib2}")
else()
list(APPEND _OpenCV_LIBS "${_lib}")
endif()
endforeach()
set(OpenCV_LIBS ${_OpenCV_LIBS})
endif()
set(OpenCV_FOUND TRUE CACHE BOOL "" FORCE)
set(OPENCV_FOUND TRUE CACHE BOOL "" FORCE)

if(NOT OpenCV_FIND_QUIETLY)
message(STATUS "Found OpenCV ${OpenCV_VERSION} in ${OpenCV_LIB_PATH}")
if(NOT OpenCV_LIB_PATH MATCHES "/staticlib")
get_filename_component(_OpenCV_LIB_PATH "${OpenCV_LIB_PATH}/../bin" ABSOLUTE)
file(TO_NATIVE_PATH "${_OpenCV_LIB_PATH}" _OpenCV_LIB_PATH)
message(STATUS "You might need to add ${_OpenCV_LIB_PATH} to your PATH to be able to run your applications.")
if(OpenCV_LIB_PATH MATCHES "/gpu/")
string(REPLACE "\\gpu" "" _OpenCV_LIB_PATH2 "${_OpenCV_LIB_PATH}")
message(STATUS "GPU support is enabled so you might also need ${_OpenCV_LIB_PATH2} in your PATH (it must go after the ${_OpenCV_LIB_PATH}).")
endif()
endif()
endif()
else()
if(NOT OpenCV_FIND_QUIETLY)
message(WARNING
"Found OpenCV Windows Pack but it has not binaries compatible with your configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV library."
)
endif()
set(OpenCV_FOUND FALSE CACHE BOOL "" FORCE)
set(OPENCV_FOUND FALSE CACHE BOOL "" FORCE)
endif()
Loading

0 comments on commit e845184

Please sign in to comment.