Skip to content
Snippets Groups Projects
Commit 54065ab2 authored by Techwolf Lupindo's avatar Techwolf Lupindo
Browse files

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.
parent 83b5bf11
No related branches found
No related tags found
No related merge requests found
# -*- cmake -*- # -*- cmake -*-
include(Prebuilt)
set(FMOD_FIND_QUIETLY OFF) set(FMOD ON CACHE BOOL "Use FMOD sound library.")
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)
if (FMOD) 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) endif (FMOD)
...@@ -9,36 +9,29 @@ ...@@ -9,36 +9,29 @@
# also defined, but not for general use are # also defined, but not for general use are
# FMOD_LIBRARY, where to find the FMOD library. # FMOD_LIBRARY, where to find the FMOD library.
FIND_PATH(FMOD_INCLUDE_DIR fmod.h FIND_PATH(FMOD_INCLUDE_DIR fmod.h PATH_SUFFIXES fmod)
/usr/local/include/fmod
/usr/local/include
/usr/include/fmod
/usr/include
)
SET(FMOD_NAMES ${FMOD_NAMES} fmod fmodvc fmod-3.75)
FIND_LIBRARY(FMOD_LIBRARY FIND_LIBRARY(FMOD_LIBRARY
NAMES ${FMOD_NAMES} NAMES fmod fmodvc fmod-3.75
PATHS /usr/lib /usr/local/lib PATH_SUFFIXES fmod
) )
IF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR) IF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
SET(FMOD_LIBRARIES ${FMOD_LIBRARY}) SET(FMOD_LIBRARIES ${FMOD_LIBRARY})
SET(FMOD "YES") SET(FMOD_FOUND "YES")
ELSE (FMOD_LIBRARY AND FMOD_INCLUDE_DIR) ELSE (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
SET(FMOD "NO") SET(FMOD_FOUND "NO")
ENDIF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR) ENDIF (FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
IF (FMOD_FOUND)
IF (FMOD) IF (NOT FMOD_FIND_QUIETLY)
IF (NOT FMOD_FIND_QUIETLY) MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARIES}")
MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARIES}") ENDIF (NOT FMOD_FIND_QUIETLY)
ENDIF (NOT FMOD_FIND_QUIETLY) ELSE (FMOD_FOUND)
ELSE (FMOD) IF (FMOD_FIND_REQUIRED)
IF (FMOD_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find FMOD library")
MESSAGE(FATAL_ERROR "Could not find FMOD library") ENDIF (FMOD_FIND_REQUIRED)
ENDIF (FMOD_FIND_REQUIRED) ENDIF (FMOD_FOUND)
ENDIF (FMOD)
# Deprecated declarations. # Deprecated declarations.
SET (NATIVE_FMOD_INCLUDE_PATH ${FMOD_INCLUDE_DIR} ) SET (NATIVE_FMOD_INCLUDE_PATH ${FMOD_INCLUDE_DIR} )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment