Skip to content

Instantly share code, notes, and snippets.

@Harold2017
Last active June 16, 2020 08:28
Show Gist options
  • Save Harold2017/9494ca24a597d04f95e477556fae60ba to your computer and use it in GitHub Desktop.
Save Harold2017/9494ca24a597d04f95e477556fae60ba to your computer and use it in GitHub Desktop.
vcpkg on mac
# install vcpkg
git clone https://github.com/Microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh -disableMetrics
sudo ln -s /xxx/vcpkg/vcpkg /usr/local/bin
vcpkg help

# use it in CMakeLists.txt
set(ENV{VCPKG_ROOT} "/xxx/vcpkg/vcpkg")
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
  set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
  message("[INFO] VCPKG CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}")
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment