mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 07:39:45 -06:00
Added checks for portaudio and opencl to the cmake build system.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6351 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
########################################
|
||||
# General setup
|
||||
#
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
project (dolphin-emu)
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
project(dolphin-emu)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests)
|
||||
|
||||
set(DOLPHIN_IS_STABLE FALSE)
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX} CACHE PATH "prefix")
|
||||
@ -181,6 +182,35 @@ else()
|
||||
message("Xrandr NOT found")
|
||||
endif(XRANDR_FOUND)
|
||||
|
||||
find_library(PORTAUDIO 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)
|
||||
else()
|
||||
message("PortAudio not found, disabling mic support")
|
||||
add_definitions(-DHAVE_PORTAUDIO=0)
|
||||
set(PORTAUDIO_FOUND FALSE)
|
||||
endif(PORTAUDIO AND PORTAUDIO_VERSION_CHECK)
|
||||
|
||||
find_library(OPENCL OpenCL)
|
||||
find_path(OPENCL_INCLUDE CL/cl.h)
|
||||
if(OPENCL AND OPENCL_INCLUDE)
|
||||
message("OpenCL found")
|
||||
add_definitions(-DHAVE_OPENCL=1)
|
||||
include_directories(${OPENCL_INCLUDE})
|
||||
set(OPENCL_FOUND TRUE)
|
||||
else()
|
||||
message("OpenCL not found")
|
||||
add_definitions(-DHAVE_OPENCL=0)
|
||||
set(OPENCL_FOUND FALSE)
|
||||
endif(OPENCL AND OPENCL_INCLUDE)
|
||||
|
||||
|
||||
########################################
|
||||
# Setup include directories (and make sure they are preferred over the Externals)
|
||||
@ -223,7 +253,7 @@ find_library(LZO lzo2)
|
||||
find_path(LZO_INCLUDE lzo/lzo1x.h)
|
||||
if(LZO AND LZO_INCLUDE)
|
||||
message("Using shared lzo")
|
||||
include_directories(LZO_INCLUDE)
|
||||
include_directories(${LZO_INCLUDE})
|
||||
else()
|
||||
message("Shared lzo not found, falling back to the static library")
|
||||
add_subdirectory(Externals/LZO)
|
||||
@ -233,7 +263,7 @@ endif(LZO AND LZO_INCLUDE)
|
||||
include(FindSDL OPTIONAL)
|
||||
if(SDL_FOUND)
|
||||
message("Using shared SDL")
|
||||
include_directories(SDL_INCLUDE_DIR)
|
||||
include_directories(${SDL_INCLUDE_DIR})
|
||||
else(SDL_FOUND)
|
||||
# TODO: No CMakeLists.txt there, yet...
|
||||
message("Shared SDL not found, falling back to the static library")
|
||||
@ -245,7 +275,7 @@ find_library(SFML_NETWORK sfml-network)
|
||||
find_path(SFML_INCLUDE SFML/Network/Ftp.hpp)
|
||||
if(SFML_NETWORK AND SFML_INCLUDE)
|
||||
message("Using shared sfml-network")
|
||||
include_directories(SFML_INCLUDE)
|
||||
include_directories(${SFML_INCLUDE})
|
||||
else()
|
||||
message("Shared sfml-network not found, falling back to the static library")
|
||||
add_subdirectory(Externals/SFML)
|
||||
@ -256,7 +286,7 @@ find_library(SOIL SOIL)
|
||||
find_path(SOIL_INCLUDE SOIL/SOIL.h)
|
||||
if(SOIL AND SOIL_INCLUDE)
|
||||
message("Using shared SOIL")
|
||||
include_directories(SOIL_INCLUDE)
|
||||
include_directories(${SOIL_INCLUDE})
|
||||
else()
|
||||
message("Shared SOIL not found, falling back to the static library")
|
||||
add_subdirectory(Externals/SOIL)
|
||||
@ -265,7 +295,7 @@ endif(SOIL AND SOIL_INCLUDE)
|
||||
|
||||
include(FindZLIB OPTIONAL) # TODO: Move to top
|
||||
if(ZLIB_FOUND)
|
||||
include_directories(ZLIB_INCLUDE_DIRS)
|
||||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
else(ZLIB_FOUND)
|
||||
# TODO: No CMakeLists.txt there, yet...
|
||||
add_subdirectory(Externals/zlib)
|
||||
|
Reference in New Issue
Block a user