Skip to content

Instantly share code, notes, and snippets.

@sidewinder040
Created January 14, 2023 15:50
Show Gist options
  • Save sidewinder040/b493d749f9c94dff5c08749aecd5c63d to your computer and use it in GitHub Desktop.
Save sidewinder040/b493d749f9c94dff5c08749aecd5c63d to your computer and use it in GitHub Desktop.
An Example of Using VCPKG with CMake
cmake_minimum_required(VERSION 3.20.0)
# change this to your path
set(CMAKE_TOOLCHAIN_FILE "E:/src/vcpkg/scripts/buildsystems/vcpkg.cmake")
project(demo)
add_executable(${PROJECT_NAME} main.cpp)
# use your prefix paht if the toolchain doesn't work
# set(CMAKE_PREFIX_PATH "E:/src/vcpkg/installed/x64-windows/share")
find_package(fmt CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE fmt::fmt)
# https://github.com/codetechandtutorials/cmake_ep11/blob/main/CMakeLists.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment