hedgewars/CMakeLists.txt
changeset 10973 36b84888934c
parent 10803 df39aa3f6d4d
child 11071 3851ce4f2061
child 11270 d49a1a295d81
--- a/hedgewars/CMakeLists.txt	Tue Jun 02 01:28:21 2015 +0100
+++ 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)