SFML community forums

Help => General => Topic started by: sbroadfoot90 on November 18, 2011, 08:43:52 am

Title: FindSFML.cmake - broken on OS X
Post 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.
Title: FindSFML.cmake - broken on OS X
Post by: Hiura on November 18, 2011, 10:34:10 am
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!  :)
Title: FindSFML.cmake - broken on OS X
Post by: sbroadfoot90 on November 18, 2011, 12:44:21 pm
https://github.com/sbroadfoot90/cmaketest

Also, I'm not sure if I'm doing it right, but setting

Code: [Select]
set(CMAKE_FIND_FRAMEWORK "NEVER")

does not force the module to find the .dylib files instead of the .framework.
Title: FindSFML.cmake - broken on OS X
Post by: Hiura on November 18, 2011, 07:58:20 pm
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 :
Code: [Select]
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
Title: FindSFML.cmake - broken on OS X
Post by: sbroadfoot90 on November 18, 2011, 10:58:55 pm
This should probably be documented in a README file or in a comment in FindSFML.cmake
Title: FindSFML.cmake - broken on OS X
Post by: Hiura on November 18, 2011, 11:22:10 pm
here it is : http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package .