CMakeLists.txt
changeset 10421 55fd4e519a58
parent 10419 efb26f3918c4
child 10424 543367861d69
equal deleted inserted replaced
10420:0d91817f35e9 10421:55fd4e519a58
  1227     set(SDL_FRAMEWORK_AUDIOTOOLBOX 1)
  1227     set(SDL_FRAMEWORK_AUDIOTOOLBOX 1)
  1228   endif()
  1228   endif()
  1229 
  1229 
  1230   if(SDL_JOYSTICK)
  1230   if(SDL_JOYSTICK)
  1231     set(SDL_JOYSTICK_IOKIT 1)
  1231     set(SDL_JOYSTICK_IOKIT 1)
  1232     file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c)
  1232     if (IOS)
       
  1233       file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m)
       
  1234     else()
       
  1235       file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c)
       
  1236     endif()
  1233     set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
  1237     set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
  1234     set(HAVE_SDL_JOYSTICK TRUE)
  1238     set(HAVE_SDL_JOYSTICK TRUE)
  1235     set(SDL_FRAMEWORK_IOKIT 1)
  1239     set(SDL_FRAMEWORK_IOKIT 1)
  1236     set(SDL_FRAMEWORK_FF 1)
  1240     set(SDL_FRAMEWORK_FF 1)
  1237   endif()
  1241   endif()
  1238 
  1242 
  1239   if(SDL_HAPTIC)
  1243   if(SDL_HAPTIC)
  1240     set(SDL_HAPTIC_IOKIT 1)
  1244     set(SDL_HAPTIC_IOKIT 1)
  1241     file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c)
  1245     if (IOS)
       
  1246       file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/dummy/*.c)
       
  1247       set(SDL_HAPTIC_DUMMY 1)
       
  1248     else()
       
  1249       file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c)
       
  1250     endif()
  1242     set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
  1251     set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
  1243     set(HAVE_SDL_HAPTIC TRUE)
  1252     set(HAVE_SDL_HAPTIC TRUE)
  1244     set(SDL_FRAMEWORK_IOKIT 1)
  1253     set(SDL_FRAMEWORK_IOKIT 1)
  1245     set(SDL_FRAMEWORK_FF 1)
  1254     set(SDL_FRAMEWORK_FF 1)
  1246     if(NOT SDL_JOYSTICK)
  1255     if(NOT SDL_JOYSTICK)
  1248     endif()
  1257     endif()
  1249   endif()
  1258   endif()
  1250 
  1259 
  1251   if(SDL_POWER)
  1260   if(SDL_POWER)
  1252     set(SDL_POWER_MACOSX 1)
  1261     set(SDL_POWER_MACOSX 1)
  1253     file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
  1262     if (IOS)
       
  1263       file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/uikit/*.m)
       
  1264     else()
       
  1265       file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
       
  1266     endif()
  1254     set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
  1267     set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
  1255     set(HAVE_SDL_POWER TRUE)
  1268     set(HAVE_SDL_POWER TRUE)
  1256     set(SDL_FRAMEWORK_CARBON 1)
  1269     set(SDL_FRAMEWORK_CARBON 1)
  1257     set(SDL_FRAMEWORK_IOKIT 1)
  1270     set(SDL_FRAMEWORK_IOKIT 1)
  1258   endif()
  1271   endif()
  1302     list(APPEND EXTRA_LIBS ${AUDIOTOOLBOX})
  1315     list(APPEND EXTRA_LIBS ${AUDIOTOOLBOX})
  1303   endif()
  1316   endif()
  1304 
  1317 
  1305   # iOS hack needed - http://code.google.com/p/ios-cmake/ ?
  1318   # iOS hack needed - http://code.google.com/p/ios-cmake/ ?
  1306   if(SDL_VIDEO)
  1319   if(SDL_VIDEO)
  1307     CheckCOCOA()
  1320     if (IOS)
  1308     if(VIDEO_OPENGL)
  1321       set(SDL_VIDEO_DRIVER_HAIKU 1)
  1309       set(SDL_VIDEO_OPENGL 1)
  1322       file(GLOB UIKITVIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/uikit/*.m)
  1310       set(SDL_VIDEO_OPENGL_CGL 1)
  1323       set(SOURCE_FILES ${SOURCE_FILES} ${UIKITVIDEO_SOURCES})
  1311       set(SDL_VIDEO_RENDER_OGL 1)
  1324     else()
  1312       set(HAVE_VIDEO_OPENGL TRUE)
  1325       CheckCOCOA()
       
  1326       if(VIDEO_OPENGL)
       
  1327         set(SDL_VIDEO_OPENGL 1)
       
  1328         set(SDL_VIDEO_OPENGL_CGL 1)
       
  1329         set(SDL_VIDEO_RENDER_OGL 1)
       
  1330         set(HAVE_VIDEO_OPENGL TRUE)
       
  1331       endif()
  1313     endif()
  1332     endif()
  1314   endif()
  1333   endif()
  1315 
  1334 
  1316   CheckPTHREAD()
  1335   CheckPTHREAD()
  1317 elseif(HAIKU)
  1336 elseif(HAIKU)