Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenCV linking in cmake #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ project(fastdeploy_ppocr CXX)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

find_package(OpenCV COMPONENTS core imgproc)
find_package(OpenCV REQUIRED COMPONENTS core imgproc)
find_package(onnxruntime REQUIRED)
find_package(Eigen3 REQUIRED)
message("OpenCV_LIBS: ${OpenCV_LIBS} ${OPENCV_core_FOUND} ${OPENCV_WORLD_FOUND}")
message("OpenCV_LIBS: ${OpenCV_LIBS} ${OPENCV_core_FOUND} ${OPENCV_WORLD_FOUND}, Include: ${OpenCV_INCLUDE_DIRS}, Version: ${OpenCV_VERSION}, Libs: ${OpenCV_LIBS}")

# Add OpenCV
include_directories(FastDeploy_Core PRIVATE ${OpenCV_INCLUDE_DIRS})

option(WITH_CUDA "Whether WITH_GPU=ON, will enable onnxruntime-gpu/paddle-infernce-gpu/poros-gpu" OFF)

Expand Down Expand Up @@ -40,6 +43,7 @@ target_include_directories(FastDeploy_Core PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> # for build
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDE}> # for install
)
target_link_libraries(FastDeploy_Core PRIVATE ${OpenCV_LIBS})
target_link_libraries(FastDeploy_Core PRIVATE onnxruntime::onnxruntime)

set(BACKEND_ONNXRUNTIME_SRC
Expand Down