diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2012-09-09 14:08:45 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2012-09-17 18:29:29 (GMT) |
commit | adf705863c0ccfe0b688aa615c306836caa9687f (patch) | |
tree | ba15806fedb1b8292f02a5ace0f1125b65971a2b /Modules/FindSDL.cmake | |
parent | eb8b0bea6f5eb7aa4fa2de6a54fab6f70c1bcf6e (diff) | |
download | CMake-adf705863c0ccfe0b688aa615c306836caa9687f.zip CMake-adf705863c0ccfe0b688aa615c306836caa9687f.tar.gz CMake-adf705863c0ccfe0b688aa615c306836caa9687f.tar.bz2 |
FindSDL: add SDLMAIN_LIBRARY only once (#13262)
Diffstat (limited to 'Modules/FindSDL.cmake')
-rw-r--r-- | Modules/FindSDL.cmake | 8 |
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. |