aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/vcpkg_acquire_depot_tools.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/cmake/vcpkg_acquire_depot_tools.cmake b/scripts/cmake/vcpkg_acquire_depot_tools.cmake
new file mode 100644
index 000000000..3b206e271
--- /dev/null
+++ b/scripts/cmake/vcpkg_acquire_depot_tools.cmake
@@ -0,0 +1,20 @@
+function(vcpkg_acquire_depot_tools PATH_TO_ROOT_OUT)
+ set(TOOLPATH ${DOWNLOADS}/tools/depot_tools)
+ set(URL "https://storage.googleapis.com/chrome-infra/depot_tools.zip")
+ set(ARCHIVE "depot_tools.zip")
+ set(STAMP "initialized-depot-tools.stamp")
+
+ if(NOT EXISTS "${TOOLPATH}/${STAMP}")
+ message(STATUS "Acquiring Depot Tools...")
+ file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE})
+ file(REMOVE_RECURSE ${TOOLPATH})
+ file(MAKE_DIRECTORY ${TOOLPATH})
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE}
+ WORKING_DIRECTORY ${TOOLPATH}
+ )
+ file(WRITE "${TOOLPATH}/${STAMP}" "0")
+ message(STATUS "Acquiring Depot Tools... OK")
+ endif()
+ set(${PATH_TO_ROOT_OUT} ${TOOLPATH} PARENT_SCOPE)
+endfunction()