diff --git a/CMakeLists.txt b/CMakeLists.txt index e090ed5376..a6fdde0705 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,10 @@ endif () option(BUILD_TEST "build a demo" OFF) option(BUILD_XCFRAMEWORK "build xcframework for macOS app" OFF) option(BUILD_UNIVERSAL "build both arm64 and x86_64 on macOS" OFF) +option(INSTALL_PYTHON "install python ffi" OFF) +option(INSTALL_RESOURCE "install resource" OFF) + +set(CMAKE_INSTALL_RPATH "$ORIGIN/") if (BUILD_UNIVERSAL) set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") @@ -65,11 +69,27 @@ else () "-framework Accelerate" ) else () - find_package(OpenCV REQUIRED) + find_package(OpenCV REQUIRED PATHS ${OpenCV_DIR}) target_include_directories(MeoAssistant PRIVATE ${OpenCV_INCLUDE_DIRS}) target_link_libraries(MeoAssistant ${OpenCV_LIBS}) - target_link_libraries(MeoAssistant ppocr paddle_inference protobuf cryptopp gflags glog utf8proc xxhash iomp5 mkldnn mklml_intel) + include(${FASTDEPLOY_INSTALL_DIR}/FastDeploy.cmake) + include_directories(${FASTDEPLOY_INCS}) + + target_link_libraries(MeoAssistant ${FDLIB}) + target_link_libraries(MeoAssistant ${PADDLE2ONNX_LIB}) + target_link_libraries(MeoAssistant ${ORT_LIB}) + + install(TARGETS MeoAssistant DESTINATION .) + install(DIRECTORY ${FASTDEPLOY_INSTALL_DIR}/lib/ DESTINATION . USE_SOURCE_PERMISSIONS) + install(DIRECTORY ${FASTDEPLOY_INSTALL_DIR}/third_libs/install/paddle2onnx/lib/ DESTINATION . USE_SOURCE_PERMISSIONS) + install(DIRECTORY ${ORT_LIB_PATH}/ DESTINATION . USE_SOURCE_PERMISSIONS) + if (INSTALL_PYTHON) + install(DIRECTORY src/Python DESTINATION .) + endif (INSTALL_PYTHON) + if (INSTALL_RESOURCE) + install(DIRECTORY resource DESTINATION .) + endif (INSTALL_RESOURCE) endif (APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${PROJECT_SOURCE_DIR}/3rdparty/include") diff --git a/src/MeoAssistant/Config/Miscellaneous/OcrPack.h b/src/MeoAssistant/Config/Miscellaneous/OcrPack.h index 6f9b1ea83c..8ae3c8522b 100644 --- a/src/MeoAssistant/Config/Miscellaneous/OcrPack.h +++ b/src/MeoAssistant/Config/Miscellaneous/OcrPack.h @@ -46,10 +46,10 @@ namespace asst protected: OcrPack(); - std::unique_ptr m_ocr_option = nullptr; - std::unique_ptr m_det = nullptr; - std::unique_ptr m_rec = nullptr; - std::unique_ptr m_ocr = nullptr; + std::unique_ptr m_ocr_option; + std::unique_ptr m_det; + std::unique_ptr m_rec; + std::unique_ptr m_ocr; }; class WordOcr final : public SingletonHolder, public OcrPack