Reputation: 3
CMake cannot find FFmpeg even though everything is right setup. I used vcpkg to install ffmpeg I can't find any information to setup ffmpeg with CMake. I'm on Windows 10 with Visual Studio.
Get findFFMPEG and put in ffmpeg folder but doesn't solve the issue. change the folder name to FFMPEG capital letters but still doesn't solve the issue.
I get this error: Severity Code Description Project File Line Suppression State Details Error CMake Error at CMakeProject1/CMakeLists.txt:15 (find_package): By not providing "FindFFMPEG.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "FFMPEG", but CMake did not find one.
Could not find a package configuration file provided by "FFMPEG" with any of the following names:
FFMPEGConfig.cmake
ffmpeg-config.cmake
Add the installation prefix of "FFMPEG" to CMAKE_PREFIX_PATH or set "FFMPEG_DIR" to a directory containing one of the above files. If "FFMPEG" provides a separate development package or SDK, be sure it has been installed. C:\Users\Enriqurfrankie\source\repos\CMakeProject1\CMakeProject1/CMakeLists.txt 15
add_executable (CMakeProject1 "Source/Main.cpp" "Source/SDL2_Init.cpp" "Header/SDL2_Init.h")
target_include_directories(CMakeProject1 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/Header")
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_ttf REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(FFMPEG REQUIRED)
if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET CMakeProject1 PROPERTY CXX_STANDARD 20)
endif()
Upvotes: 0
Views: 399
Reputation: 1
Maybe you should set CMAKE_TOOLCHAIN_FILE, eg:
set(CMAKE_TOOLCHAIN_FILE "${vcpkg_dir}/scripts/buildsystems/vcpkg.cmake")
Replace vcpkg_dir with your local vcpkg installed dir
Upvotes: 0