Fix cmake so it is possible to build without bluetooth support, and the typo that tells you bluetooth is enabled when it is not.

Fixes issue 3464.
Also make the check for portaudio really check the version of portaudio.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6359 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2010-11-08 02:51:31 +00:00
parent 2e0274dd1f
commit 57f01776ef
3 changed files with 14 additions and 11 deletions

View File

@ -125,7 +125,7 @@ if(BLUEZ_FOUND)
message("bluez found, enabling bluetooth support") message("bluez found, enabling bluetooth support")
else() else()
add_definitions(-DHAVE_BLUEZ=0) add_definitions(-DHAVE_BLUEZ=0)
message("bluez NOT found, enabling bluetooth support") message("bluez NOT found, disabling bluetooth support")
endif(BLUEZ_FOUND) endif(BLUEZ_FOUND)
include_directories(${OPENGL_INCLUDE_DIR}) include_directories(${OPENGL_INCLUDE_DIR})
@ -185,13 +185,14 @@ else()
message("Xrandr NOT found") message("Xrandr NOT found")
endif(XRANDR_FOUND) endif(XRANDR_FOUND)
find_library(PORTAUDIO portaudio) include(CheckCXXSourceRuns)
if(PORTAUDIO)
include(CheckFunctionExists)
set(CMAKE_REQUIRED_LIBRARIES portaudio) set(CMAKE_REQUIRED_LIBRARIES portaudio)
CHECK_FUNCTION_EXISTS(Pa_GetVersion PORTAUDIO_VERSION_CHECK) CHECK_CXX_SOURCE_RUNS(
endif(PORTAUDIO) "#include <portaudio.h>
if(PORTAUDIO AND PORTAUDIO_VERSION_CHECK) int main(int argc, char **argv)
{ if(Pa_GetVersion() >= 1890) return 0; else return 1; }"
PORTAUDIO)
if(PORTAUDIO)
message("PortAudio found, enabling mic support") message("PortAudio found, enabling mic support")
add_definitions(-DHAVE_PORTAUDIO=1) add_definitions(-DHAVE_PORTAUDIO=1)
set(PORTAUDIO_FOUND TRUE) set(PORTAUDIO_FOUND TRUE)
@ -199,7 +200,7 @@ else()
message("PortAudio not found, disabling mic support") message("PortAudio not found, disabling mic support")
add_definitions(-DHAVE_PORTAUDIO=0) add_definitions(-DHAVE_PORTAUDIO=0)
set(PORTAUDIO_FOUND FALSE) set(PORTAUDIO_FOUND FALSE)
endif(PORTAUDIO AND PORTAUDIO_VERSION_CHECK) endif(PORTAUDIO)
find_library(OPENCL OpenCL) find_library(OPENCL OpenCL)
find_path(OPENCL_INCLUDE CL/cl.h) find_path(OPENCL_INCLUDE CL/cl.h)

View File

@ -3,11 +3,13 @@ set(SRCS Src/ir.c
if(APPLE) if(APPLE)
set(SRCS ${SRCS} Src/io_osx.m) set(SRCS ${SRCS} Src/io_osx.m)
elseif(UNIX) elseif(UNIX AND BLUEZ_FOUND)
set(SRCS ${SRCS} Src/io_nix.c) set(SRCS ${SRCS} Src/io_nix.c)
set(LIBS ${LIBS} bluetooth) set(LIBS ${LIBS} bluetooth)
elseif(WIN32) elseif(WIN32)
set(SRCS ${SRCS} Src/io_win.c) set(SRCS ${SRCS} Src/io_win.c)
else()
set(SRCS ${SRCS} Src/io_dummy.c)
endif() endif()
add_library(wiiuse STATIC ${SRCS}) add_library(wiiuse STATIC ${SRCS})

View File

@ -27,9 +27,9 @@ if(wxWidgets_FOUND)
endif(wxWidgets_FOUND) endif(wxWidgets_FOUND)
if(APPLE AND NOT wxWidgets_FOUND) if(APPLE AND NOT wxWidgets_FOUND)
set(SRCS ${SRCS} cocoaGL.m) set(SRCS ${SRCS} Src/cocoaGL.m)
elseif(WIN32) elseif(WIN32)
set(SRCS ${SRCS} OS/Win32.cpp) set(SRCS ${SRCS} Src/OS/Win32.cpp)
elseif(NOT APPLE AND OPENCL_FOUND) elseif(NOT APPLE AND OPENCL_FOUND)
set(LIBS ${LIBS} OpenCL) set(LIBS ${LIBS} OpenCL)
endif() endif()