summaryrefslogtreecommitdiff
path: root/Modules/FindSDL.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2016-11-06 17:37:54 +1100
committerBrad King <brad.king@kitware.com>2016-11-08 09:52:55 -0500
commitf18b18b72b8f7f8dc21e350f4dd1c6931cdb389f (patch)
tree32f61d338d0bb8f78f85424f38ac891126a86581 /Modules/FindSDL.cmake
parentd568cecf38a6a4b399c925fd3553dd4a273d0af1 (diff)
downloadcmake-f18b18b72b8f7f8dc21e350f4dd1c6931cdb389f.tar.gz
FindSDL: Prevent unbounded growth of SDL_LIBRARY_TEMP variable
Just modify the cache var property rather than using set() to hide it. Otherwise the set() includes other values added to the temporary list. Closes: #16406
Diffstat (limited to 'Modules/FindSDL.cmake')
-rw-r--r--Modules/FindSDL.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 4e4411ffb0..3410018972 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -94,6 +94,11 @@ find_library(SDL_LIBRARY_TEMP
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
+# Hide this cache variable from the user, it's an internal implementation
+# detail. The documented library variable for the user is SDL_LIBRARY
+# which is derived from SDL_LIBRARY_TEMP further below.
+set_property(CACHE SDL_LIBRARY_TEMP PROPERTY TYPE INTERNAL)
+
if(NOT SDL_BUILDING_LIBRARY)
if(NOT SDL_INCLUDE_DIR MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
@@ -162,8 +167,6 @@ if(SDL_LIBRARY_TEMP)
# Set the final string here so the GUI reflects the final state.
set(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
- # Set the temp variable to INTERNAL so it is not seen in the CMake GUI
- set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
endif()
if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h")