From c996c545b7ab89da58f40cb9b87539563bbef544 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 29 Mar 2007 09:29:26 +0000 Subject: [PATCH] From Eric Wing, "Added the conditionals for SDLMain." --- examples/osgsimpleviewerSDL/CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/examples/osgsimpleviewerSDL/CMakeLists.txt b/examples/osgsimpleviewerSDL/CMakeLists.txt index f3bbb2bf1..9510bf456 100644 --- a/examples/osgsimpleviewerSDL/CMakeLists.txt +++ b/examples/osgsimpleviewerSDL/CMakeLists.txt @@ -1,4 +1,18 @@ -SET(TARGET_SRC osgsimpleviewerSDL.cpp ) +IF("${SDL_LIBRARY}" MATCHES "SDLmain") + # Found a precompiled SDLmain library. + SET(TARGET_SRC osgsimpleviewerSDL.cpp) +ELSE("${SDL_LIBRARY}" MATCHES "SDLmain") + # No SDLmain has been found. + # Depending on platform, code may need to be provided for SDLmain. + IF(APPLE) + SET(TARGET_SRC osgsimpleviewerSDL.cpp SDLMainForMacOSX.m SDLMainForMacOSX.h) + ELSE(APPLE) + # Unhandled case. No libsdlmain has been found and no code substitute. + # Depending on platform (or SDL version), + # this may or may not link successfully. + SET(TARGET_SRC osgsimpleviewerSDL.cpp) + ENDIF(APPLE) +ENDIF("${SDL_LIBRARY}" MATCHES "SDLmain") SET(TARGET_EXTERNAL_LIBRARIES ${SDL_LIBRARY} ) @@ -6,3 +20,4 @@ INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} ) #### end var setup ### SETUP_EXAMPLE(osgsimpleviewerSDL) +