ports/graphics/opencv/files/FindOpenCVCore.cmake.in
Jan Beich d764059958 graphics/opencv: back out r423216 and r423063 (replaying r423316)
Renaming didn't help to unblock 3.x progress as co-existence with 2.x
was no less complex than simply fixing consumers. This commit also
restores directory-level history accidentally lost via git-svn.

PR:		210505
Pointy hat to:	jbeich (should've discussed first)
2017-04-14 05:30:25 +00:00

38 lines
1.3 KiB
CMake

# Module for finding the core components of OpenCV installed by
# graphics/opencv-core. Use for projects that require only
# opencv_core or opencv_imgproc. Others should use the
# standard OpenCV CMake find routines provided by graphics/opencv.
#
# This module provides:
# OPENCVCORE_FOUND - defined if the required OpenCV components are found
# OpenCV_INCLUDE_DIRS - the path to the OpenCV headers
# OpenCV_LIBS - the OpenCV libraries to link to
# OpenCV_VERSION - the version of OpenCV
#
# Example usage: find_package( OpenCVCore COMPONENTS core imgproc REQUIRED )
include( FindPackageHandleStandardArgs )
set( OpenCV_VERSION %%OCV_VERSION%% )
find_path( OpenCV_INCLUDE_DIRS NAMES opencv2/core/core.hpp )
if( OpenCVCore_FIND_COMPONENTS )
foreach( component ${OpenCVCore_FIND_COMPONENTS} )
string( TOUPPER ${component} _COMPONENT )
set( OPENCV_USE_${_COMPONENT} 1 )
endforeach()
endif()
# opencv_core is always required
find_library( OPENCV_CORE_LIBRARY NAMES opencv_core )
if( OPENCV_USE_IMGPROC OR NOT OpenCVCore_FIND_COMPONENTS )
find_library( OPENCV_IMGPROC_LIBRARY NAMES opencv_imgproc )
endif()
set( OpenCV_LIBS ${OPENCV_CORE_LIBRARY} ${OPENCV_IMGPROC_LIBRARY} )
find_package_handle_standard_args( OpenCVCore DEFAULT_MSG OpenCV_LIBS OpenCV_INCLUDE_DIRS )
mark_as_advanced( ${OpenCV_LIBS} ${OpenCV_INCLUDE_DIRS} ${OpenCV_VERSION} )