CMake couldn't find SFML

Started by TheMole, 29 January 2022, 14:37:49

TheMole

When I try to build I get this error

Severity Code Description Project File Line Suppression State
Error CMake Error at cmake/Dependencies.cmake:93 (message):
  CMake couldn't find SFML.

  Set SFML_DIR to the directory containing SFMLConfig.cmake (usually
  something like SFML_ROOT/lib/cmake/SFML)

  C:/Users/user/TGUI-CUSTOM/SFML-2.5.0/lib/cmake/SFML C:\Users\user\TGUI-CUSTOM\TGUI-0.10\cmake/Dependencies.cmake 93

and this warning

Severity Code Description Project File Line Suppression State
Warning CMake Warning at cmake/Dependencies.cmake:74 (find_package):
  Could not find a configuration file for package "SFML" that is compatible
  with requested version "2".

  The following configuration files were considered but not accepted:

    C:/Users/user/TGUI-CUSTOM/SFML-2.5.0/lib/cmake/SFML/SFMLConfig.cmake, version: 2.5.0 (32bit) C:\Users\user\TGUI-CUSTOM\TGUI-0.10\cmake/Dependencies.cmake 74


SFMLConfig.cmake is located in C:/Users/user/TGUI-CUSTOM/SFML-2.5.0/lib/cmake/SFML/

I'm all out of ideas...

texus

Can you show the full cmake output? For 0.10 I would expect there to be 2 warnings about not finding SFML (because it tries to find both SFML 3 and SFML 2).

There are 3 reasons that I can think of where cmake might find SFML but chooses not to accept it:
- There is a version mismatch. For example: TGUI 0.9 will fail to load the in-development SFML 3 version, it only accepts SFML 2
- Some dependency is missing. For example: somewhere in the output it might say that the SFML libraries were found but it couldn't find FreeType
- Incompatible libraries for the compiler. For example: building the project in 64-bit but finding 32-bit SFML libs, or mixing MinGW and Visual Studio libraries