SFML community forums
Help => General => Topic started by: OniLinkPlus on March 18, 2011, 12:16:03 am
-
Can someone explain to me how to use FindSFML? I can't find any information on it. Specifically, how do I choose between locating the Debug modules and Release modules?
-
FIND_PACKAGE (
SFML
REQUIRED system window graphics # audio network if you want
)
INCLUDE_DIRECTORIES ( ${SFML_INCLUDE_DIR} )
...
TARGET_LINK_LIBRARIES (
myexe
# like
${SFML_GRAPHICS_LIBRARY}
${SFML_WINDOW_LIBRARY}
# or like
${SFML_SYSTEM_LIBRARY_DEBUG}
Edit the findSFML.cmake file ;) Laurent explains it at the beginning .
-
Slightly improved/fixed example:
FIND_PACKAGE (
SFML
COMPONENTS system window graphics # audio network if you want
REQUIRED
)
INCLUDE_DIRECTORIES ( ${SFML_INCLUDE_DIR} )
...
TARGET_LINK_LIBRARIES (
myexe
optimized
${SFML_GRAPHICS_LIBRARY}
${SFML_WINDOW_LIBRARY}
${SFML_SYSTEM_LIBRARY}
debug
${SFML_GRAPHICS_LIBRARY_DEBUG}
${SFML_WINDOW_LIBRARY_DEBUG}
${SFML_SYSTEM_LIBRARY_DEBUG}
)
Options are explained at the beginning of the file (it's always like this with FindXxx.cmake files).
-
Slightly improved/fixed example:
FIND_PACKAGE (
SFML
COMPONENTS system window graphics # audio network if you want
REQUIRED
)
INCLUDE_DIRECTORIES ( ${SFML_INCLUDE_DIR} )
...
TARGET_LINK_LIBRARIES (
myexe
optimized
${SFML_GRAPHICS_LIBRARY}
${SFML_WINDOW_LIBRARY}
${SFML_SYSTEM_LIBRARY}
debug
${SFML_GRAPHICS_LIBRARY_DEBUG}
${SFML_WINDOW_LIBRARY_DEBUG}
${SFML_SYSTEM_LIBRARY_DEBUG}
)
Options are explained at the beginning of the file (it's always like this with FindXxx.cmake files).
This is perfect! Thank you!
-
And if you want to force SFML 2:
FIND_PACKAGE (
SFML 2
...