Created
January 14, 2023 15:50
-
-
Save sidewinder040/b493d749f9c94dff5c08749aecd5c63d to your computer and use it in GitHub Desktop.
An Example of Using VCPKG with CMake
This file contains hidden or 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.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