hedgewars/CMakeLists.txt
branch0.9.21
changeset 10759 0f4b38722400
parent 10747 07ade56c3b4a
--- a/hedgewars/CMakeLists.txt	Mon Jun 01 14:30:22 2015 +0200
+++ b/hedgewars/CMakeLists.txt	Tue Jun 02 01:58:10 2015 +0100
@@ -122,9 +122,23 @@
 
 #DEPENDECIES AND EXECUTABLES SECTION
 if(APPLE AND (NOT BUILD_ENGINE_LIBRARY))
-    #on OSX we need to provide the SDL_main() function when building as executable
+    #on OSX we need to provide the SDL_main() function when building as
+    #executable and the entry point too
     add_subdirectory(sdlmain)
     list(APPEND HW_LINK_LIBS SDLmain)
+    add_flag_append(CMAKE_Pascal_FLAGS "-k-lsdlmain")
+    add_flag_append(CMAKE_Pascal_FLAGS "-XMSDL_main")
+    #OpenGL deps
+    add_flag_append(CMAKE_Pascal_FLAGS "-k-framework -kCocoa")
+    add_flag_append(CMAKE_Pascal_FLAGS "-k-framework -kOpenGL")
+
+    #set the correct library or framework style depending on the main SDL
+    string(FIND "${SDL_LIBRARY}" "dylib" sdl_framework)
+    if(${sdl_framework} GREATER -1)
+        add_flag_append(CMAKE_Pascal_FLAGS "-k-lsdl -k-lsdl_image -k-lsdl_mixer -k-lsdl_ttf -k-lsdl_net")
+    else()
+        add_flag_append(CMAKE_Pascal_FLAGS "-k-framework -kSDL -k-framework -kSDL_image -k-framework -k SDL_mixer -k-framework -k SDL_net -k-framework -kSDL_net")
+    endif()
 endif()
 
 if(LIBAV_FOUND)