@@ -682,25 +682,27 @@ if (USE_NCNN)
682682 message (STATUS "Configuring NCNN" )
683683 add_definitions (-DUSE_NCNN)
684684 include_directories (${CMAKE_CURRENT_BINARY_DIR} )
685+
685686 set (NCNN_PATCHES_PATH ${CMAKE_BINARY_DIR} /patches/ncnn)
686687 set (NCNN_PATCHES
687688 ${NCNN_PATCHES_PATH} /ncnn_inner_keep_h.patch
688689 ${NCNN_PATCHES_PATH} /ncnn_lstm_cont.patch
689690 ${NCNN_PATCHES_PATH} /ncnn_variable_h.patch
690691 ${NCNN_PATCHES_PATH} /ncnn_flatten_axis.patch
691- )
692+ )
692693
693694 set (NCNN_VERSION "20201218" )
694- set (NCNN_COMPLETE ${CMAKE_BINARY_DIR} /CMakeFiles/ncnn-complete )
695+ set (NCNN_TARBALL_HASH "1dac4571168b83ee99efaba969c01e8054cd8e3d9b67ca4893f32b767ab4ec48" )
695696
696- set (NCNN_LIB_DEPS ${CMAKE_BINARY_DIR} /ncnn/src/ncnn-build /src/libncnn.a)
697697 if (RPI3)
698698 ExternalProject_Add(
699699 ncnn
700700 PREFIX ncnn
701701 GIT_REPOSITORY https://github.com/tencent/ncnn.git
702702 GIT_TAG ${NCNN_VERSION}
703- PATCH_COMMAND git apply ${NCNN_PATCHES} && echo Applying ${NCNN_PATCHES}
703+ URL https://github.com/Tencent/ncnn/releases/download/${NCNN_VERSION} /ncnn-${NCNN_VERSION} -full-source .zip
704+ URL_HASH SHA256=${NCNN_TARBALL_HASH}
705+ PATCH_COMMAND ${CMAKE_SOURCE_DIR} /cmake/patches-apply.sh ${NCNN_PATCHES}
704706 CMAKE_ARGS -DPI3=ON -DCMAKE_TOOLCHAIN_FILE=../toolchains/pi3.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DProtobuf_INCLUDE_DIR=${CMAKE_BINARY_DIR} /protobuf/src/protobuf/src -DProtobuf_LIBRARIES=${PROTOBUF_LIB_DIR} /libprotobuf.so -DProtobuf_PROTOC_EXECUTABLE=${PROTOBUF_LIB_DIR} /protoc -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_TESTS=OFF
705707 INSTALL_COMMAND ""
706708 DEPENDS protobuf
@@ -709,14 +711,16 @@ if (USE_NCNN)
709711 ExternalProject_Add(
710712 ncnn
711713 PREFIX ncnn
712- PATCH_COMMAND test -f ${NCNN_COMPLETE} || git apply ${NCNN_PATCHES}
713- GIT_TAG ${NCNN_VERSION }
714- GIT_REPOSITORY https://github.com/tencent/ncnn.git
714+ URL https://github.com/Tencent/ncnn/releases/download/ ${NCNN_VERSION} /ncnn- ${NCNN_VERSION} -full- source .zip
715+ URL_HASH SHA256= ${NCNN_TARBALL_HASH }
716+ PATCH_COMMAND ${CMAKE_SOURCE_DIR} /cmake/patches-apply.sh ${NCNN_PATCHES}
715717 CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DProtobuf_INCLUDE_DIR=${CMAKE_BINARY_DIR} /protobuf/src/protobuf/src -DProtobuf_LIBRARIES=${PROTOBUF_LIB_DIR} /libprotobuf.so -DProtobuf_PROTOC_EXECUTABLE=${PROTOBUF_LIB_DIR} /protoc -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_BENCHMARK=OFF -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_TESTS=OFF
716718 INSTALL_COMMAND ""
717719 DEPENDS protobuf
718720 )
719721 endif ()
722+
723+ set (NCNN_LIB_DEPS ${CMAKE_BINARY_DIR} /ncnn/src/ncnn-build /src/libncnn.a)
720724 set (NCNN_INC_DIR ${CMAKE_BINARY_DIR} /ncnn/src/ncnn/src ${CMAKE_BINARY_DIR} /ncnn/src/ncnn-build /src)
721725 set (NCNN_LIB_DIR ${CMAKE_BINARY_DIR} /ncnn/src/ncnn-build /src)
722726 include_directories (${NCNN_INC_DIR} )
0 commit comments