FindSFML.cmake: Ignored environment variables to find library paths

Environment variables (e.g. PATH on Windows) are looked up early by CMake, and libraries found there are prioritized over those in SFML's own folder. To avoid paths to wrong libraries, this commit modifies the CMake find_library() call, such that environment variables are no longer considered as suitable paths.
This commit is contained in:
Jan Haller 2015-03-23 15:09:04 +01:00 committed by Lukas Dürrenberger
parent e78f1bd4ea
commit c0bee34d42

View File

@ -240,7 +240,8 @@ if(SFML_STATIC_LIBRARIES)
# macro that searches for a 3rd-party library # macro that searches for a 3rd-party library
macro(find_sfml_dependency output friendlyname) macro(find_sfml_dependency output friendlyname)
find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib) # No lookup in environment variables (PATH on Windows), as they may contain wrong library versions
find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH)
if(${${output}} STREQUAL "${output}-NOTFOUND") if(${${output}} STREQUAL "${output}-NOTFOUND")
unset(output) unset(output)
set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}") set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}")