Skip to content

Commit e18ae4e

Browse files
dschogitster
authored andcommitted
cmake: ensure that the vcpkg packages are found on Windows
On Windows, we use the `vcpkg` project to manage the dependencies, via `compat/vcbuild/`. Let's make sure that these dependencies are found by default. This is needed because we are about to recommend loading the Git worktree as a folder into Visual Studio, relying on the automatic CMake support (which would make it relatively cumbersome to adjust the search path used by CMake manually). Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 72b6eeb commit e18ae4e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

contrib/buildsystems/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ cmake_minimum_required(VERSION 3.14)
4040

4141
#set the source directory to root of git
4242
set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
43+
if(WIN32)
44+
set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg")
45+
list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/x64-windows")
46+
47+
# In the vcpkg edition, we need this to be able to link to libcurl
48+
set(CURL_NO_CURL_CMAKE ON)
49+
endif()
4350

4451
find_program(SH_EXE sh PATHS "C:/Program Files/Git/bin")
4552
if(NOT SH_EXE)

0 commit comments

Comments
 (0)