summaryrefslogtreecommitdiff
path: root/infra/nncc/cmake/packages/PytorchSourceConfig.cmake
blob: c28bc7c00d6c14fb8d0e06a01df993a2974961ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()