summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-09-18 20:42:57 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-09-18 20:42:57 (GMT)
commita24830521b7a21b05ce69aa216d75214e37d541f (patch)
tree75799fe32456b9ef96138027e339b606c27f677b /Modules
parent024bbad23003d4134bef2d2c3dad0a95c84f777a (diff)
parentadf705863c0ccfe0b688aa615c306836caa9687f (diff)
downloadCMake-a24830521b7a21b05ce69aa216d75214e37d541f.zip
CMake-a24830521b7a21b05ce69aa216d75214e37d541f.tar.gz
CMake-a24830521b7a21b05ce69aa216d75214e37d541f.tar.bz2
Merge topic 'findsdl-unlimited-main-13262'
adf7058 FindSDL: add SDLMAIN_LIBRARY only once (#13262)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindSDL.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 487c5d3..adaec95 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -133,10 +133,12 @@ endif()
if(SDL_LIBRARY_TEMP)
# For SDLmain
- if(NOT SDL_BUILDING_LIBRARY)
- if(SDLMAIN_LIBRARY)
- set(SDL_LIBRARY_TEMP ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP})
+ if(SDLMAIN_LIBRARY AND NOT SDL_BUILDING_LIBRARY)
+ list(FIND SDL_LIBRARY_TEMP "${SDLMAIN_LIBRARY}" _SDL_MAIN_INDEX)
+ if(_SDL_MAIN_INDEX EQUAL -1)
+ list(APPEND SDL_LIBRARY_TEMP "${SDLMAIN_LIBRARY}")
endif()
+ unset(_SDL_MAIN_INDEX)
endif()
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.