CMakeLists.txt
changeset 7667 be1cc6f55840
parent 7666 603fb699946c
child 7803 97a1127629fb
equal deleted inserted replaced
7666:603fb699946c 7667:be1cc6f55840
   170 # General includes
   170 # General includes
   171 include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include)
   171 include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include)
   172 
   172 
   173 set(SDL_SUBSYSTEMS
   173 set(SDL_SUBSYSTEMS
   174     Atomic Audio Video Render Events Joystick Haptic Power Threads Timers
   174     Atomic Audio Video Render Events Joystick Haptic Power Threads Timers
   175     File Loadso CPUinfo)
   175     File Loadso CPUinfo Filesystem)
   176 foreach(_SUB ${SDL_SUBSYSTEMS})
   176 foreach(_SUB ${SDL_SUBSYSTEMS})
   177   string(TOUPPER ${_SUB} _OPT)
   177   string(TOUPPER ${_SUB} _OPT)
   178   option(SDL_${_OPT} "Enable the ${_SUB} subsystem" ON)
   178   option(SDL_${_OPT} "Enable the ${_SUB} subsystem" ON)
   179 endforeach()
   179 endforeach()
   180 
   180 
   712       set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
   712       set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
   713       set(HAVE_SDL_POWER TRUE)
   713       set(HAVE_SDL_POWER TRUE)
   714     endif(LINUX)
   714     endif(LINUX)
   715   endif(SDL_POWER)
   715   endif(SDL_POWER)
   716 
   716 
       
   717   if(SDL_FILESYSTEM)
       
   718     set(SDL_FILESYSTEM_UNIX 1)
       
   719     file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/unix/*.c)
       
   720     set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
       
   721     set(HAVE_SDL_FILESYSTEM TRUE)
       
   722   endif(SDL_FILESYSTEM)
       
   723 
   717   if(SDL_TIMERS)
   724   if(SDL_TIMERS)
   718     set(SDL_TIMER_UNIX 1)
   725     set(SDL_TIMER_UNIX 1)
   719     file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c)
   726     file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c)
   720     set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
   727     set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
   721     set(HAVE_SDL_TIMERS TRUE)
   728     set(HAVE_SDL_TIMERS TRUE)
   812     set(SDL_POWER_WINDOWS 1)
   819     set(SDL_POWER_WINDOWS 1)
   813     set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/power/windows/SDL_syspower.c)
   820     set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/power/windows/SDL_syspower.c)
   814     set(HAVE_SDL_POWER TRUE)
   821     set(HAVE_SDL_POWER TRUE)
   815   endif(SDL_POWER)
   822   endif(SDL_POWER)
   816 
   823 
       
   824   if(SDL_FILESYSTEM)
       
   825     set(SDL_FILESYSTEM_WINDOWS 1)
       
   826     file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesytem/windows/*.c)
       
   827     set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
       
   828     set(HAVE_SDL_FILESYSTEM TRUE)
       
   829   endif(SDL_FILESYSTEM)
       
   830 
   817   # Libraries for Win32 native and MinGW
   831   # Libraries for Win32 native and MinGW
   818   list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid)
   832   list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid)
   819 
   833 
   820   # TODO: in configure.in the check for timers is set on
   834   # TODO: in configure.in the check for timers is set on
   821   # cygwin | mingw32* - does this include mingw32CE?
   835   # cygwin | mingw32* - does this include mingw32CE?
   920     file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
   934     file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c)
   921     set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
   935     set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES})
   922     set(HAVE_SDL_POWER TRUE)
   936     set(HAVE_SDL_POWER TRUE)
   923     set(SDL_FRAMEWORK_CARBON 1)
   937     set(SDL_FRAMEWORK_CARBON 1)
   924     set(SDL_FRAMEWORK_IOKIT 1)
   938     set(SDL_FRAMEWORK_IOKIT 1)
       
   939   endif()
       
   940 
       
   941   if(SDL_FILESYSTEM)
       
   942     set(SDL_FILESYSTEM_COCOA 1)
       
   943     file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/cocoa/*.m)
       
   944     set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
       
   945     set(HAVE_SDL_FILESYSTEM TRUE)
   925   endif()
   946   endif()
   926 
   947 
   927   # Actually load the frameworks at the end so we don't duplicate include.
   948   # Actually load the frameworks at the end so we don't duplicate include.
   928   if(SDL_FRAMEWORK_COCOA)
   949   if(SDL_FRAMEWORK_COCOA)
   929     find_library(COCOA_LIBRARY Cocoa)
   950     find_library(COCOA_LIBRARY Cocoa)
   971     set(SDL_VIDEO_DRIVER_BWINDOW 1)
   992     set(SDL_VIDEO_DRIVER_BWINDOW 1)
   972     file(GLOB BWINDOW_SOURCES ${SDL2_SOURCE_DIR}/src/video/bwindow/*.c)
   993     file(GLOB BWINDOW_SOURCES ${SDL2_SOURCE_DIR}/src/video/bwindow/*.c)
   973     set(SOURCE_FILES ${SOURCE_FILES} ${BWINDOW_SOURCES})
   994     set(SOURCE_FILES ${SOURCE_FILES} ${BWINDOW_SOURCES})
   974     set(HAVE_SDL_VIDEO TRUE)
   995     set(HAVE_SDL_VIDEO TRUE)
   975 
   996 
       
   997     set(SDL_FILESYSTEM_BEOS 1)
       
   998     file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/beos/*.cc)
       
   999     set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
       
  1000     set(HAVE_SDL_FILESYSTEM TRUE)
       
  1001 
   976     if(VIDEO_OPENGL)
  1002     if(VIDEO_OPENGL)
   977       # TODO: Use FIND_PACKAGE(OpenGL) instead
  1003       # TODO: Use FIND_PACKAGE(OpenGL) instead
   978       set(SDL_VIDEO_OPENGL 1)
  1004       set(SDL_VIDEO_OPENGL 1)
   979       set(SDL_VIDEO_OPENGL_BGL 1)
  1005       set(SDL_VIDEO_OPENGL_BGL 1)
   980       set(SDL_VIDEO_RENDER_OGL 1)
  1006       set(SDL_VIDEO_RENDER_OGL 1)
  1008 if(NOT HAVE_SDL_LOADSO)
  1034 if(NOT HAVE_SDL_LOADSO)
  1009   set(SDL_LOADSO_DISABLED 1)
  1035   set(SDL_LOADSO_DISABLED 1)
  1010   file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c)
  1036   file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c)
  1011   set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
  1037   set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
  1012 endif(NOT HAVE_SDL_LOADSO)
  1038 endif(NOT HAVE_SDL_LOADSO)
       
  1039 if(NOT HAVE_SDL_FILESYSTEM)
       
  1040   set(SDL_FILESYSTEM_DISABLED 1)
       
  1041   file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c)
       
  1042   set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
       
  1043 endif(NOT HAVE_SDL_FILESYSTEM)
  1013 
  1044 
  1014 # We always need to have threads and timers around
  1045 # We always need to have threads and timers around
  1015 if(NOT HAVE_SDL_THREADS)
  1046 if(NOT HAVE_SDL_THREADS)
  1016   set(SDL_THREADS_DISABLED 1)
  1047   set(SDL_THREADS_DISABLED 1)
  1017   file(GLOB THREADS_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/*.c)
  1048   file(GLOB THREADS_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/*.c)