Skip to content

Commit b52b676

Browse files
committed
vcpkg: Automatically unshallow submodule
1 parent 2129644 commit b52b676

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@ if (EXPERIMENTAL_VERSION)
1616
endif()
1717

1818
if (ENABLE_VCPKG)
19+
# check if vcpkg is shallow and unshallow it if necessary
20+
execute_process(
21+
COMMAND git rev-parse --is-shallow-repository
22+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/dependencies/vcpkg
23+
OUTPUT_VARIABLE is_vcpkg_shallow
24+
OUTPUT_STRIP_TRAILING_WHITESPACE
25+
)
26+
27+
if(is_vcpkg_shallow STREQUAL "true")
28+
message(STATUS "vcpkg is shallow. Unshallowing it now...")
29+
execute_process(
30+
COMMAND git fetch --unshallow
31+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/dependencies/vcpkg"
32+
RESULT_VARIABLE result
33+
OUTPUT_VARIABLE output
34+
)
35+
endif()
36+
1937
if(UNIX AND NOT APPLE)
2038
set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_LIST_DIR}/dependencies/vcpkg_overlay_ports_linux")
2139
elseif(APPLE)

0 commit comments

Comments
 (0)