Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: CMake: Could not find a configuration file for package "SFML" that is compatible  (Read 2715 times)

0 Members and 1 Guest are viewing this topic.

Grundkurs

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
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:
  • 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:
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. 
« Last Edit: January 23, 2022, 10:25:31 am by Grundkurs »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
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. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

metal_in_my_veins

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Can we expect android/ios support in SFML 3? About when is it gonna come out?