summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTechwolf Lupindo <bitbucket.org@trap.wereanimal.net>2010-10-12 00:48:27 -0400
committerTechwolf Lupindo <bitbucket.org@trap.wereanimal.net>2010-10-12 00:48:27 -0400
commit54065ab2f9262cac67a5a3d00aed3f6348383bfc (patch)
treed4c934ad2c214777f7fe2348d9c5223fba6de312 /indra
parent83b5bf11e3e13d74304f3856627d931b69bdb477 (diff)
Clean up and rework FMOD.cmake and FindFMOD.cmake
FMOD.cmake: Move include(Prebuilt) to prebuilt section. It is only used for prebuilt anyway. set(FMOD_FIND_REQUIRED ON) due to FMOD variable is use elsewhere in cmake files. This behaviour is the same as openal. Remove redudent error messages and code due to above. Rework the logic to be more cleaner. Clean up whitespace. FindFMOD.cmake Remove redudent paths as cmake allready uses them as default. Use PATH_SUFFIXES instead. The above will result in cmake looking in a lot more places and can handle custom build setups better. Change FMOD to FMOD_FOUND. FMOD should not be change withen cmake. Whitespace cleanup.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/cmake/FMOD.cmake51
-rwxr-xr-xindra/cmake/FindFMOD.cmake37
2 files changed, 34 insertions, 54 deletions
diff --git a/indra/cmake/FMOD.cmake b/indra/cmake/FMOD.cmake
index 4582017bcb..96434e38fa 100755
--- a/indra/cmake/FMOD.cmake
+++ b/indra/cmake/FMOD.cmake
@@ -1,37 +1,24 @@
# -*- cmake -*-
-include(Prebuilt)
-set(FMOD_FIND_QUIETLY OFF)
-set(FMOD_FIND_REQUIRED OFF)
-
-if (STANDALONE)
- include(FindFMOD)
-else (STANDALONE)
- use_prebuilt_binary(fmod)
-
- if (WINDOWS)
- set(FMOD_LIBRARY fmod)
- elseif (DARWIN)
- set(FMOD_LIBRARY fmod)
- elseif (LINUX)
- set(FMOD_LIBRARY fmod-3.75)
- endif (WINDOWS)
- SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
-
- set(FMOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
-endif (STANDALONE)
-
-if (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
- set(FMOD ON CACHE BOOL "Use FMOD sound library.")
-else (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
- set(FMOD_LIBRARY "")
- set(FMOD_INCLUDE_DIR "")
- if (FMOD)
- message(STATUS "No support for FMOD audio found.")
- endif (FMOD)
- set(FMOD OFF CACHE BOOL "FMOD sound library not used.")
-endif (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
+set(FMOD ON CACHE BOOL "Use FMOD sound library.")
if (FMOD)
- message(STATUS "Building with FMOD audio support")
+ if (STANDALONE)
+ set(FMOD_FIND_REQUIRED ON)
+ include(FindFMOD)
+ else (STANDALONE)
+ include(Prebuilt)
+ use_prebuilt_binary(fmod)
+
+ if (WINDOWS)
+ set(FMOD_LIBRARY fmod)
+ elseif (DARWIN)
+ set(FMOD_LIBRARY fmod)
+ elseif (LINUX)
+ set(FMOD_LIBRARY fmod-3.75)
+ endif (WINDOWS)
+
+ SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
+ set(FMOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
+ endif (STANDALONE)
endif (FMOD)
diff --git a/indra/cmake/FindFMOD.cmake b/indra/cmake/FindFMOD.cmake
index 3659e97e61..c49c7537d8 100755
--- a/indra/cmake/FindFMOD.cmake
+++ b/indra/cmake/FindFMOD.cmake
@@ -9,36 +9,29 @@
# also defined, but not for general use are
# FMOD_LIBRARY, where to find the FMOD library.
-FIND_PATH(FMOD_INCLUDE_DIR fmod.h
-/usr/local/include/fmod
-/usr/local/include
-/usr/include/fmod
-/usr/include
-)
+FIND_PATH(FMOD_INCLUDE_DIR fmod.h PATH_SUFFIXES fmod)
-SET(FMOD_NAMES ${FMOD_NAMES} fmod fmodvc fmod-3.75)
FIND_LIBRARY(FMOD_LIBRARY
- NAMES ${FMOD_NAMES}
- PATHS /usr/lib /usr/local/lib
+ NAMES fmod fmodvc fmod-3.75
+ PATH_SUFFIXES fmod
)
IF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
- SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
- SET(FMOD "YES")
+ SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
+ SET(FMOD_FOUND "YES")
ELSE (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
- SET(FMOD "NO")
+ SET(FMOD_FOUND "NO")
ENDIF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
-
-IF (FMOD)
- IF (NOT FMOD_FIND_QUIETLY)
- MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARIES}")
- ENDIF (NOT FMOD_FIND_QUIETLY)
-ELSE (FMOD)
- IF (FMOD_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Could not find FMOD library")
- ENDIF (FMOD_FIND_REQUIRED)
-ENDIF (FMOD)
+IF (FMOD_FOUND)
+ IF (NOT FMOD_FIND_QUIETLY)
+ MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARIES}")
+ ENDIF (NOT FMOD_FIND_QUIETLY)
+ELSE (FMOD_FOUND)
+ IF (FMOD_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find FMOD library")
+ ENDIF (FMOD_FIND_REQUIRED)
+ENDIF (FMOD_FOUND)
# Deprecated declarations.
SET (NATIVE_FMOD_INCLUDE_PATH ${FMOD_INCLUDE_DIR} )