Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
c8f6a2d0
Commit
c8f6a2d0
authored
Aug 31, 2021
by
MissPenguin
Browse files
fix cpp autolog
parent
6382612f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
deploy/cpp_infer/CMakeLists.txt
deploy/cpp_infer/CMakeLists.txt
+3
-3
deploy/cpp_infer/external-cmake/auto-log.cmake
deploy/cpp_infer/external-cmake/auto-log.cmake
+9
-10
deploy/cpp_infer/src/main.cpp
deploy/cpp_infer/src/main.cpp
+1
-0
No files found.
deploy/cpp_infer/CMakeLists.txt
View file @
c8f6a2d0
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
(
ExternalProjec
t
)
include
(
FetchConten
t
)
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
)
...
...
deploy/cpp_infer/external-cmake/auto-log.cmake
View file @
c8f6a2d0
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
)
deploy/cpp_infer/src/main.cpp
View file @
c8f6a2d0
...
@@ -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."
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment