CMakeLists.txt
changeset 9073 98d13a381299
parent 8910 c23ffe72934c
child 9075 257a6793aaf5
equal deleted inserted replaced
9072:0c1a46c018aa 9073:98d13a381299
   803     check_include_file(d3d11_1.h HAVE_D3D11_H)
   803     check_include_file(d3d11_1.h HAVE_D3D11_H)
   804     check_include_file(ddraw.h HAVE_DDRAW_H)
   804     check_include_file(ddraw.h HAVE_DDRAW_H)
   805     check_include_file(dsound.h HAVE_DSOUND_H)
   805     check_include_file(dsound.h HAVE_DSOUND_H)
   806     check_include_file(dinput.h HAVE_DINPUT_H)
   806     check_include_file(dinput.h HAVE_DINPUT_H)
   807     check_include_file(xaudio2.h HAVE_XAUDIO2_H)
   807     check_include_file(xaudio2.h HAVE_XAUDIO2_H)
       
   808     check_include_file(xinput.h HAVE_XINPUT_H)
   808     check_include_file(dxgi.h HAVE_DXGI_H)
   809     check_include_file(dxgi.h HAVE_DXGI_H)
   809     if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H)
   810     if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H)
   810       set(HAVE_DIRECTX TRUE)
   811       set(HAVE_DIRECTX TRUE)
   811       # TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
   812       # TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
   812       link_directories($ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH})
   813       link_directories($ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH})
   908       set(HAVE_VIDEO_OPENGL TRUE)
   909       set(HAVE_VIDEO_OPENGL TRUE)
   909     endif()
   910     endif()
   910   endif()
   911   endif()
   911 
   912 
   912   if(SDL_JOYSTICK)
   913   if(SDL_JOYSTICK)
       
   914     file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/windows/*.c)
       
   915     set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES})
   913     if(HAVE_DINPUT_H)
   916     if(HAVE_DINPUT_H)
   914       set(SDL_JOYSTICK_DINPUT 1)
   917       set(SDL_JOYSTICK_DINPUT 1)
   915       set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/joystick/windows/SDL_dxjoystick.c)
       
   916       list(APPEND EXTRA_LIBS dinput8 dxguid dxerr)
   918       list(APPEND EXTRA_LIBS dinput8 dxguid dxerr)
   917     else()
   919     endif()
       
   920     if(HAVE_XINPUT_H)
       
   921       set(SDL_JOYSTICK_XINPUT 1)
       
   922     endif()
       
   923     if(NOT HAVE_DINPUT_H AND NOT HAVE_XINPUT_H)
   918       set(SDL_JOYSTICK_WINMM 1)
   924       set(SDL_JOYSTICK_WINMM 1)
   919       set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/joystick/windows/SDL_mmjoystick.c)
       
   920     endif()
   925     endif()
   921     set(HAVE_SDL_JOYSTICK TRUE)
   926     set(HAVE_SDL_JOYSTICK TRUE)
   922   endif()
   927 
   923 
   928     if(SDL_HAPTIC)
   924   if(SDL_HAPTIC AND HAVE_DINPUT_H)
   929       file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/windows/*.c)
   925     set(SDL_HAPTIC_DINPUT 1)
   930       set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
   926     set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/haptic/windows/SDL_syshaptic.c)
   931       if(HAVE_DINPUT_H)
   927     set(HAVE_SDL_HAPTIC TRUE)
   932         set(SDL_HAPTIC_DINPUT 1)
       
   933       endif()
       
   934       if(HAVE_XINPUT_H)
       
   935         set(SDL_HAPTIC_XINPUT 1)
       
   936       endif()
       
   937       set(HAVE_SDL_HAPTIC TRUE)
       
   938     endif()
   928   endif()
   939   endif()
   929 
   940 
   930   file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc)
   941   file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc)
   931   file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c)
   942   file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c)
   932   if(MINGW OR CYGWIN)
   943   if(MINGW OR CYGWIN)