mirror of
https://github.com/SFML/SFML.git
synced 2024-12-01 07:41:05 +08:00
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:
parent
e78f1bd4ea
commit
c0bee34d42
@ -240,7 +240,8 @@ if(SFML_STATIC_LIBRARIES)
|
||||
|
||||
# macro that searches for a 3rd-party library
|
||||
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")
|
||||
unset(output)
|
||||
set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}")
|
||||
|
Loading…
Reference in New Issue
Block a user