As per the title, CMake
is unable to find SFML
which I installed using Microsoft's vcpkg
tool through CMake
s find_package()
macro.
I have verified that SFML
has been installed in the vcpkg
installed directory (~\vcpkg\installed\x86-windows
).
In addition, I have also included the toolchain file from vcpkg
in the CMakeSettings.json
file.
The specific error is:
CMake Error at ~\CMakeLists.txt:40 (find_package):
Could not find a package configuration file provided by "SFML" (requested
version 2.4.2) with any of the following names:
SFMLConfig.cmake
sfml-config.cmake
CMakeSettings.json
(simplified - only debug configuration):
"name": "x86-Debug",
"generator": "Visual Studio 15 2017",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\build\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-m -v:minimal",
"variables": [
{
"name": "CMAKE_TOOLCHAIN_FILE",
"value": "C:\\Microsoft\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"
}
]
CMakeLists.txt
(also simplified):
cmake_minimum_required(VERSION 3.6)
project(Tempus)
add_subdirectory(src)
# Fails at this step
find_package(SFML 2.4.2 REQUIRED system window graphics)
include_directories(${SFML_INCLUDE_DIR})
add_executable(Tempus ${SRC})
target_link_libraries(Tempus ${SFML_LIBRARIES})
I don't think I missed anything. SFML
provides a findSFML.cmake
which vcpkg
should handle itself through the toolchain file (assuming I have understood their documentation correctly). I must be missing something?