diff options
Diffstat (limited to 'infra/cmake/packages/Pybind11SourceConfig.cmake')
-rw-r--r-- | infra/cmake/packages/Pybind11SourceConfig.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/infra/cmake/packages/Pybind11SourceConfig.cmake b/infra/cmake/packages/Pybind11SourceConfig.cmake new file mode 100644 index 000000000..76f51e4d3 --- /dev/null +++ b/infra/cmake/packages/Pybind11SourceConfig.cmake @@ -0,0 +1,18 @@ +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(PYBIND11_URL https://github.com/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() |