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

Author Topic: SFML 2.5 MSYS2 new CMake cannot find target Vorbis (but vorbis is installed!)  (Read 2355 times)

0 Members and 1 Guest are viewing this topic.

Raincode

  • Full Member
  • ***
  • Posts: 118
    • View Profile
Hi,

this is my CMakeLists.txt:

Code: [Select]
add_executable(foo
  main.cpp
)

set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML 2.5 COMPONENTS graphics audio REQUIRED)

target_link_libraries(foo sfml-graphics sfml-audio)

However, I get the following errors (it shows the same error like ten times):
Code: [Select]
-- Found SFML 2.5.1 in X:/msys64/mingw64/lib/cmake/SFML
-- Configuring incomplete, errors occurred!
See also "X:/msys64/home/Programming/cpp/Simulation/build/CMakeFiles/CMakeOutput.log".
CMake Error at X:/msys64/mingw64/lib/cmake/SFML/SFMLConfigDependencies.cmake:38 (set_property):
  set_property could not find TARGET Vorbis.  Perhaps it has not yet been
  created.
Call Stack (most recent call first):
  X:/msys64/mingw64/lib/cmake/SFML/SFMLConfigDependencies.cmake:74 (sfml_bind_dependency)
  X:/msys64/mingw64/lib/cmake/SFML/SFMLConfig.cmake:117 (include)
  src/CMakeLists.txt:6 (find_package)

vorbis is installed in MSYS2 and I can link it as well (libvorbis.a). The package is:
mingw64/mingw-w64-x86_64-libvorbis

I built SFML like so:

Code: [Select]
cmake .. -G"MSYS Makefiles" -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=FALSE -DSFML_USE_STATIC_STD_LIBS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=/mingw64/
make -j
make install

And my project like so:
Code: [Select]
mkdir -p build
cd build
cmake .. -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release
make -j

If I edit SFMLConfigDependencies.cmake and remove everything searching for "Vorbis", and manually link the libraries, it works:

Code: [Select]
target_link_libraries(SkyDrive sfml-graphics sfml-audio vorbis vorbisenc vorbisfile ogg)

So I'm just going to assume there is a problem with the CMake config, since CMake can find the required dependencies without problems if I specify them manually (vorbis, vorbisenc, vorbisfile, ogg). Am I missing something?

Thank you!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
You'd have to take this up with the maintainer of the MSYS2 SFML package (assuming you didn't build it from source), as they'd have to make sure that the generated config files finds their vorbis version, etc.

Officially we don't support the MSYS2 environment. Personally, I've only ever used it with my non-MSYS2 MinGW compiler and non MSYS2 libraries, to use the full automake & configure build setup.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Raincode

  • Full Member
  • ***
  • Posts: 118
    • View Profile
I built SFML like so:

Code: [Select]
cmake .. -G"MSYS Makefiles" -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=FALSE -DSFML_USE_STATIC_STD_LIBS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=/mingw64/
make -j
make install

I'm using the official cmake files from /lib/cmake/SFML/. which are from the Github repo.

 

anything