diff options
Diffstat (limited to 'infra/nncc/cmake/packages/PytorchSourceConfig.cmake')
-rw-r--r-- | infra/nncc/cmake/packages/PytorchSourceConfig.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/infra/nncc/cmake/packages/PytorchSourceConfig.cmake b/infra/nncc/cmake/packages/PytorchSourceConfig.cmake new file mode 100644 index 000000000..c28bc7c00 --- /dev/null +++ b/infra/nncc/cmake/packages/PytorchSourceConfig.cmake @@ -0,0 +1,18 @@ +function(_PytorchSource_import) + if(NOT DOWNLOAD_PYTORCH) + set(PytorchSource_FOUND FALSE PARENT_SCOPE) + return() + endif(NOT DOWNLOAD_PYTORCH) + + nncc_include(ExternalSourceTools) + nncc_include(OptionTools) + + envoption(PYTORCH_URL https://github.com/pytorch/pytorch/archive/v0.4.1.tar.gz) + + ExternalSource_Download(PYTORCH ${PYTORCH_URL}) + + set(PytorchSource_DIR ${PYTORCH_SOURCE_DIR} PARENT_SCOPE) + set(PytorchSource_FOUND ${DOWNLOAD_PYTORCH} PARENT_SCOPE) +endfunction(_PytorchSource_import) + +_PytorchSource_import() |