From 52c920fc6de46f8c378afb971bc0a322ec64d699 Mon Sep 17 00:00:00 2001 From: lipeihan01 Date: Mon, 23 Aug 2021 16:25:22 +0800 Subject: [PATCH] support download auto_log.h from third-party url --- deploy/cpp_infer/CMakeLists.txt | 4 ++++ deploy/cpp_infer/external-cmake/auto-log.cmake | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 deploy/cpp_infer/external-cmake/auto-log.cmake diff --git a/deploy/cpp_infer/CMakeLists.txt b/deploy/cpp_infer/CMakeLists.txt index efb183c5..29a50684 100644 --- a/deploy/cpp_infer/CMakeLists.txt +++ b/deploy/cpp_infer/CMakeLists.txt @@ -206,6 +206,10 @@ endif() set(DEPS ${DEPS} ${OpenCV_LIBS}) +include(ExternalProject) +include(external-cmake/auto-log.cmake) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/autolog/src/extern_Autolog/auto_log) + AUX_SOURCE_DIRECTORY(./src SRCS) add_executable(${DEMO_NAME} ${SRCS}) diff --git a/deploy/cpp_infer/external-cmake/auto-log.cmake b/deploy/cpp_infer/external-cmake/auto-log.cmake new file mode 100644 index 00000000..5f5142de --- /dev/null +++ b/deploy/cpp_infer/external-cmake/auto-log.cmake @@ -0,0 +1,14 @@ +find_package(Git REQUIRED) +message("${CMAKE_BUILD_TYPE}") + +set(AUTOLOG_REPOSITORY https://github.com/LDOUBLEV/AutoLog.git) +SET(AUTOLOG_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/install/Autolog) + +ExternalProject_Add( + extern_Autolog + PREFIX autolog + GIT_REPOSITORY ${AUTOLOG_REPOSITORY} + GIT_TAG support_cpp_log + DOWNLOAD_NO_EXTRACT True + INSTALL_COMMAND cmake -E echo "Skipping install step." +) -- GitLab