CSFML
CSFML copied to clipboard
Add instructions to link CSFML via CMAKE
Hello ! I tried to link CSFML to my C project via CMAKE but I wasn't able to get it to work ! I searched for instructions on the internet but I didn't find anything really helpful.
Please include new installation instructions please. Since SFML upgraded their CMAKE scripts it can no longer compile. You still reference findSFML.cmake which has been removed since 2018
I’m trying to link to CSFML via CMake FetchContent module. However, it cannot find the SFML or CSFMLConfig.cmake, even with SFML_DIR set (I’m also including SFML with FetchContent and setting SFML_DIR to sfml_SOURCE_DIR).
Please could you advise on how to link to CSFML without having to install the library?
I'm not sure this is possible without modifying the CSFML CMakeLists.txt
The reason being that CSFML will use find_package() to locate SFML and that doesn't really work in combination with your FetchContent call.
One change one could consider adding to CSFML is a check of whether the SFML CMake targets already exist, before (unnecessarily) calling find_package.
Why is it that no one will fix this issue or explain how to get CMAKE to work? There have been request after request. If it's broken, why is it even in there then? Or, if it has been solved, where, how, explain????
Check Raylib, SFML might not be your thing when using C https://github.com/raysan5/raylib
I'm using (trying to use) it from Delphi (must use CSFML). I'm just trying to get everything compiled. Why does it have to be so difficult? I can build SFML easy enough, but I read where the CMAKE script has changed which prevents CMAKE from working with CSFML. So how does one create a visual studio solution, then can compile CSFML?
- CMake provides in its errors all the necessary information on how to link SFML
- The readme has been updated to include the necessary instructions
- You link SFML like you would for any other application
- The whole CMake config +
find_package()isn't something exclusive to SFML or CSFML, it's a common CMake operation
I'll close this for now. If you have any additional ideas for improvement, let me know.