From 49faf9847a50d71104fd9d4972b3db15aefdd84c Mon Sep 17 00:00:00 2001 From: scorpioluck20 Date: Mon, 22 May 2023 01:44:36 +0700 Subject: [PATCH] Add FileLoader library to thirdparty project - Add FileLoader to CMake build --- .gitmodules | 4 ++++ FileLoader | 1 + build/CommonTargets.CMake | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 160000 FileLoader diff --git a/.gitmodules b/.gitmodules index a8f0d753..19430fed 100644 --- a/.gitmodules +++ b/.gitmodules @@ -152,3 +152,7 @@ [submodule "zlib"] path = zlib url = https://github.com/madler/zlib.git +[submodule "FileLoader"] + path = FileLoader + url = ../FileLoader.git + diff --git a/FileLoader b/FileLoader new file mode 160000 index 00000000..e0647d4d --- /dev/null +++ b/FileLoader @@ -0,0 +1 @@ +Subproject commit e0647d4dffcb9606f17bbadc2ccaf7abe51dd2ac diff --git a/build/CommonTargets.CMake b/build/CommonTargets.CMake index eaa31ce4..f722aa2f 100644 --- a/build/CommonTargets.CMake +++ b/build/CommonTargets.CMake @@ -342,6 +342,25 @@ set(_FINDPACKAGE_MNN_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/MNN/lib") set(_FINDPACKAGE_MNN_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/MNN/include") include_directories(${_FINDPACKAGE_MNN_INCLUDE_DIR}) +# -------------------------------------------------------- +# Build FileLoader +ExternalProject_Add(FileLoader + PREFIX FileLoader + SOURCE_DIR "${THIRDPARTY_DIR}/FileLoader" + CMAKE_CACHE_ARGS + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/FileLoader + -DBUILD_FILELOADER_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/FileLoader + -DMNN_INCLUDE_DIR:PATH=${_FINDPACKAGE_MNN_INCLUDE_DIR} + -DMNN_LIBRARY_DIR:PATH=${_FINDPACKAGE_MNN_LIBRARY_DIR} + -DTESTING:BOOL=OFF + ${_CMAKE_COMMON_BUILD_PARAMS} + DEPENDS MNN +) + +set(_FINDPACKAGE_FILELOADER_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/FileLoader/lib/cmake/mnn") +set(_FINDPACKAGE_FILELOADER_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/FileLoader/lib") +set(_FINDPACKAGE_FILELOADER_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/FileLoader/include") + # -------------------------------------------------------- # builds ipfs-lite-cpp ExternalProject_Add(ipfs-lite-cpp