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

Author Topic: FindSFML.cmake question  (Read 1943 times)

0 Members and 1 Guest are viewing this topic.

voltir

  • Newbie
  • *
  • Posts: 1
    • View Profile
FindSFML.cmake question
« on: July 01, 2011, 11:22:09 pm »
I apologize if this has been asked before, but I recently was playing with sfml 2.0 and got it to install from cmake without a problem. However, when I went to use the find_package(SFML REQUIRED) cmake directive in my own test project, it succeeded but did not define SFML_LIBRARIES.

I went poking through the FindSFML.cmake file and discovered that the ${SFML_FIND_COMPONENTS} variable is empty. And if I set that variable before it is used, using an appropriate list of components, then the find_package directive works as expected.

Any idea on why ${SFML_FIND_COMPONENTS} defaults to an empty list?

For the record, I am building in ubuntu 11.04 and am generating make files.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
FindSFML.cmake question
« Reply #1 on: July 02, 2011, 10:27:03 pm »
You're supposed to explicitely write which SFML components you want to find:
Code: [Select]
find_package(SFML COMPONENTS graphics window system REQUIRED)

You can also find a specific (minimum) version:
Code: [Select]
find_package(SFML 2 COMPONENTS graphics window system REQUIRED)
Laurent Gomila - SFML developer

FierceForm

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • Email
FindSFML.cmake question
« Reply #2 on: July 05, 2011, 10:03:08 pm »
Oh cool. I can fix my CMake hacks now.
-FierceForm