diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-12-07 12:22:15 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-12-07 12:22:15 +0200 |
commit | 92b3c2dcff3e85ad3d455f6ab845d9a97d3b525b (patch) | |
tree | a850643f7b86e6cebfddbeec98d7c372478d379c /cmake/ThirdParty.cmake | |
parent | Hostlist filter plugin can rewrite hostnames (diff) | |
download | smolbote-92b3c2dcff3e85ad3d455f6ab845d9a97d3b525b.tar.xz |
Rewrite meson build scripts into cmakelists
Diffstat (limited to 'cmake/ThirdParty.cmake')
-rw-r--r-- | cmake/ThirdParty.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/ThirdParty.cmake b/cmake/ThirdParty.cmake new file mode 100644 index 0000000..8e5b1cc --- /dev/null +++ b/cmake/ThirdParty.cmake @@ -0,0 +1,17 @@ +function(download_third_party path url archive hash_type hash) + + if(NOT EXISTS ${CMAKE_SOURCE_DIR}/third-party/${path}) + + if(NOT EXISTS ${CMAKE_BINARY_DIR}/${archive}) + message("${CMAKE_BINARY_DIR}/${archive} missing") + message("Downloading ${url}...") + file(DOWNLOAD ${url} ${CMAKE_BINARY_DIR}/${archive} + TIMEOUT 60 TLS_VERIFY ON + EXPECTED_HASH ${hash_type}=${hash}) + endif() + + file(ARCHIVE_EXTRACT INPUT ${CMAKE_BINARY_DIR}/${archive} + DESTINATION ${CMAKE_SOURCE_DIR}/third-party) + endif() + +endfunction() |