SFML community forums
Help => General => Topic started by: voltir 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.
-
You're supposed to explicitely write which SFML components you want to find:
find_package(SFML COMPONENTS graphics window system REQUIRED)
You can also find a specific (minimum) version:
find_package(SFML 2 COMPONENTS graphics window system REQUIRED)
-
Oh cool. I can fix my CMake hacks now.