summaryrefslogtreecommitdiff
path: root/infra/nnfw/cmake/packages/NNPACKSourceConfig.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'infra/nnfw/cmake/packages/NNPACKSourceConfig.cmake')
-rw-r--r--infra/nnfw/cmake/packages/NNPACKSourceConfig.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/infra/nnfw/cmake/packages/NNPACKSourceConfig.cmake b/infra/nnfw/cmake/packages/NNPACKSourceConfig.cmake
new file mode 100644
index 000000000..b6b5b01bd
--- /dev/null
+++ b/infra/nnfw/cmake/packages/NNPACKSourceConfig.cmake
@@ -0,0 +1,20 @@
+function(_NNPACKSource_import)
+ if(NOT DOWNLOAD_NNPACK)
+ set(NNPACKSource_FOUND FALSE PARENT_SCOPE)
+ message(WARN "NNPACK not downloaded")
+ return()
+ endif(NOT DOWNLOAD_NNPACK)
+
+ nnfw_include(ExternalSourceTools)
+ nnfw_include(OptionTools)
+
+ envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com")
+ set(NNPACK_URL ${EXTERNAL_DOWNLOAD_SERVER}/Maratyszcza/NNPACK/archive/c039579abe21f5756e0f0e45e8e767adccc11852.tar.gz)
+ ExternalSource_Get("NNPACK" ${DOWNLOAD_NNPACK} ${NNPACK_URL})
+
+ set(NNPACK_SOURCE_DIR ${NNPACK_SOURCE_DIR} PARENT_SCOPE)
+ set(NNPACK_INCLUDE_DIR ${NNPACK_SOURCE_DIR}/include PARENT_SCOPE)
+ set(NNPACK_SOURCE_FOUND ${NNPACK_SOURCE_GET} PARENT_SCOPE)
+endfunction(_NNPACKSource_import)
+
+_NNPACKSource_import()