SFML community forums
Help => General => Topic started by: sbroadfoot90 on November 18, 2011, 08:43:52 am
-
@Laurent @Hiura,
the FindSFML.cmake doesn't work very well for OS X. It basically sets
SFML_INCLUDE_DIR to /Library/Frameworks/SFML.framework
and
SFML_LIBRARIES isn't set to anything.
I have a feeling SFML_INCLUDE_DIR should be set to /Library/Frameworks/SFML.framework/Headers, and SFML_LIBRARIES definitely shouldn't be blank.
-
Do you have some test files ? I currently don't have a lot of time to test it so it would be very helpful if you could give me a complete test suite. (I mean, a basic CMake project using FindSFML to compile a basic main function to test compile/link against SFML.)
Thanks! :)
-
https://github.com/sbroadfoot90/cmaketest
Also, I'm not sure if I'm doing it right, but setting
set(CMAKE_FIND_FRAMEWORK "NEVER")
does not force the module to find the .dylib files instead of the .framework.
-
Thanks for these files.
I test the project and came to these observations :
in CMakeLists.txt, you need to specify with module of SFML you use like this :
find_package(SFML REQUIRED system window graphics)
SFML_INCLUDE_DIR is correctly set if you use framework. (No need to append /Headers to the path, gcc know where to search headers in a framework.)
set(CMAKE_FIND_FRAMEWORK "NEVER") works only if CMake's cache files are removed first (I don't know why however).
HTH
-
This should probably be documented in a README file or in a comment in FindSFML.cmake
-
here it is : http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package .