Build error

Started by Kvaz1r, 27 August 2023, 12:25:12

Kvaz1r

Trying to build lib, but getting CMake errors:

CMake Warning at cmake/Dependencies.cmake:54 (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:

    T:/libraries/C++/SFML/build/SFMLConfig.cmake, version: 3.0.0

Call Stack (most recent call first):
  cmake/Dependencies.cmake:86 (tgui_find_dependency_sfml)
  src/Backend/CMakeLists.txt:153 (tgui_add_dependency_sfml)
  src/CMakeLists.txt:300 (include)


Requested SFML configuration (Static) was not found
CMake Warning at cmake/Dependencies.cmake:57 (find_package):
  Found package configuration file:

    T:/libraries/C++/SFML/build/SFMLConfig.cmake

  but it set SFML_FOUND to FALSE so package "SFML" is considered to be NOT
  FOUND.
Call Stack (most recent call first):
  cmake/Dependencies.cmake:86 (tgui_find_dependency_sfml)
  src/Backend/CMakeLists.txt:153 (tgui_add_dependency_sfml)
  src/CMakeLists.txt:300 (include)


CMake Error at cmake/Dependencies.cmake:73 (message):
  CMake couldn't find SFML.

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

Call Stack (most recent call first):
  cmake/Dependencies.cmake:86 (tgui_find_dependency_sfml)
  src/Backend/CMakeLists.txt:153 (tgui_add_dependency_sfml)
  src/CMakeLists.txt:300 (include)
TGUI and SFML - current master branch. I didn't request "2" version anywhere.


P.S. CMake seems to me like a real disaster  :D

texus

TGUI tries to search for both SFML 2 and SFML 3 as it won't know which you have installed. If it fails to find either, then it will display an error message about both of them.

When looking for SFML 2, if fails because it finds SFML 3.0.0
When looking for SFML 3, it fails with "Requested SFML configuration (Static) was not found"

Did you perhaps build shared SFML libraries and are trying to build static TGUI libraries? If you are trying to use a different shared/static config for SFML and TGUI then you need to define SFML_STATIC_LIBRARIES to either TRUE or FALSE to select how to link SFML.

Kvaz1r

Quote from: texus on 27 August 2023, 12:29:30Did you perhaps build shared SFML libraries and are trying to build static TGUI libraries? If you are trying to use a different shared/static config for SFML and TGUI then you need to define SFML_STATIC_LIBRARIES to either TRUE or FALSE to select how to link SFML.
No I always use static config (checked it several times). And in case with shared/static mismatch I'd get error on compile time, not CMake.

I'll try use SFML 2.6 maybe with this version all goes smoothly.

Kvaz1r

Was able to build with SFML 2.6, don't know what the difference, anyway for now it's good enough to me.