SFML community forums
Help => General => Topic started by: Nexus on April 27, 2012, 07:14:24 pm
-
Hi,
I have experienced that many users have problems to setup Thor correctly because the SFML path is not found. The recent modification to not copy FindSFML.cmake in the CMake module folder anymore makes matters even worse – not only because new users don't find SFML at all, but also because existing users are left with an incorrect FindSFML.cmake (defining SFMLDIR instead of SFML_ROOT for example).
What advice would you, Laurent, give for libraries depending on SFML? Should I copy FindSFML.cmake in my repository and expand CMAKE_MODULE_PATH correspondingly? Actually, that would be an easy solution, but I fear that I overlook updates in this file (but you mentioned they shouldn't happen too often).
Furthermore, to copy FindSFML.cmake to SFML_ROOT during the installation seems somehow questionable, because at this point one has already found SFML ;) But I see you can define the other variables like SFML_LIBRARIES etc.
By the way, you should probably mention those short steps to find SFML in another tutorial, like "Using SFML in other libraries with CMake"... One day, if you have time :)
-
Should I copy FindSFML.cmake in my repository and expand CMAKE_MODULE_PATH correspondingly?
Yes, definitely.
I fear that I overlook updates in this file (but you mentioned they shouldn't happen too often).
If your current version of FindSFML.cmake is able to find the required version of SFML, it should always work on any system with any version of SFML. If a future modification to FindSFML.cmake (or to the layout/name of SFML files) breaks this, I'll be in big troubles :)
-
Okay, thank you! :)
-
Btw, depending on your version control system, I'd go with a submodule. You can then easily use the newest FindSFML.cmake – if you update your submodule, that is. ;)
E.g. if SFML is in ext/SFML/, you'd append ext/SFML/cmake/Modules/ to CMAKE_MODULE_PATH.
-
I use git-subtree (https://github.com/apenwarr/git-subtree), but not for SFML. People that use Thor already have SFML. Thus, I currently just copy the FindSFML file ;)
-
Sure, I just wanted to give a hint on how to easily work-around that problem. :)
-
Lovely, I just got the old setup for SFML working and now have to learn the new one. :(
-
And everything for free. You're lucky!