From 9a10f1413b86078fbe892ee65e982967be32e7de Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 10 Jul 2015 06:16:19 +0200 Subject: [PATCH] Fix DXSDK include order --HG-- branch : develop --- code/CMakeModules/nel.cmake | 8 ++++++++ code/nel/CMakeLists.txt | 4 ---- code/nel/src/3d/driver/direct3d/CMakeLists.txt | 2 +- code/nel/src/3d/driver/opengl/CMakeLists.txt | 2 +- code/nel/src/3d/driver/opengles/CMakeLists.txt | 2 +- code/nel/src/misc/CMakeLists.txt | 2 +- code/nel/src/sound/driver/dsound/CMakeLists.txt | 2 +- code/nel/src/sound/driver/xaudio2/CMakeLists.txt | 2 +- .../leveldesign/georges_plugin_sound/CMakeLists.txt | 11 ----------- 9 files changed, 14 insertions(+), 21 deletions(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 70113e11b..52ee640e9 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -1147,6 +1147,14 @@ MACRO(SETUP_EXTERNAL) INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR}) ENDIF(WITH_STLPORT) + IF(WIN32) + # Must include DXSDK before WINSDK + FIND_PACKAGE(DirectXSDK REQUIRED) + # IF(DXSDK_INCLUDE_DIR) + # INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + # ENDIF() + ENDIF(WIN32) + IF(MSVC) FIND_PACKAGE(MSVC REQUIRED) FIND_PACKAGE(WindowsSDK REQUIRED) diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 16a8166fe..f283eaecb 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -4,11 +4,7 @@ IF(WITH_STATIC_DRIVERS) ADD_DEFINITIONS(-DNL_STATIC) ENDIF(WITH_STATIC_DRIVERS) -# On Windows we need to find DirectInput for NLMISC. -# This is how we get events. IF(WIN32) - FIND_PACKAGE(DirectXSDK REQUIRED) - # On Win32 we can also build the MAX plugins. IF(WITH_NEL_MAXPLUGIN) FIND_PACKAGE(3dsMaxSDK) diff --git a/code/nel/src/3d/driver/direct3d/CMakeLists.txt b/code/nel/src/3d/driver/direct3d/CMakeLists.txt index ccdb8cb10..b76e20f52 100644 --- a/code/nel/src/3d/driver/direct3d/CMakeLists.txt +++ b/code/nel/src/3d/driver/direct3d/CMakeLists.txt @@ -2,7 +2,7 @@ FILE(GLOB SRC *.cpp *.h *.def) NL_TARGET_DRIVER(nel_drv_direct3d_win ${SRC}) -INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d nelmisc ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index 12e20fbb3..74f3cb78a 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -35,7 +35,7 @@ NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB}) NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB}) IF(WIN32) - INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) ADD_DEFINITIONS(-DDRIVER_OPENGL_EXPORTS) ENDIF(WIN32) diff --git a/code/nel/src/3d/driver/opengles/CMakeLists.txt b/code/nel/src/3d/driver/opengles/CMakeLists.txt index 74f0ddff3..e8d5a7979 100644 --- a/code/nel/src/3d/driver/opengles/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengles/CMakeLists.txt @@ -38,7 +38,7 @@ NL_ADD_LIB_SUFFIX(${NLDRV_OGLES_LIB}) NL_ADD_RUNTIME_FLAGS(${NLDRV_OGLES_LIB}) IF(WIN32) - INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(${NLDRV_OGLES_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) ADD_DEFINITIONS(/DDRIVER_OPENGLES_EXPORTS) ENDIF(WIN32) diff --git a/code/nel/src/misc/CMakeLists.txt b/code/nel/src/misc/CMakeLists.txt index f40517f5b..8cdbf0fe6 100644 --- a/code/nel/src/misc/CMakeLists.txt +++ b/code/nel/src/misc/CMakeLists.txt @@ -196,7 +196,7 @@ ENDIF(WITH_STATIC OR WIN32) # For DirectInput (di_event_emitter) IF(WIN32) - INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nelmisc ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY} winmm dbghelp) ENDIF(WIN32) diff --git a/code/nel/src/sound/driver/dsound/CMakeLists.txt b/code/nel/src/sound/driver/dsound/CMakeLists.txt index 74d431084..1563a871a 100644 --- a/code/nel/src/sound/driver/dsound/CMakeLists.txt +++ b/code/nel/src/sound/driver/dsound/CMakeLists.txt @@ -2,7 +2,7 @@ FILE(GLOB SRC *.cpp *.h *.def) NL_TARGET_DRIVER(nel_drv_dsound_win ${SRC}) -INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_dsound_win nelmisc nelsnd_lowlevel ${DXSDK_DSOUND_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_dsound_win "NeL, Driver, Sound: DirectSound") diff --git a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt index 9113bd022..d6c1a7143 100644 --- a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt +++ b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt @@ -28,7 +28,7 @@ SOURCE_GROUP(efx FILES NL_TARGET_DRIVER(nel_drv_xaudio2_win ${SRC}) -INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(nel_drv_xaudio2_win nelmisc nelsnd_lowlevel ${DXSDK_XAUDIO_LIBRARY} ${DXSDK_GUID_LIBRARY}) diff --git a/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt b/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt index c88246a98..0add6656c 100644 --- a/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt +++ b/code/ryzom/tools/leveldesign/georges_plugin_sound/CMakeLists.txt @@ -1,17 +1,6 @@ FILE(GLOB SRC *.cpp *.h) -# Bugfix... -IF (NOT DXSDK_INCLUDE_DIR) - IF (DXSDK_DIR) - SET(DXSDK_INCLUDE_DIR "${DXSDK_DIR}/Include") - ENDIF (DXSDK_DIR) -ENDIF (NOT DXSDK_INCLUDE_DIR) - -IF (NOT DXSDK_INCLUDE_DIR) - message(FATAL_ERROR "Configuration bad, cannot find DirectX include.") -ENDIF (NOT DXSDK_INCLUDE_DIR) - ADD_LIBRARY(georges_plugin_sound SHARED ${SRC}) INCLUDE_DIRECTORIES(georges_plugin_sound ${NEL_INCLUDE_DIR} ${DXSDK_INCLUDE_DIR})