提交 c8f6a2d0 编写于 作者: M MissPenguin

fix cpp autolog

上级 6382612f
project(ppocr CXX C) project(ppocr CXX C)
cmake_minimum_required(VERSION 3.14)
option(WITH_MKL "Compile demo with MKL/OpenBlas support, default use MKL." ON) option(WITH_MKL "Compile demo with MKL/OpenBlas support, default use MKL." ON)
option(WITH_GPU "Compile demo with GPU/CPU, default use CPU." OFF) option(WITH_GPU "Compile demo with GPU/CPU, default use CPU." OFF)
...@@ -206,13 +207,12 @@ endif() ...@@ -206,13 +207,12 @@ endif()
set(DEPS ${DEPS} ${OpenCV_LIBS}) set(DEPS ${DEPS} ${OpenCV_LIBS})
include(ExternalProject) include(FetchContent)
include(external-cmake/auto-log.cmake) include(external-cmake/auto-log.cmake)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/autolog/src/extern_Autolog/auto_log) include_directories(${FETCHCONTENT_BASE_DIR}/extern_autolog-src)
AUX_SOURCE_DIRECTORY(./src SRCS) AUX_SOURCE_DIRECTORY(./src SRCS)
add_executable(${DEMO_NAME} ${SRCS}) add_executable(${DEMO_NAME} ${SRCS})
target_link_libraries(${DEMO_NAME} ${DEPS}) target_link_libraries(${DEMO_NAME} ${DEPS})
if (WIN32 AND WITH_MKL) if (WIN32 AND WITH_MKL)
......
find_package(Git REQUIRED) find_package(Git REQUIRED)
message("${CMAKE_BUILD_TYPE}") include(FetchContent)
set(AUTOLOG_REPOSITORY https://github.com/LDOUBLEV/AutoLog.git) set(FETCHCONTENT_BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}/third-party")
SET(AUTOLOG_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/install/Autolog)
ExternalProject_Add( FetchContent_Declare(
extern_Autolog extern_Autolog
PREFIX autolog PREFIX autolog
GIT_REPOSITORY ${AUTOLOG_REPOSITORY} GIT_REPOSITORY https://github.com/LDOUBLEV/AutoLog.git
GIT_TAG main GIT_TAG main
DOWNLOAD_NO_EXTRACT True
INSTALL_COMMAND cmake -E echo "Skipping install step."
) )
FetchContent_MakeAvailable(extern_Autolog)
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include "auto_log/autolog.h"
DEFINE_bool(use_gpu, false, "Infering with GPU or CPU."); DEFINE_bool(use_gpu, false, "Infering with GPU or CPU.");
DEFINE_int32(gpu_id, 0, "Device id of GPU to execute."); DEFINE_int32(gpu_id, 0, "Device id of GPU to execute.");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册