I have a hard time compiling SFML on my machine.
In the past i have done the following procedure like a 1000 times without having any issues, but now i receive the following error:
CMake Error at CMakeLists.txt:5 (find_package):
Could not find a configuration file for package "SFML" that is compatible
with requested version "2.5".
The following configuration files were considered but not accepted:
C:/Program Files (x86)/SFML/lib/cmake/SFML/SFMLConfig.cmake, version: 3.0.0
-- Configuring incomplete, errors occurred!
See also "C:/src/test/build/CMakeFiles/CMakeOutput.log".
I compiled SFML on different Windows Versions (10 and 11) and used different versions of mingw-w64 (from
https://winlibs.com/), but i always get this error. I never had this issue before. The steps i did:
- Get SFML from Github
- Create Makefiles with CMake, using MinGW Makefiles as generator
- run "mingw32-make install" in the CMake-Build-Folder that i need to select in CMake-GUI
I use this basic CMakeLists.txt-file to build the project:
cmake_minimum_required(VERSION 3.1)
project(SFMLTest)
## If you want to link SFML statically
# set(SFML_STATIC_LIBRARIES TRUE)
## In most cases better set in the CMake cache
# set(SFML_DIR "<sfml root prefix>/lib/cmake/SFML")
find_package(SFML 2.5 COMPONENTS graphics audio REQUIRED)
add_executable(SFMLTest main.cpp)
target_link_libraries(SFMLTest sfml-graphics sfml-audio)
Here a similar error-message has been discussed:
https://github.com/SFML/SFML/issues/1593OP stated at one point "You were right. I used the wrong compiler in this project. Thank you!", however i don't think this is the reason in my case why find_package() does not work anymore.
EDIT: When i did the exact same steps described above with the SFML-Source from here:
https://www.sfml-dev.org/files/SFML-2.5.1-sources.zipthe described error does not occure.
I also double-checked this. The error can be reproduced if i use the Github Source-Code. When i use the source from
https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip everything is ok.