Fixed Android build with FastCV.

This commit is contained in:
Alexander Smorkalov 2025-04-10 18:21:25 +03:00
parent ba6eb8d952
commit 250ea3d7c6
2 changed files with 10 additions and 7 deletions

View File

@ -9,7 +9,7 @@ if(HAVE_FASTCV)
file(GLOB FASTCV_HAL_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
add_library(fastcv_hal STATIC ${FASTCV_HAL_FILES})
add_library(fastcv_hal STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${FASTCV_HAL_FILES})
target_include_directories(fastcv_hal PRIVATE
${CMAKE_SOURCE_DIR}/modules/core/include

View File

@ -197,13 +197,16 @@ if(WITH_FASTCV)
set(FastCV_INCLUDE_PATH "${FCV_ROOT_DIR}/inc" CACHE PATH "FastCV includes directory")
set(FastCV_LIB_PATH "${FCV_ROOT_DIR}/libs" CACHE PATH "FastCV library directory")
ocv_install_3rdparty_licenses(FastCV "${OpenCV_BINARY_DIR}/3rdparty/fastcv/LICENSE")
if(ANDROID)
set(FASTCV_LIBRARY "${FastCV_LIB_PATH}/libfastcvopt.so" CACHE PATH "FastCV library")
install(FILES "${FASTCV_LIBRARY}" DESTINATION "${OPENCV_LIB_INSTALL_PATH}" COMPONENT "bin")
else()
set(FASTCV_LIBRARY "${FastCV_LIB_PATH}/libfastcv.a" CACHE PATH "FastCV library")
install(FILES "${FASTCV_LIBRARY}" DESTINATION "${OPENCV_LIB_INSTALL_PATH}" COMPONENT "dev")
add_library(fastcv STATIC IMPORTED)
set_target_properties(fastcv PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES ""
IMPORTED_LOCATION "${FastCV_LIB_PATH}/libfastcv.a"
)
if (NOT BUILD_SHARED_LIBS)
install(FILES "${FastCV_LIB_PATH}/libfastcv.a" DESTINATION "${OPENCV_3P_LIB_INSTALL_PATH}" COMPONENT "dev")
endif()
set(FASTCV_LIBRARY "fastcv" CACHE PATH "FastCV library")
list(APPEND OPENCV_LINKER_LIBS ${FASTCV_LIBRARY})
else()
set(HAVE_FASTCV FALSE CACHE BOOL "FastCV status")
endif()