I already asked in Stack Overflow, but there nobody can help me yet.
https://stackoverflow.com/questions/59555700/setsfml-static-libraries-true-doesnt-work-in-cmake-with-sfml-2-5-1-on-debianI installed SFML with the command "apt install libsfml-dev".
I can link it in cmake discribed like in this post
https://en.sfml-dev.org/forums/index.php?topic=24070.0 and everything works pretty fine.
But if I add set(SFML_STATIC_LIBRARIES TRUE) to my cmake file to link sfml static I get the following error:
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/SFML/SFMLConfig.cmake:139 (message):
Requested SFML configuration (Static) was not found
Call Stack (most recent call first):
CMakeLists.txt:30 (find_package)
CMake Error at CMakeLists.txt:30 (find_package):
Found package configuration file:
/usr/lib/x86_64-linux-gnu/cmake/SFML/SFMLConfig.cmake
but it set SFML_FOUND to FALSE so package "SFML" is considered to be NOT
FOUND.
I recognized that the SFMLConfig.cmake (
https://github.com/SFML/SFML/blob/master/cmake/SFMLConfig.cmake.in) file wants to access a SFMLStaticTargets.cmake file in line 110, if I set(SFML_STATIC_LIBRARIES TRUE).
But my /usr/lib/x86_64-linux-gnu/cmake/SFML folder just contains the following files for Shared linking:
SFMLConfig.cmake
SFMLConfigDependencies.cmake
SFMLConfigVersion.cmake
SFMLSharedTargets.cmake
SFMLSharedTargets-none.cmake
In sfml version I can download here "
https://www.sfml-dev.org/download/sfml/2.5.1/" I can also just find these files in the lib/cmake/SFML folder, but a SFMLSharedTargets-release.cmake file instead of SFMLSharedTargets-none.cmake.
What can I do to static link sfml 2.5.1 in cmake on my system?