I have installed vcpkg according to the instructions provided here. I installed the libraries I wanted (in this case fmt and boost), then created a simple new project in KDevelop which runs just fine. Then to add my libraries to the project I added -DCMAKE_TOOLCHAIN_FILE=/VCPKG_LOCATION/vcpkg/scripts/buildsystems/vcpkg.cmake
in the "Configure CMake settings", where there is an "Extra arguments field", of KDevelop (Right click on Project folder and then "Open Configuration...").
Then I simply added the following to my CMakeLists.txt:
find_package(fmt REQUIRED)
and I get the following error:
By not providing "Findfmt.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "fmt", but CMake did not find one.
Could not find a package configuration file provided by "fmt" with any of the following names:
fmtConfig.cmake fmt-config.cmake
Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR" to a directory containing one of the above files. If "fmt" provides a separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!
It seems that KDevelop is not recognizing the toolchain file (even though I can clearly see in the build log that that CMake is being called with the "-DCMAKE_TOOLCHAIN_FILE" as required). I have tried to setup the project similarly in Qt Creator which does seem to work perfectly fine.