summaryrefslogtreecommitdiff
path: root/infra/cmake/packages/Pybind11SourceConfig.cmake
blob: 2f6425355d0c037f5fa9511064e740508eee624e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function(_Pybind11Source_import)
  if(NOT DOWNLOAD_PYBIND11)
    set(Pybind11Source_FOUND FALSE PARENT_SCOPE)
    return()
  endif(NOT DOWNLOAD_PYBIND11)

  nnas_include(ExternalSourceTools)
  nnas_include(OptionTools)

  envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com")
  envoption(PYBIND11_URL ${EXTERNAL_DOWNLOAD_SERVER}/pybind/pybind11/archive/v2.5.0.tar.gz)

  ExternalSource_Download(PYBIND11 ${PYBIND11_URL})

  set(Pybind11Source_DIR ${PYBIND11_SOURCE_DIR} PARENT_SCOPE)
  set(Pybind11Source_FOUND TRUE PARENT_SCOPE)
endfunction(_Pybind11Source_import)

_Pybind11Source_import()