Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: FindSFML.cmake - broken on OS X  (Read 2216 times)

0 Members and 1 Guest are viewing this topic.

sbroadfoot90

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
FindSFML.cmake - broken on OS X
« 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.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
FindSFML.cmake - broken on OS X
« Reply #1 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!  :)
SFML / OS X developer

sbroadfoot90

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
FindSFML.cmake - broken on OS X
« Reply #2 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.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
FindSFML.cmake - broken on OS X
« Reply #3 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
SFML / OS X developer

sbroadfoot90

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
FindSFML.cmake - broken on OS X
« Reply #4 on: November 18, 2011, 10:58:55 pm »
This should probably be documented in a README file or in a comment in FindSFML.cmake

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML / OS X developer