From 32f1f055130c71665a9e17ede6548aa2dafd6417 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Wed, 3 Apr 2019 10:27:31 +0300 Subject: [PATCH] Fix Accelerate.framework full path --- cmake/templates/OpenCVConfig.cmake.in | 5 ++++- modules/core/CMakeLists.txt | 9 ++++++++- modules/dnn/CMakeLists.txt | 10 +++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/cmake/templates/OpenCVConfig.cmake.in b/cmake/templates/OpenCVConfig.cmake.in index 0813db8f3472..9696f4ddfac7 100644 --- a/cmake/templates/OpenCVConfig.cmake.in +++ b/cmake/templates/OpenCVConfig.cmake.in @@ -108,6 +108,10 @@ set(OpenCV_USE_MANGLED_PATHS @OpenCV_USE_MANGLED_PATHS_CONFIGCMAKE@) set(OpenCV_LIB_COMPONENTS @OPENCV_MODULES_CONFIGCMAKE@) set(OpenCV_INCLUDE_DIRS @OpenCV_INCLUDE_DIRS_CONFIGCMAKE@) +if(APPLE) + find_package(accelerate REQUIRED) +endif() + if(NOT TARGET opencv_core) include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${OpenCV_MODULES_SUFFIX}.cmake) endif() @@ -376,4 +380,3 @@ if("@Qt5OpenGL_FOUND@") find_dependency(Qt5OpenGL) endif() # AWP: Qt5 dependencies -- end - diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 20fdf96c59bf..14cb8927d9e3 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -71,9 +71,16 @@ endif() ocv_create_module(${extra_libs}) +if(HUNTER_ENABLED AND APPLE) + find_package(accelerate REQUIRED) + set(__lapack_libraries accelerate::accelerate) +else() + set(__lapack_libraries ${LAPACK_LIBRARIES}) +endif() + ocv_target_link_libraries(${the_module} LINK_PRIVATE "${ZLIB_LIBRARIES}" "${OPENCL_LIBRARIES}" "${VA_LIBRARIES}" - "${LAPACK_LIBRARIES}" "${CPUFEATURES_LIBRARIES}" "${HALIDE_LIBRARIES}" + "${__lapack_libraries}" "${CPUFEATURES_LIBRARIES}" "${HALIDE_LIBRARIES}" "${ITT_LIBRARIES}" "${OPENCV_HAL_LINKER_LIBS}" ) diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt index 00554b2b69e0..201da2d7d3cc 100644 --- a/modules/dnn/CMakeLists.txt +++ b/modules/dnn/CMakeLists.txt @@ -72,7 +72,15 @@ endif() set(include_dirs ${fw_inc}) set(sources_options "") -set(libs libprotobuf ${LAPACK_LIBRARIES}) + +if(HUNTER_ENABLED AND APPLE) + find_package(accelerate REQUIRED) + set(__lapack_libraries accelerate::accelerate) +else() + set(__lapack_libraries ${LAPACK_LIBRARIES}) +endif() + +set(libs libprotobuf ${__lapack_libraries}) if(OPENCV_DNN_OPENCL AND HAVE_OPENCL) list(APPEND include_dirs ${OPENCL_INCLUDE_DIRS}) else()