diff --git a/.gitmodules b/.gitmodules index a8f0d753..3438110a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -152,3 +152,6 @@ [submodule "zlib"] path = zlib url = https://github.com/madler/zlib.git +[submodule "MNNLoader"] + path = MNNLoader + url = ../MNNLoader.git \ No newline at end of file diff --git a/MNNLoader b/MNNLoader new file mode 160000 index 00000000..03050f70 --- /dev/null +++ b/MNNLoader @@ -0,0 +1 @@ +Subproject commit 03050f701671f6ba484a923aef3b88525314c08c diff --git a/build/CommonTargets.CMake b/build/CommonTargets.CMake index eaa31ce4..6bc9fe06 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 MNNLoader +ExternalProject_Add(MNNLoader + PREFIX MNNLoader + SOURCE_DIR "${THIRDPARTY_DIR}/MNNLoader" + CMAKE_CACHE_ARGS + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/MNNLoader + -DBUILD_MNNLOADER_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/MNNLoader + -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_MNNLOADER_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/MNNLoader/lib/cmake/mnn") +set(_FINDPACKAGE_MNNLOADER_LIBRARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/MNNLoader/lib") +set(_FINDPACKAGE_MNNLOADER_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/MNNLoader/include") + # -------------------------------------------------------- # builds ipfs-lite-cpp ExternalProject_Add(ipfs-lite-cpp