CMake: Fixed to work on Windows 8 SDK (thanks, Martin!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 29 Dec 2015 00:02:43 -0500
changeset 9979e3d651c5fe31
parent 9978 a80ea42a4adc
child 9980 224187458d03
CMake: Fixed to work on Windows 8 SDK (thanks, Martin!).

Fixes Bugzilla #3207.
CMakeLists.txt
     1.1 --- a/CMakeLists.txt	Mon Dec 28 23:29:11 2015 -0500
     1.2 +++ b/CMakeLists.txt	Tue Dec 29 00:02:43 2015 -0500
     1.3 @@ -900,7 +900,10 @@
     1.4  
     1.5    # Check for DirectX
     1.6    if(DIRECTX)
     1.7 -    if(NOT CMAKE_COMPILER_IS_MINGW)
     1.8 +    if(DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700)
     1.9 +        set(USE_WINSDK_DIRECTX TRUE)
    1.10 +    endif()
    1.11 +    if(NOT CMAKE_COMPILER_IS_MINGW AND NOT USE_WINSDK_DIRECTX)
    1.12        if("$ENV{DXSDK_DIR}" STREQUAL "")
    1.13          message_error("DIRECTX requires the \$DXSDK_DIR environment variable to be set")
    1.14        endif()
    1.15 @@ -926,7 +929,7 @@
    1.16      check_include_file(dxgi.h HAVE_DXGI_H)
    1.17      if(HAVE_D3D_H OR HAVE_D3D11_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H)
    1.18        set(HAVE_DIRECTX TRUE)
    1.19 -      if(NOT CMAKE_COMPILER_IS_MINGW)
    1.20 +      if(NOT CMAKE_COMPILER_IS_MINGW AND NOT USE_WINSDK_DIRECTX)
    1.21        # TODO: change $ENV{DXSDL_DIR} to get the path from the include checks
    1.22          link_directories($ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH})
    1.23          include_directories($ENV{DXSDK_DIR}\\Include)
    1.24 @@ -1044,7 +1047,7 @@
    1.25        list(APPEND EXTRA_LIBS dinput8 dxguid)
    1.26        if(CMAKE_COMPILER_IS_MINGW)
    1.27          list(APPEND EXTRA_LIBS dxerr8)
    1.28 -      else()
    1.29 +      elseif (NOT USE_WINSDK_DIRECTX)
    1.30          list(APPEND EXTRA_LIBS dxerr)
    1.31        endif()
    1.32      endif()