SFML community forums

Help => General => Topic started by: Grundkurs on January 23, 2022, 08:49:23 am

Title: CMake: Could not find a configuration file for package "SFML" that is compatible
Post by: Grundkurs on January 23, 2022, 08:49:23 am
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:
Quote
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:
I use this basic CMakeLists.txt-file to build the project:
Quote
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/1593
OP 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.zip
the 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. 
Title: Re: CMake: Could not find a configuration file for package "SFML" that is compatible
Post by: eXpl0it3r on January 23, 2022, 07:14:53 pm
Welcome to a new age! :D

The SFML master branch is currently undergoing massive changes towards SFML 3 (yes, as in new major version 3). If you're not exactly interested in a bumpy rid of potentially breaking and changing things, you may want to check out the 2.6.x branch instead, which eventually will become the SFML 2.6 release. :)
Title: Re: CMake: Could not find a configuration file for package "SFML" that is compatible
Post by: metal_in_my_veins on January 24, 2022, 09:27:56 am
Can we expect android/ios support in SFML 3? About when is it gonna come out?