From 512a7c63cbc0d2d703c4881339c3a0ceb49da70a Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Sun, 9 Oct 2011 11:20:45 +0200 Subject: [PATCH] FindSFML.cmake now defines the SFML_STATIC macro when requesting static libraries --- cmake/Modules/FindSFML.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmake/Modules/FindSFML.cmake b/cmake/Modules/FindSFML.cmake index 5e4f727b..55e958c1 100644 --- a/cmake/Modules/FindSFML.cmake +++ b/cmake/Modules/FindSFML.cmake @@ -11,16 +11,22 @@ # - SFML_INCLUDE_DIR, the path where SFML headers are located (the directory containing the SFML/Config.hpp file) # # By default, the dynamic libraries of SFML will be found. To find the static ones instead, -# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...). -# -# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless -# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details. -# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which +# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...). +# In case of static linking, the SFML_STATIC macro will also be defined by this script. +# +# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless +# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details. +# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which # are available for both release and debug modes. # # If SFML is not installed in a standard path, you can use the SFMLDIR CMake variable or environment variable # to tell CMake where SFML is. +# define the SFML_STATIC macro if static build was chosen +if(SFML_STATIC_LIBRARIES) + add_definitions(-DSFML_STATIC) +endif() + # deduce the libraries suffix from the options set(FIND_SFML_LIB_SUFFIX "") if(SFML_STATIC_LIBRARIES)