SFML community forums
Help => General => Topic started by: Raincode on January 17, 2020, 03:32:15 pm
-
Hi,
this is my CMakeLists.txt:
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):
-- 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:
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:
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:
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!
-
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.
-
I built SFML like so:
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.