From effe6d4cece6e7058494cd7d29e19e8d0aa85ef0 Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Thu, 29 Dec 2011 16:16:09 +0100 Subject: [PATCH] Improved FindSFML.cmake: the SFMLDIR variable now has the priority over standard paths when searching SFML headers and libs (implements issue #142) --- cmake/Modules/FindSFML.cmake | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/cmake/Modules/FindSFML.cmake b/cmake/Modules/FindSFML.cmake index 55e958c1d..c125a2034 100644 --- a/cmake/Modules/FindSFML.cmake +++ b/cmake/Modules/FindSFML.cmake @@ -37,6 +37,8 @@ endif() find_path(SFML_INCLUDE_DIR SFML/Config.hpp PATH_SUFFIXES include PATHS + ${SFMLDIR} + $ENV{SFMLDIR} ~/Library/Frameworks /Library/Frameworks /usr/local/ @@ -44,9 +46,7 @@ find_path(SFML_INCLUDE_DIR SFML/Config.hpp /sw # Fink /opt/local/ # DarwinPorts /opt/csw/ # Blastwave - /opt/ - ${SFMLDIR} - $ENV{SFMLDIR}) + /opt/) # check the version number set(SFML_VERSION_OK TRUE) @@ -79,16 +79,17 @@ endif() # find the requested modules set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found -set(FIND_SFML_LIB_PATHS ~/Library/Frameworks - /Library/Frameworks - /usr/local - /usr - /sw - /opt/local - /opt/csw - /opt - ${SFMLDIR} - $ENV{SFMLDIR}) +set(FIND_SFML_LIB_PATHS + ${SFMLDIR} + $ENV{SFMLDIR} + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw + /opt/local + /opt/csw + /opt) foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS}) string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER) string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)