Files
rtabmap_ros/rtabmap_audio/FindFmodex.cmake
T

54 lines
1.7 KiB
CMake
Raw Normal View History

2012-06-24 17:19:34 +00:00
# - Find Fmodex
# This module finds an installed Fmod package.
#
# It sets the following variables:
# Fmodex_FOUND - Set to false, or undefined, if Fmod isn't found.
# Fmodex_INCLUDE_DIRS - The Fmod include directory.
# Fmodex_LIBRARIES - The Fmod library to link against.
#
#
SET(Fmodex_ROOT)
# Add ROS Fmodex directory if ROS is installed
FIND_PROGRAM(ROSPACK_EXEC NAME rospack PATHS)
IF(ROSPACK_EXEC)
EXECUTE_PROCESS(COMMAND ${ROSPACK_EXEC} find fmodex
OUTPUT_VARIABLE Fmodex_ROS_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY "./"
)
IF(Fmodex_ROS_PATH)
MESSAGE(STATUS "Found Fmodex ROS pkg : ${Fmodex_ROS_PATH}")
SET(Fmodex_ROOT
${Fmodex_ROS_PATH}/fmodex
${Fmodex_ROOT}
)
ENDIF(Fmodex_ROS_PATH)
ENDIF(ROSPACK_EXEC)
2012-06-24 17:19:34 +00:00
FIND_PATH(Fmodex_INCLUDE_DIRS fmod.h PATHS ${Fmodex_ROOT}/include)
2012-06-24 17:19:34 +00:00
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
FIND_LIBRARY(Fmodex_LIBRARIES NAMES fmodex64 PATHS ${Fmodex_ROOT}/lib)
2012-06-24 17:19:34 +00:00
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
IF(NOT Fmodex_LIBRARIES)
FIND_LIBRARY(Fmodex_LIBRARIES NAMES fmodex PATHS ${Fmodex_ROOT}/lib)
ENDIF(NOT Fmodex_LIBRARIES)
2012-06-24 17:19:34 +00:00
IF (Fmodex_INCLUDE_DIRS AND Fmodex_LIBRARIES)
SET(Fmodex_FOUND TRUE)
ENDIF (Fmodex_INCLUDE_DIRS AND Fmodex_LIBRARIES)
IF (Fmodex_FOUND)
# show which Fmod was found only if not quiet
IF (NOT Fmodex_FIND_QUIETLY)
MESSAGE(STATUS "Found Fmod: ${Fmodex_LIBRARIES}")
ENDIF (NOT Fmodex_FIND_QUIETLY)
ELSE (Fmodex_FOUND)
# fatal error if Fmod is required but not found
IF (Fmodex_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Fmodex... (aka libfmodex)")
2012-06-24 17:19:34 +00:00
ENDIF (Fmodex_FIND_REQUIRED)
ENDIF (Fmodex_FOUND)