fix cpp autolog
This commit is contained in:
parent
6382612f39
commit
c8f6a2d098
|
@ -1,4 +1,5 @@
|
|||
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_GPU "Compile demo with GPU/CPU, default use CPU." OFF)
|
||||
|
@ -206,13 +207,12 @@ endif()
|
|||
|
||||
set(DEPS ${DEPS} ${OpenCV_LIBS})
|
||||
|
||||
include(ExternalProject)
|
||||
include(FetchContent)
|
||||
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)
|
||||
add_executable(${DEMO_NAME} ${SRCS})
|
||||
|
||||
target_link_libraries(${DEMO_NAME} ${DEPS})
|
||||
|
||||
if (WIN32 AND WITH_MKL)
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
find_package(Git REQUIRED)
|
||||
message("${CMAKE_BUILD_TYPE}")
|
||||
include(FetchContent)
|
||||
|
||||
set(AUTOLOG_REPOSITORY https://github.com/LDOUBLEV/AutoLog.git)
|
||||
SET(AUTOLOG_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/install/Autolog)
|
||||
set(FETCHCONTENT_BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}/third-party")
|
||||
|
||||
ExternalProject_Add(
|
||||
extern_Autolog
|
||||
PREFIX autolog
|
||||
GIT_REPOSITORY ${AUTOLOG_REPOSITORY}
|
||||
GIT_TAG main
|
||||
DOWNLOAD_NO_EXTRACT True
|
||||
INSTALL_COMMAND cmake -E echo "Skipping install step."
|
||||
FetchContent_Declare(
|
||||
extern_Autolog
|
||||
PREFIX autolog
|
||||
GIT_REPOSITORY https://github.com/LDOUBLEV/AutoLog.git
|
||||
GIT_TAG main
|
||||
)
|
||||
FetchContent_MakeAvailable(extern_Autolog)
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <sys/stat.h>
|
||||
|
||||
#include <gflags/gflags.h>
|
||||
#include "auto_log/autolog.h"
|
||||
|
||||
DEFINE_bool(use_gpu, false, "Infering with GPU or CPU.");
|
||||
DEFINE_int32(gpu_id, 0, "Device id of GPU to execute.");
|
||||
|
|
Loading…
Reference in New Issue