CMakeLists.txt
changeset 7667 be1cc6f55840
parent 7666 603fb699946c
child 7803 97a1127629fb
     1.1 --- a/CMakeLists.txt	Tue Aug 20 15:28:14 2013 -0400
     1.2 +++ b/CMakeLists.txt	Tue Aug 20 19:57:11 2013 -0400
     1.3 @@ -172,7 +172,7 @@
     1.4  
     1.5  set(SDL_SUBSYSTEMS
     1.6      Atomic Audio Video Render Events Joystick Haptic Power Threads Timers
     1.7 -    File Loadso CPUinfo)
     1.8 +    File Loadso CPUinfo Filesystem)
     1.9  foreach(_SUB ${SDL_SUBSYSTEMS})
    1.10    string(TOUPPER ${_SUB} _OPT)
    1.11    option(SDL_${_OPT} "Enable the ${_SUB} subsystem" ON)
    1.12 @@ -714,6 +714,13 @@
    1.13      endif(LINUX)
    1.14    endif(SDL_POWER)
    1.15  
    1.16 +  if(SDL_FILESYSTEM)
    1.17 +    set(SDL_FILESYSTEM_UNIX 1)
    1.18 +    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/unix/*.c)
    1.19 +    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
    1.20 +    set(HAVE_SDL_FILESYSTEM TRUE)
    1.21 +  endif(SDL_FILESYSTEM)
    1.22 +
    1.23    if(SDL_TIMERS)
    1.24      set(SDL_TIMER_UNIX 1)
    1.25      file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c)
    1.26 @@ -814,6 +821,13 @@
    1.27      set(HAVE_SDL_POWER TRUE)
    1.28    endif(SDL_POWER)
    1.29  
    1.30 +  if(SDL_FILESYSTEM)
    1.31 +    set(SDL_FILESYSTEM_WINDOWS 1)
    1.32 +    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesytem/windows/*.c)
    1.33 +    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
    1.34 +    set(HAVE_SDL_FILESYSTEM TRUE)
    1.35 +  endif(SDL_FILESYSTEM)
    1.36 +
    1.37    # Libraries for Win32 native and MinGW
    1.38    list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid)
    1.39  
    1.40 @@ -924,6 +938,13 @@
    1.41      set(SDL_FRAMEWORK_IOKIT 1)
    1.42    endif()
    1.43  
    1.44 +  if(SDL_FILESYSTEM)
    1.45 +    set(SDL_FILESYSTEM_COCOA 1)
    1.46 +    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/cocoa/*.m)
    1.47 +    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
    1.48 +    set(HAVE_SDL_FILESYSTEM TRUE)
    1.49 +  endif()
    1.50 +
    1.51    # Actually load the frameworks at the end so we don't duplicate include.
    1.52    if(SDL_FRAMEWORK_COCOA)
    1.53      find_library(COCOA_LIBRARY Cocoa)
    1.54 @@ -973,6 +994,11 @@
    1.55      set(SOURCE_FILES ${SOURCE_FILES} ${BWINDOW_SOURCES})
    1.56      set(HAVE_SDL_VIDEO TRUE)
    1.57  
    1.58 +    set(SDL_FILESYSTEM_BEOS 1)
    1.59 +    file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/beos/*.cc)
    1.60 +    set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
    1.61 +    set(HAVE_SDL_FILESYSTEM TRUE)
    1.62 +
    1.63      if(VIDEO_OPENGL)
    1.64        # TODO: Use FIND_PACKAGE(OpenGL) instead
    1.65        set(SDL_VIDEO_OPENGL 1)
    1.66 @@ -1010,6 +1036,11 @@
    1.67    file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c)
    1.68    set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
    1.69  endif(NOT HAVE_SDL_LOADSO)
    1.70 +if(NOT HAVE_SDL_FILESYSTEM)
    1.71 +  set(SDL_FILESYSTEM_DISABLED 1)
    1.72 +  file(GLOB FILESYSTEM_SOURCES ${SDL2_SOURCE_DIR}/src/filesystem/dummy/*.c)
    1.73 +  set(SOURCE_FILES ${SOURCE_FILES} ${FILESYSTEM_SOURCES})
    1.74 +endif(NOT HAVE_SDL_FILESYSTEM)
    1.75  
    1.76  # We always need to have threads and timers around
    1.77  if(NOT HAVE_SDL_THREADS)