Created
January 16, 2024 10:40
-
-
Save jollyjonson/6d9b63f1603ebb501a72898ee845651e to your computer and use it in GitHub Desktop.
Use CMake to automatically set up vcpkg as package manager using vcpkg-cmake-integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.22 FATAL_ERROR) | |
# pull vcpkg-cmake-integration from github and let it set up vcpkg | |
include(FetchContent) | |
FetchContent_Declare( | |
vcpkg_cmake_integration | |
GIT_REPOSITORY https://github.com/bitmeal/vcpkg-cmake-integration.git | |
GIT_TAG origin/master # either manually specify a tag here (e.g. v0.2.2) or use latest master | |
) | |
FetchContent_MakeAvailable(vcpkg_cmake_integration) | |
include(${vcpkg_cmake_integration_SOURCE_DIR}/vcpkg.cmake) | |
# the project needs to be defined afterwards | |
project(MyProjectName) | |
# rest of the CMake goes here... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment