From f5c9ff64fd02132588c735c1b85164c255ac30dc Mon Sep 17 00:00:00 2001 From: Matt Raykowski Date: Wed, 9 Jun 2010 07:18:33 -0500 Subject: [PATCH] Changed: #842 panolpy_maker finds libsquish, OpenAL driver finds EFX-Util on Windows. --- code/nel/CMakeModules/FindEFXUtil.cmake | 50 ++++++++++++++++++ code/nel/CMakeModules/FindSquish.cmake | 51 +++++++++++++++++++ .../src/sound/driver/openal/CMakeLists.txt | 5 ++ .../nel/tools/3d/panoply_maker/CMakeLists.txt | 6 ++- 4 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 code/nel/CMakeModules/FindEFXUtil.cmake create mode 100644 code/nel/CMakeModules/FindSquish.cmake diff --git a/code/nel/CMakeModules/FindEFXUtil.cmake b/code/nel/CMakeModules/FindEFXUtil.cmake new file mode 100644 index 000000000..5e2f410b0 --- /dev/null +++ b/code/nel/CMakeModules/FindEFXUtil.cmake @@ -0,0 +1,50 @@ +# - Locate EFX-Util library +# This module defines +# EFXUTIL_LIBRARY, the library to link against +# EFXUTIL_FOUND, if false, do not try to link to EFX-Util +# EFXUTIL_INCLUDE_DIR, where to find headers. + +IF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR) + # in cache already + SET(EFXUTIL_FIND_QUIETLY TRUE) +ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR) + + +FIND_PATH(EFXUTIL_INCLUDE_DIR + EFX-Util.h + PATHS + $ENV{EFXUTIL_DIR}/include + /usr/local/include + /usr/include + /sw/include + /opt/local/include + /opt/csw/include + /opt/include + PATH_SUFFIXES AL +) + +FIND_LIBRARY(EFXUTIL_LIBRARY + NAMES EFX-Util efxutil libefxutil + PATHS + $ENV{EFXUTIL_DIR}/lib + /usr/local/lib + /usr/lib + /usr/local/X11R6/lib + /usr/X11R6/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + +IF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR) + SET(EFXUTIL_FOUND "YES") + IF(NOT EFXUTIL_FIND_QUIETLY) + MESSAGE(STATUS "Found EFX-Util: ${EFXUTIL_LIBRARY}") + ENDIF(NOT EFXUTIL_FIND_QUIETLY) +ELSE(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR) + IF(NOT EFXUTIL_FIND_QUIETLY) + MESSAGE(STATUS "Warning: Unable to find EFX-Util!") + ENDIF(NOT EFXUTIL_FIND_QUIETLY) +ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR) diff --git a/code/nel/CMakeModules/FindSquish.cmake b/code/nel/CMakeModules/FindSquish.cmake new file mode 100644 index 000000000..2fcbc1a1a --- /dev/null +++ b/code/nel/CMakeModules/FindSquish.cmake @@ -0,0 +1,51 @@ +# +# Find the LibSquish includes and library +# +# This module defines +# SQUISH_INCLUDE_DIR, where to find squish.h +# SQUISH_LIBRARY, where to find the Squish library. +# SQUISH_FOUND, If false, do not try to use Squish. + +# also defined, but not for general use are +IF(SQUISH_LIBRARY AND SQUISH_INCLUDE_DIR) + # in cache already + SET(SQUISH_FIND_QUIETLY TRUE) +ENDIF(SQUISH_LIBRARY AND SQUISH_INCLUDE_DIR) + +FIND_PATH(SQUISH_INCLUDE_DIR + squish.h + PATHS + /usr/local/include + /usr/include + /sw/include + /opt/local/include + /opt/csw/include + /opt/include + PATH_SUFFIXES cppunit +) + +FIND_LIBRARY(SQUISH_LIBRARY + squish + PATHS + /usr/local/lib + /usr/lib + /usr/local/X11R6/lib + /usr/X11R6/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + +IF(SQUISH_LIBRARY AND SQUISH_INCLUDE_DIR) + SET(SQUISH_FOUND "YES") + IF(NOT SQUISH_FIND_QUIETLY) + MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARY}") + ENDIF(NOT SQUISH_FIND_QUIETLY) +ELSE(SQUISH_LIBRARY AND SQUISH_INCLUDE_DIR) + IF(NOT SQUISH_FIND_QUIETLY) + MESSAGE(STATUS "Warning: Unable to find Squish!") + ENDIF(NOT SQUISH_FIND_QUIETLY) +ENDIF(SQUISH_LIBRARY AND SQUISH_INCLUDE_DIR) + diff --git a/code/nel/src/sound/driver/openal/CMakeLists.txt b/code/nel/src/sound/driver/openal/CMakeLists.txt index edc428acc..7dbacd820 100644 --- a/code/nel/src/sound/driver/openal/CMakeLists.txt +++ b/code/nel/src/sound/driver/openal/CMakeLists.txt @@ -8,6 +8,11 @@ SET_TARGET_PROPERTIES(nel_drv_openal PROPERTIES VERSION ${NL_VERSION}) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) IF(WIN32) + # Find and include EFX-Util on Windows. + FIND_PACKAGE(EFXUtil) + INCLUDE_DIRECTORIES(${EFXUTIL_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(nel_drv_openal ${EFXUTIL_LIBRARY}) + SET_TARGET_PROPERTIES(nel_drv_openal PROPERTIES COMPILE_FLAGS "/Yustdopenal.h") SET_SOURCE_FILES_PROPERTIES(stdopenal.cpp PROPERTIES COMPILE_FLAGS "/Ycstdopenal.h") SET_TARGET_PROPERTIES(nel_drv_openal PROPERTIES diff --git a/code/nel/tools/3d/panoply_maker/CMakeLists.txt b/code/nel/tools/3d/panoply_maker/CMakeLists.txt index 8bdc5fea8..62b644c86 100644 --- a/code/nel/tools/3d/panoply_maker/CMakeLists.txt +++ b/code/nel/tools/3d/panoply_maker/CMakeLists.txt @@ -2,8 +2,10 @@ FILE(GLOB SRC *.cpp *.h ../s3tc_compressor_lib/*.h ../s3tc_compressor_lib/*.cpp) ADD_EXECUTABLE(panoply_maker ${SRC}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${S3TC_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(panoply_maker ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${S3TC_LIBRARY} nelmisc nel3d) +FIND_PACKAGE(Squish REQUIRED) + +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${SQUISH_INCLUDE_DIR}) +TARGET_LINK_LIBRARIES(panoply_maker ${LIBXML2_LIBRARIES} ${PLATFORM_LINKFLAGS} ${SQUISH_LIBRARY} nelmisc nel3d) IF(WIN32) SET_TARGET_PROPERTIES(panoply_maker PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libcmt /NODEFAULTLIB:libc"