mirror of https://github.com/opencv/opencv.git
- removed OpenCV_LIB_DIR* vars (they are broken and not required anymore) - OpenCVConfig.cmake doesn't contain ANDROID/CUDA code if there is no such support - removed OpenCV2_INCLUDE_DIRS_CONFIGCMAKE, merged into OpenCV_INCLUDE_DIRS_CONFIGCMAKE - fix hard-coded relative paths for OpenCV_INSTALL_PATH - removed OpenCV_TBB_ARCH - switch OpenCVConfig.cmake into 2-level mode for Android SDKpull/5980/head
parent
7188e6e2ac
commit
c6c651212c
10 changed files with 315 additions and 414 deletions
@ -0,0 +1,13 @@ |
|||||||
|
# Android API level from which OpenCV has been compiled is remembered |
||||||
|
set(OpenCV_ANDROID_NATIVE_API_LEVEL "@OpenCV_ANDROID_NATIVE_API_LEVEL_CONFIGCMAKE@") |
||||||
|
|
||||||
|
# ============================================================== |
||||||
|
# Check OpenCV availability |
||||||
|
# ============================================================== |
||||||
|
if(OpenCV_ANDROID_NATIVE_API_LEVEL GREATER ANDROID_NATIVE_API_LEVEL) |
||||||
|
if(NOT OpenCV_FIND_QUIETLY) |
||||||
|
message(WARNING "Minimum required by OpenCV API level is android-${OpenCV_ANDROID_NATIVE_API_LEVEL}") |
||||||
|
endif() |
||||||
|
set(OpenCV_FOUND 0) |
||||||
|
return() |
||||||
|
endif() |
@ -0,0 +1,53 @@ |
|||||||
|
# Version Compute Capability from which OpenCV has been compiled is remembered |
||||||
|
set(OpenCV_COMPUTE_CAPABILITIES "@OpenCV_CUDA_CC@") |
||||||
|
|
||||||
|
set(OpenCV_CUDA_VERSION "@CUDA_VERSION_STRING@") |
||||||
|
set(OpenCV_USE_CUBLAS "@HAVE_CUBLAS@") |
||||||
|
set(OpenCV_USE_CUFFT "@HAVE_CUFFT@") |
||||||
|
set(OpenCV_USE_NVCUVID "@HAVE_NVCUVID@") |
||||||
|
|
||||||
|
if(NOT CUDA_FOUND) |
||||||
|
find_host_package(CUDA ${OpenCV_CUDA_VERSION} EXACT REQUIRED) |
||||||
|
else() |
||||||
|
if(NOT CUDA_VERSION_STRING VERSION_EQUAL OpenCV_CUDA_VERSION) |
||||||
|
message(FATAL_ERROR "OpenCV static library was compiled with CUDA ${OpenCV_CUDA_VERSION} support. Please, use the same version or rebuild OpenCV with CUDA ${CUDA_VERSION_STRING}") |
||||||
|
endif() |
||||||
|
endif() |
||||||
|
|
||||||
|
set(OpenCV_CUDA_LIBS_ABSPATH ${CUDA_LIBRARIES}) |
||||||
|
|
||||||
|
if(${CUDA_VERSION} VERSION_LESS "5.5") |
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_npp_LIBRARY}) |
||||||
|
else() |
||||||
|
find_cuda_helper_libs(nppc) |
||||||
|
find_cuda_helper_libs(nppi) |
||||||
|
find_cuda_helper_libs(npps) |
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nppc_LIBRARY} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY}) |
||||||
|
endif() |
||||||
|
|
||||||
|
if(OpenCV_USE_CUBLAS) |
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUBLAS_LIBRARIES}) |
||||||
|
endif() |
||||||
|
|
||||||
|
if(OpenCV_USE_CUFFT) |
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_CUFFT_LIBRARIES}) |
||||||
|
endif() |
||||||
|
|
||||||
|
if(OpenCV_USE_NVCUVID) |
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvid_LIBRARIES}) |
||||||
|
endif() |
||||||
|
|
||||||
|
if(WIN32) |
||||||
|
list(APPEND OpenCV_CUDA_LIBS_ABSPATH ${CUDA_nvcuvenc_LIBRARIES}) |
||||||
|
endif() |
||||||
|
|
||||||
|
set(OpenCV_CUDA_LIBS_RELPATH "") |
||||||
|
foreach(l ${OpenCV_CUDA_LIBS_ABSPATH}) |
||||||
|
get_filename_component(_tmp ${l} PATH) |
||||||
|
if(NOT ${_tmp} MATCHES "-Wl.*") |
||||||
|
list(APPEND OpenCV_CUDA_LIBS_RELPATH ${_tmp}) |
||||||
|
endif() |
||||||
|
endforeach() |
||||||
|
|
||||||
|
list(REMOVE_DUPLICATES OpenCV_CUDA_LIBS_RELPATH) |
||||||
|
link_directories(${OpenCV_CUDA_LIBS_RELPATH}) |
@ -0,0 +1,7 @@ |
|||||||
|
if(NOT TARGET ippicv) |
||||||
|
add_library(ippicv STATIC IMPORTED) |
||||||
|
set_target_properties(ippicv PROPERTIES |
||||||
|
IMPORTED_LINK_INTERFACE_LIBRARIES "" |
||||||
|
IMPORTED_LOCATION "${OpenCV_INSTALL_PATH}/@IPPICV_INSTALL_PATH_RELATIVE_CONFIGCMAKE@" |
||||||
|
) |
||||||
|
endif() |
@ -0,0 +1,50 @@ |
|||||||
|
# =================================================================================== |
||||||
|
# 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) |
||||||
|
# include_directories(${OpenCV_INCLUDE_DIRS}) # Not needed for CMake >= 2.8.11 |
||||||
|
# target_link_libraries(MY_TARGET_NAME ${OpenCV_LIBS}) |
||||||
|
# |
||||||
|
# Or you can search for specific OpenCV modules: |
||||||
|
# |
||||||
|
# find_package(OpenCV REQUIRED core videoio) |
||||||
|
# |
||||||
|
# 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 all imported targets for OpenCV modules. |
||||||
|
# - OpenCV_INCLUDE_DIRS : The OpenCV include directories. |
||||||
|
# - OpenCV_ANDROID_NATIVE_API_LEVEL : Minimum required level of Android API. |
||||||
|
# - OpenCV_VERSION : The version of this OpenCV build: "@OPENCV_VERSION_PLAIN@" |
||||||
|
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION: "@OPENCV_VERSION_MAJOR@" |
||||||
|
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION: "@OPENCV_VERSION_MINOR@" |
||||||
|
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION: "@OPENCV_VERSION_PATCH@" |
||||||
|
# - OpenCV_VERSION_STATUS : Development status of this build: "@OPENCV_VERSION_STATUS@" |
||||||
|
# |
||||||
|
# =================================================================================== |
||||||
|
|
||||||
|
# Extract directory name from full path of the file currently being processed. |
||||||
|
# Note that CMake 2.8.3 introduced CMAKE_CURRENT_LIST_DIR. We reimplement it |
||||||
|
# for older versions of CMake to support these as well. |
||||||
|
if(CMAKE_VERSION VERSION_LESS "2.8.3") |
||||||
|
get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) |
||||||
|
endif() |
||||||
|
|
||||||
|
if(NOT DEFINED OpenCV_CONFIG_SUBDIR) |
||||||
|
set(OpenCV_CONFIG_SUBDIR "/abi-${ANDROID_NDK_ABI_NAME}") |
||||||
|
endif() |
||||||
|
|
||||||
|
set(OpenCV_CONFIG_PATH "${CMAKE_CURRENT_LIST_DIR}${OpenCV_CONFIG_SUBDIR}") |
||||||
|
if(EXISTS "${OpenCV_CONFIG_PATH}/OpenCVConfig.cmake") |
||||||
|
include("${OpenCV_CONFIG_PATH}/OpenCVConfig.cmake") |
||||||
|
else() |
||||||
|
if(NOT OpenCV_FIND_QUIETLY) |
||||||
|
message(WARNING "Found OpenCV Android Pack but it has no binaries compatible with your ABI (can't find: ${OpenCV_CONFIG_SUBDIR})") |
||||||
|
endif() |
||||||
|
set(OpenCV_FOUND FALSE) |
||||||
|
endif() |
Loading…
Reference in new issue