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!