From 92b3c2dcff3e85ad3d455f6ab845d9a97d3b525b Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Mon, 7 Dec 2020 12:22:15 +0200 Subject: Rewrite meson build scripts into cmakelists --- cmake/ThirdParty.cmake | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 cmake/ThirdParty.cmake (limited to 'cmake/ThirdParty.cmake') 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() -- cgit v1.2.1