From aa506598d056c4ae0cc9a7d8721102d75a2696b2 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 28 Aug 2010 14:10:56 +0200 Subject: [PATCH] Fixed: #1080 Under Linux, load NeL drivers from a specific directory --- code/nel/CMakeLists.txt | 5 + code/nel/CMakeModules/nel.cmake | 98 +++++++++++-------- code/nel/config.h.cmake | 43 ++++++++ .../nel/src/3d/driver/direct3d/CMakeLists.txt | 8 +- code/nel/src/3d/driver/opengl/CMakeLists.txt | 11 +-- code/nel/src/3d/dru.cpp | 7 ++ .../src/sound/driver/dsound/CMakeLists.txt | 8 +- code/nel/src/sound/driver/fmod/CMakeLists.txt | 8 +- .../src/sound/driver/openal/CMakeLists.txt | 2 +- code/nel/src/sound/driver/sound_driver.cpp | 9 ++ .../src/sound/driver/xaudio2/CMakeLists.txt | 8 +- 11 files changed, 141 insertions(+), 66 deletions(-) create mode 100644 code/nel/config.h.cmake diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 3f1dc485b..94b0bf05e 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -189,6 +189,11 @@ IF(FINAL_VERSION) ADD_DEFINITIONS(-DFINAL_VERSION=1) ENDIF(FINAL_VERSION) +# config.h configuration and use by projects +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) +INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) +ADD_DEFINITIONS(-DHAVE_CONFIG_H) + ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(include) diff --git a/code/nel/CMakeModules/nel.cmake b/code/nel/CMakeModules/nel.cmake index 6535e5739..c58b5a1a0 100644 --- a/code/nel/CMakeModules/nel.cmake +++ b/code/nel/CMakeModules/nel.cmake @@ -27,7 +27,7 @@ MACRO(NL_TARGET_DRIVER name) IF(WITH_STATIC_DRIVERS) ADD_LIBRARY(${name} STATIC ${ARGN}) ELSE(WITH_STATIC_DRIVERS) - ADD_LIBRARY(${name} SHARED ${ARGN}) + ADD_LIBRARY(${name} MODULE ${ARGN}) ENDIF(WITH_STATIC_DRIVERS) ENDMACRO(NL_TARGET_DRIVER) @@ -38,13 +38,15 @@ ENDMACRO(NL_TARGET_DRIVER) ### MACRO(NL_DEFAULT_PROPS name label) GET_TARGET_PROPERTY(type ${name} TYPE) - IF((${type} STREQUAL SHARED_LIBRARY) OR (${type} STREQUAL MODULE_LIBRARY)) - # Set versions only if target is a shared library or a module - SET(versions VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR}) - ENDIF((${type} STREQUAL SHARED_LIBRARY) OR (${type} STREQUAL MODULE_LIBRARY)) - SET_TARGET_PROPERTIES(${name} PROPERTIES - ${versions} - PROJECT_LABEL ${label}) + IF(${type} STREQUAL SHARED_LIBRARY) + # Set versions only if target is a shared library + SET_TARGET_PROPERTIES(${name} PROPERTIES + VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR} + PROJECT_LABEL ${label}) + ELSE(${type} STREQUAL SHARED_LIBRARY) + SET_TARGET_PROPERTIES(${name} PROPERTIES + PROJECT_LABEL ${label}) + ENDIF(${type} STREQUAL SHARED_LIBRARY) ENDMACRO(NL_DEFAULT_PROPS) ### @@ -75,17 +77,17 @@ ENDMACRO(NL_ADD_RUNTIME_FLAGS) MACRO(NL_ADD_STATIC_VID_DRIVERS name) IF(WITH_STATIC_DRIVERS) IF(WIN32) - IF(WITH_DRIVER_DIRECT3D) - TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win) + IF(WITH_DRIVER_DIRECT3D) + TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win) ENDIF(WITH_DRIVER_DIRECT3D) - - IF(WITH_DRIVER_DSOUND) - TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) - ENDIF(WITH_DRIVER_DSOUND) - - IF(WITH_DRIVER_XAUDIO2) - TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) - ENDIF(WITH_DRIVER_XAUDIO2) + + IF(WITH_DRIVER_DSOUND) + TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) + ENDIF(WITH_DRIVER_DSOUND) + + IF(WITH_DRIVER_XAUDIO2) + TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) + ENDIF(WITH_DRIVER_XAUDIO2) ENDIF(WIN32) IF(WITH_DRIVER_OPENAL) @@ -98,9 +100,9 @@ MACRO(NL_ADD_STATIC_VID_DRIVERS name) IF(WITH_DRIVER_OPENGL) IF(WIN32) - TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win) - ELSE(WIN32) - TARGET_LINK_LIBRARIES(${name} nel_drv_opengl) + TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win) + ELSE(WIN32) + TARGET_LINK_LIBRARIES(${name} nel_drv_opengl) ENDIF(WIN32) ENDIF(WITH_DRIVER_OPENGL) ENDIF(WITH_STATIC_DRIVERS) @@ -109,13 +111,13 @@ ENDMACRO(NL_ADD_STATIC_VID_DRIVERS) MACRO(NL_ADD_STATIC_SND_DRIVERS name) IF(WITH_STATIC_DRIVERS) IF(WIN32) - IF(WITH_DRIVER_DSOUND) - TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) - ENDIF(WITH_DRIVER_DSOUND) - - IF(WITH_DRIVER_XAUDIO2) - TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) - ENDIF(WITH_DRIVER_XAUDIO2) + IF(WITH_DRIVER_DSOUND) + TARGET_LINK_LIBRARIES(${name} nel_drv_dsound) + ENDIF(WITH_DRIVER_DSOUND) + + IF(WITH_DRIVER_XAUDIO2) + TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2) + ENDIF(WITH_DRIVER_XAUDIO2) ENDIF(WIN32) IF(WITH_DRIVER_OPENAL) @@ -307,28 +309,46 @@ MACRO(NL_SETUP_PREFIX_PATHS) ## Allow override of install_prefix/share path. IF(NOT NL_SHARE_PREFIX) IF(WIN32) - SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.") - ELSE(WIN32) - SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/nel" CACHE PATH "Installation path for data.") - ENDIF(WIN32) + SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.") + ELSE(WIN32) + SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_PREFIX}/share/nel" CACHE PATH "Installation path for data.") + ENDIF(WIN32) ENDIF(NOT NL_SHARE_PREFIX) ## Allow override of install_prefix/sbin path. IF(NOT NL_SBIN_PREFIX) - IF(WIN32) - SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.") - ELSE(WIN32) - SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.") - ENDIF(WIN32) + IF(WIN32) + SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.") + ELSE(WIN32) + SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_PREFIX}/sbin" CACHE PATH "Installation path for admin tools and services.") + ENDIF(WIN32) ENDIF(NOT NL_SBIN_PREFIX) ## Allow override of install_prefix/bin path. IF(NOT NL_BIN_PREFIX) IF(WIN32) - SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.") + SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.") ELSE(WIN32) - SET(NL_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools and applications.") + SET(NL_BIN_PREFIX "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation path for tools and applications.") ENDIF(WIN32) ENDIF(NOT NL_BIN_PREFIX) + ## Allow override of install_prefix/lib path. + IF(NOT NL_LIB_PREFIX) + IF(WIN32) + SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.") + ELSE(WIN32) + SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.") + ENDIF(WIN32) + ENDIF(NOT NL_LIB_PREFIX) + + ## Allow override of install_prefix/lib path. + IF(NOT NL_DRIVER_PREFIX) + IF(WIN32) + SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.") + ELSE(WIN32) + SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.") + ENDIF(WIN32) + ENDIF(NOT NL_DRIVER_PREFIX) + ENDMACRO(NL_SETUP_PREFIX_PATHS) diff --git a/code/nel/config.h.cmake b/code/nel/config.h.cmake new file mode 100644 index 000000000..5296b3d50 --- /dev/null +++ b/code/nel/config.h.cmake @@ -0,0 +1,43 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#cmakedefine HAVE_DL_H 1 +#cmakedefine HAVE_EXECINFO_H 1 +#cmakedefine HAVE_ICONV 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_LANGINFO_CODESET 1 +#cmakedefine HAVE_LIMITS_H 1 +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_PAM_MISC_H 1 +#cmakedefine HAVE_PAM_PAM_APPL_H 1 +#cmakedefine HAVE_PTHREAD 1 +#cmakedefine HAVE_SECURITY_PAM_APPL_H 1 +#cmakedefine HAVE_SECURITY_PAM_MISC_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_SYS_MOUNT_H 1 +#cmakedefine HAVE_SYS_PARAM_H 1 +#cmakedefine HAVE_SYS_STATVFS_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_UNISTD_H 1 +#cmakedefine HAVE_UTIME_H 1 +#cmakedefine HAVE_WCHAR_H 1 + +#cmakedefine HAVE_BACKTRACE 1 +#cmakedefine HAVE_INET_NTOA 1 +#cmakedefine HAVE_INET_NTOP 1 +#cmakedefine HAVE_INET_PTON 1 +#cmakedefine HAVE_STRERROR 1 +#cmakedefine HAVE_STRLCAT 1 +#cmakedefine HAVE_STRPTIME 1 +#cmakedefine HAVE_STRTOK_R 1 +#cmakedefine HAVE_STRTOULL 1 +#cmakedefine HAVE_STATVFS 1 +#cmakedefine HAVE_STAT64 1 + +#cmakedefine NL_BIN_PREFIX "${NL_BIN_PREFIX}" +#cmakedefine NL_ETC_PREFIX "${NL_ETC_PREFIX}" +#cmakedefine NL_SHARE_PREFIX "${NL_SHARE_PREFIX}" +#cmakedefine NL_LIB_PREFIX "${NL_LIB_PREFIX}" +#cmakedefine NL_DRIVER_PREFIX "${NL_DRIVER_PREFIX}" + +#endif // CONFIG_H diff --git a/code/nel/src/3d/driver/direct3d/CMakeLists.txt b/code/nel/src/3d/driver/direct3d/CMakeLists.txt index 0bf8aa40f..cd3f24bb9 100644 --- a/code/nel/src/3d/driver/direct3d/CMakeLists.txt +++ b/code/nel/src/3d/driver/direct3d/CMakeLists.txt @@ -2,9 +2,9 @@ FILE(GLOB SRC *.cpp *.h *.def) NL_TARGET_DRIVER(nel_drv_direct3d_win ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FREETYPE_INC} ${DXSDK_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d ${LIBXML2_LIBRARIES} ${FREETYPE_LIB} ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) +TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_direct3d_win "Driver, Video: Direct3D") NL_ADD_RUNTIME_FLAGS(nel_drv_direct3d_win) @@ -12,13 +12,11 @@ NL_ADD_LIB_SUFFIX(nel_drv_direct3d_win) ADD_DEFINITIONS(/Ddriver_direct3d_EXPORTS) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_direct3d_win ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.h ${CMAKE_CURRENT_SOURCE_DIR}/stddirect3d.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) +INSTALL(TARGETS nel_drv_direct3d_win LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_direct3d_win RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index 46d98148b..ac9611295 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -12,8 +12,9 @@ ENDIF(WIN32) NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_LIBRARIES}) +INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) + +TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY}) NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "Driver, Video: OpenGL") NL_ADD_LIB_SUFFIX(${NLDRV_OGL_LIB}) NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB}) @@ -27,7 +28,7 @@ ELSE(WIN32) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${CARBON}) TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${COCOA}) ELSE(APPLE) - TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_LIBRARIES}) + TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${X11_LIB}) IF(XF86VidMode_FOUND) INCLUDE_DIRECTORIES(${XF86VidMode_INCLUDE_DIR}) ADD_DEFINITIONS(${XF86VidMode_DEFINITIONS}) @@ -41,13 +42,11 @@ ELSE(WIN32) ENDIF(APPLE) ENDIF(WIN32) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(NOT APPLE AND WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(${NLDRV_OGL_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopengl.cpp) ENDIF(NOT APPLE AND WITH_PCH) -INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) +INSTALL(TARGETS ${NLDRV_OGL_LIB} LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib RUNTIME DESTINATION bin COMPONENT drivers3d) IF(WITH_MAXPLUGIN) INSTALL(TARGETS ${NLDRV_OGL_LIB} RUNTIME DESTINATION maxplugin COMPONENT drivers3d) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/3d/dru.cpp b/code/nel/src/3d/dru.cpp index 5e18f760b..290a51124 100644 --- a/code/nel/src/3d/dru.cpp +++ b/code/nel/src/3d/dru.cpp @@ -25,6 +25,9 @@ #include "nel/3d/vertex_buffer.h" #include "nel/3d/index_buffer.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H #ifdef NL_OS_WINDOWS # define NOMINMAX @@ -75,6 +78,10 @@ IDriver *CDRU::createGlDriver() throw (EDru) // hInst=LoadLibrary(NL3D_GL_DLL_NAME); CLibrary driverLib; +#if defined(NL_OS_UNIX) && defined(NL_DRIVER_PREFIX) + driverLib.addLibPath(NL_DRIVER_PREFIX); +#endif + // if (!hInst) if (!driverLib.loadLibrary(NL3D_GL_DLL_NAME, true, true, false)) { diff --git a/code/nel/src/sound/driver/dsound/CMakeLists.txt b/code/nel/src/sound/driver/dsound/CMakeLists.txt index acf3376f3..18031084a 100644 --- a/code/nel/src/sound/driver/dsound/CMakeLists.txt +++ b/code/nel/src/sound/driver/dsound/CMakeLists.txt @@ -2,20 +2,18 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_DRIVER(nel_drv_dsound ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${DXSDK_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_dsound ${LIBXML2_LIBRARIES} nelsnd_lowlevel ${DXSDK_DSOUND_LIBRARY} ${DXSDK_GUID_LIBRARY}) +INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_drv_dsound nelmisc nelsnd_lowlevel ${DXSDK_DSOUND_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_dsound "Driver, Sound: DirectSound") NL_ADD_LIB_SUFFIX(nel_drv_dsound) NL_ADD_RUNTIME_FLAGS(nel_drv_dsound) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_dsound ${CMAKE_CURRENT_SOURCE_DIR}/stddsound.h ${CMAKE_CURRENT_SOURCE_DIR}/stddsound.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_dsound RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_dsound RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_dsound RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/fmod/CMakeLists.txt b/code/nel/src/sound/driver/fmod/CMakeLists.txt index ec5427ebd..3262799cf 100644 --- a/code/nel/src/sound/driver/fmod/CMakeLists.txt +++ b/code/nel/src/sound/driver/fmod/CMakeLists.txt @@ -2,20 +2,18 @@ FILE(GLOB SRC *.cpp *.h) NL_TARGET_DRIVER(nel_drv_fmod ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${FMOD_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_fmod ${LIBXML2_LIBRARIES} ${FMOD_LIBRARY} nelsnd_lowlevel) +INCLUDE_DIRECTORIES(${FMOD_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_drv_fmod ${FMOD_LIBRARY} nelmisc nelsnd_lowlevel) NL_DEFAULT_PROPS(nel_drv_fmod "Driver, Sound: FMOD") NL_ADD_LIB_SUFFIX(nel_drv_fmod) NL_ADD_RUNTIME_FLAGS(nel_drv_fmod) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_fmod ${CMAKE_CURRENT_SOURCE_DIR}/stdfmod.h ${CMAKE_CURRENT_SOURCE_DIR}/stdfmod.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_fmod RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_fmod RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_fmod RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/openal/CMakeLists.txt b/code/nel/src/sound/driver/openal/CMakeLists.txt index f1b76ad9d..b0abc074c 100644 --- a/code/nel/src/sound/driver/openal/CMakeLists.txt +++ b/code/nel/src/sound/driver/openal/CMakeLists.txt @@ -37,7 +37,7 @@ IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_openal ${CMAKE_CURRENT_SOURCE_DIR}/stdopenal.h ${CMAKE_CURRENT_SOURCE_DIR}/stdopenal.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_openal RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_openal RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_openal RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN) diff --git a/code/nel/src/sound/driver/sound_driver.cpp b/code/nel/src/sound/driver/sound_driver.cpp index c0ca3d5bc..e4bc219b5 100644 --- a/code/nel/src/sound/driver/sound_driver.cpp +++ b/code/nel/src/sound/driver/sound_driver.cpp @@ -18,6 +18,10 @@ #include "nel/sound/driver/sound_driver.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif // HAVE_CONFIG_H + #ifdef NL_OS_WINDOWS # define NOMINMAX # include @@ -201,6 +205,11 @@ ISoundDriver *ISoundDriver::createDriver(IStringMapperProvider *stringMapper, TD } CLibrary driverLib; + +#if defined(NL_OS_UNIX) && defined(NL_DRIVER_PREFIX) + driverLib.addLibPath(NL_DRIVER_PREFIX); +#endif + // Load it (adding standard nel pre/suffix, looking in library path and not taking ownership) if (!driverLib.loadLibrary(dllName, true, true, false)) { diff --git a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt index 7ed375902..187d7e1da 100644 --- a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt +++ b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt @@ -28,20 +28,18 @@ SOURCE_GROUP(efx FILES NL_TARGET_DRIVER(nel_drv_xaudio2 ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${DXSDK_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nel_drv_xaudio2 ${LIBXML2_LIBRARIES} nelsnd_lowlevel ${DXSDK_XAUDIO_LIBRARY} ${DXSDK_GUID_LIBRARY} ${VORBIS_LIBRARIES} ${OGG_LIBRARY}) +INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(nel_drv_xaudio2 nelmisc nelsnd_lowlevel ${DXSDK_XAUDIO_LIBRARY} ${DXSDK_GUID_LIBRARY}) NL_DEFAULT_PROPS(nel_drv_xaudio2 "Driver, Sound: XAudio2") NL_ADD_LIB_SUFFIX(nel_drv_xaudio2) NL_ADD_RUNTIME_FLAGS(nel_drv_xaudio2) -ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) - IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nel_drv_xaudio2 ${CMAKE_CURRENT_SOURCE_DIR}/stdxaudio2.h ${CMAKE_CURRENT_SOURCE_DIR}/stdxaudio2.cpp) ENDIF(WITH_PCH) -INSTALL(TARGETS nel_drv_xaudio2 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT driverssound) +INSTALL(TARGETS nel_drv_xaudio2 RUNTIME DESTINATION bin LIBRARY DESTINATION ${NL_DRIVER_PREFIX} ARCHIVE DESTINATION lib COMPONENT driverssound) IF(WITH_MAXPLUGIN) INSTALL(TARGETS nel_drv_xaudio2 RUNTIME DESTINATION maxplugin COMPONENT driverssound) ENDIF(WITH_MAXPLUGIN)