From 57f01776ef5c5967f0c270e98be3c92cec21ee4a Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 8 Nov 2010 02:51:31 +0000 Subject: [PATCH] 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 --- CMakeLists.txt | 17 +++++++++-------- Externals/WiiUse/CMakeLists.txt | 4 +++- Source/Plugins/Plugin_VideoOGL/CMakeLists.txt | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be0c8bbbc8..917008c013 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,7 @@ if(BLUEZ_FOUND) message("bluez found, enabling bluetooth support") else() add_definitions(-DHAVE_BLUEZ=0) - message("bluez NOT found, enabling bluetooth support") + message("bluez NOT found, disabling bluetooth support") endif(BLUEZ_FOUND) include_directories(${OPENGL_INCLUDE_DIR}) @@ -185,13 +185,14 @@ else() message("Xrandr NOT found") endif(XRANDR_FOUND) -find_library(PORTAUDIO portaudio) +include(CheckCXXSourceRuns) +set(CMAKE_REQUIRED_LIBRARIES portaudio) +CHECK_CXX_SOURCE_RUNS( + "#include + int main(int argc, char **argv) + { if(Pa_GetVersion() >= 1890) return 0; else return 1; }" + PORTAUDIO) if(PORTAUDIO) - include(CheckFunctionExists) - set(CMAKE_REQUIRED_LIBRARIES portaudio) - CHECK_FUNCTION_EXISTS(Pa_GetVersion PORTAUDIO_VERSION_CHECK) -endif(PORTAUDIO) -if(PORTAUDIO AND PORTAUDIO_VERSION_CHECK) message("PortAudio found, enabling mic support") add_definitions(-DHAVE_PORTAUDIO=1) set(PORTAUDIO_FOUND TRUE) @@ -199,7 +200,7 @@ else() message("PortAudio not found, disabling mic support") add_definitions(-DHAVE_PORTAUDIO=0) set(PORTAUDIO_FOUND FALSE) -endif(PORTAUDIO AND PORTAUDIO_VERSION_CHECK) +endif(PORTAUDIO) find_library(OPENCL OpenCL) find_path(OPENCL_INCLUDE CL/cl.h) diff --git a/Externals/WiiUse/CMakeLists.txt b/Externals/WiiUse/CMakeLists.txt index e750d16fe5..78904e3a65 100644 --- a/Externals/WiiUse/CMakeLists.txt +++ b/Externals/WiiUse/CMakeLists.txt @@ -3,11 +3,13 @@ set(SRCS Src/ir.c if(APPLE) set(SRCS ${SRCS} Src/io_osx.m) -elseif(UNIX) +elseif(UNIX AND BLUEZ_FOUND) set(SRCS ${SRCS} Src/io_nix.c) set(LIBS ${LIBS} bluetooth) elseif(WIN32) set(SRCS ${SRCS} Src/io_win.c) +else() + set(SRCS ${SRCS} Src/io_dummy.c) endif() add_library(wiiuse STATIC ${SRCS}) diff --git a/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt b/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt index 58f974952e..7a17836d50 100644 --- a/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt +++ b/Source/Plugins/Plugin_VideoOGL/CMakeLists.txt @@ -27,9 +27,9 @@ if(wxWidgets_FOUND) endif(wxWidgets_FOUND) if(APPLE AND NOT wxWidgets_FOUND) - set(SRCS ${SRCS} cocoaGL.m) + set(SRCS ${SRCS} Src/cocoaGL.m) elseif(WIN32) - set(SRCS ${SRCS} OS/Win32.cpp) + set(SRCS ${SRCS} Src/OS/Win32.cpp) elseif(NOT APPLE AND OPENCL_FOUND) set(LIBS ${LIBS} OpenCL) endif()