|
|
|
@ -111,6 +111,12 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
|
add_definitions(-D_FILE_OFFSET_BITS=64)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(CMAKE_SYSROOT)
|
|
|
|
|
# If we should use a sysroot, tell pkg-config to search for packages in there, not on the host
|
|
|
|
|
set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_SYSROOT}/usr/lib/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig")
|
|
|
|
|
set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CMAKE_SYSROOT}")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# Set where the binary files will be built. The program will not execute from
|
|
|
|
|
# here. You must run "make install" to install these to the proper location
|
|
|
|
|
# as defined above.
|
|
|
|
@ -144,8 +150,11 @@ function(enable_precompiled_headers PRECOMPILED_HEADER SOURCE_FILE SOURCE_VARIAB
|
|
|
|
|
endif(MSVC)
|
|
|
|
|
endfunction(enable_precompiled_headers)
|
|
|
|
|
|
|
|
|
|
# setup CCache
|
|
|
|
|
include(CCache)
|
|
|
|
|
|
|
|
|
|
# for revision info
|
|
|
|
|
include(FindGit OPTIONAL)
|
|
|
|
|
find_package(Git)
|
|
|
|
|
if(GIT_FOUND AND NOT DOLPHIN_WC_REVISION)
|
|
|
|
|
# defines DOLPHIN_WC_REVISION
|
|
|
|
|
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
|
|
|
@ -183,7 +192,7 @@ if(NOT DOLPHIN_WC_REVISION)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# Architecture detection and arch specific settings
|
|
|
|
|
message(${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
|
message(STATUS "Detected architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
|
|
|
|
|
|
|
|
|
# Detect 64bit or 32bit
|
|
|
|
|
# CMake doesn't provide a simple way to determine 32bit or 64bit
|
|
|
|
@ -199,7 +208,7 @@ endif()
|
|
|
|
|
|
|
|
|
|
include(CheckCCompilerFlag)
|
|
|
|
|
if(ENABLE_GENERIC)
|
|
|
|
|
message("Warning! Building generic build!")
|
|
|
|
|
message(STATUS "Warning! Building generic build!")
|
|
|
|
|
set(_M_GENERIC 1)
|
|
|
|
|
add_definitions(-D_M_GENERIC=1)
|
|
|
|
|
elseif(_ARCH_64 AND (
|
|
|
|
@ -363,12 +372,6 @@ endif(UNIX)
|
|
|
|
|
# changes, so just setting them in the project scope via
|
|
|
|
|
# include_directories and link_directories is not sufficient
|
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD")
|
|
|
|
|
# CMake before 3.2 does not respect CMAKE_EXE_LINKER_FLAGS in
|
|
|
|
|
# try_compile, which can cause our compilation check functions
|
|
|
|
|
# to spuriously fail
|
|
|
|
|
if(POLICY CMP0056)
|
|
|
|
|
cmake_policy(SET CMP0056 NEW)
|
|
|
|
|
endif()
|
|
|
|
|
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};/usr/local")
|
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "/usr/local/include")
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")
|
|
|
|
@ -428,7 +431,7 @@ if(VTUNE)
|
|
|
|
|
endif(VTUNE)
|
|
|
|
|
|
|
|
|
|
if(ANDROID)
|
|
|
|
|
message("Building for Android")
|
|
|
|
|
message(STATUS "Building for Android")
|
|
|
|
|
if(NOT ENABLE_HEADLESS)
|
|
|
|
|
add_definitions(-DANDROID)
|
|
|
|
|
else()
|
|
|
|
@ -445,14 +448,14 @@ if(ANDROID)
|
|
|
|
|
# We are cross compiling, search only the toolchain for libraries and includes
|
|
|
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
|
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
|
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
|
|
|
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
|
|
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|
|
|
|
elseif(NOT APPLE AND NOT CMAKE_SYSTEM_NAME MATCHES OpenBSD)
|
|
|
|
|
list(APPEND LIBS rt)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_HEADLESS)
|
|
|
|
|
message("Enabling Headless! Disabling GUI, force enabling EGL!")
|
|
|
|
|
message(STATUS "Enabling Headless! Disabling GUI, force enabling EGL!")
|
|
|
|
|
set(USE_X11 0)
|
|
|
|
|
set(USE_EGL 1)
|
|
|
|
|
set(DISABLE_WX 1)
|
|
|
|
@ -471,79 +474,79 @@ add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE)
|
|
|
|
|
include(CheckLib)
|
|
|
|
|
include(CheckCXXSourceRuns)
|
|
|
|
|
|
|
|
|
|
include(FindOpenGL)
|
|
|
|
|
find_package(OpenGL)
|
|
|
|
|
if (OPENGL_GL)
|
|
|
|
|
include_directories(${OPENGL_INCLUDE_DIR})
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_ALSA)
|
|
|
|
|
include(FindALSA OPTIONAL)
|
|
|
|
|
find_package(ALSA)
|
|
|
|
|
if(ALSA_FOUND)
|
|
|
|
|
add_definitions(-DHAVE_ALSA=1)
|
|
|
|
|
message("ALSA found, enabling ALSA sound backend")
|
|
|
|
|
message(STATUS "ALSA found, enabling ALSA sound backend")
|
|
|
|
|
else()
|
|
|
|
|
add_definitions(-DHAVE_ALSA=0)
|
|
|
|
|
message("ALSA NOT found, disabling ALSA sound backend")
|
|
|
|
|
message(STATUS "ALSA NOT found, disabling ALSA sound backend")
|
|
|
|
|
endif()
|
|
|
|
|
else()
|
|
|
|
|
message("ALSA explicitly disabled, disabling ALSA sound backend")
|
|
|
|
|
message(STATUS "ALSA explicitly disabled, disabling ALSA sound backend")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_AO)
|
|
|
|
|
check_lib(AO ao ao QUIET)
|
|
|
|
|
if(AO_FOUND)
|
|
|
|
|
add_definitions(-DHAVE_AO=1)
|
|
|
|
|
message("ao found, enabling ao sound backend")
|
|
|
|
|
message(STATUS "ao found, enabling ao sound backend")
|
|
|
|
|
else()
|
|
|
|
|
add_definitions(-DHAVE_AO=0)
|
|
|
|
|
message("ao NOT found, disabling ao sound backend")
|
|
|
|
|
message(STATUS "ao NOT found, disabling ao sound backend")
|
|
|
|
|
endif()
|
|
|
|
|
else()
|
|
|
|
|
message("ao explicitly disabled, disabling ao sound backend")
|
|
|
|
|
message(STATUS "ao explicitly disabled, disabling ao sound backend")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_BLUEZ)
|
|
|
|
|
check_lib(BLUEZ bluez bluez QUIET)
|
|
|
|
|
if(BLUEZ_FOUND)
|
|
|
|
|
add_definitions(-DHAVE_BLUEZ=1)
|
|
|
|
|
message("bluez found, enabling bluetooth support")
|
|
|
|
|
message(STATUS "bluez found, enabling bluetooth support")
|
|
|
|
|
else()
|
|
|
|
|
add_definitions(-DHAVE_BLUEZ=0)
|
|
|
|
|
message("bluez NOT found, disabling bluetooth support")
|
|
|
|
|
message(STATUS "bluez NOT found, disabling bluetooth support")
|
|
|
|
|
endif()
|
|
|
|
|
else()
|
|
|
|
|
message("bluez explicitly disabled, disabling bluetooth support")
|
|
|
|
|
message(STATUS "bluez explicitly disabled, disabling bluetooth support")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_PULSEAUDIO)
|
|
|
|
|
check_lib(PULSEAUDIO libpulse pulse QUIET)
|
|
|
|
|
if(PULSEAUDIO_FOUND)
|
|
|
|
|
add_definitions(-DHAVE_PULSEAUDIO=1)
|
|
|
|
|
message("PulseAudio found, enabling PulseAudio sound backend")
|
|
|
|
|
message(STATUS "PulseAudio found, enabling PulseAudio sound backend")
|
|
|
|
|
else()
|
|
|
|
|
add_definitions(-DHAVE_PULSEAUDIO=0)
|
|
|
|
|
message("PulseAudio NOT found, disabling PulseAudio sound backend")
|
|
|
|
|
message(STATUS "PulseAudio NOT found, disabling PulseAudio sound backend")
|
|
|
|
|
endif()
|
|
|
|
|
else()
|
|
|
|
|
message("PulseAudio explicitly disabled, disabling PulseAudio sound backend")
|
|
|
|
|
message(STATUS "PulseAudio explicitly disabled, disabling PulseAudio sound backend")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_OPENAL)
|
|
|
|
|
include(FindOpenAL OPTIONAL)
|
|
|
|
|
find_package(OpenAL)
|
|
|
|
|
if(OPENAL_FOUND)
|
|
|
|
|
add_definitions(-DHAVE_OPENAL=1)
|
|
|
|
|
include_directories(${OPENAL_INCLUDE_DIR})
|
|
|
|
|
message("OpenAL found, enabling OpenAL sound backend")
|
|
|
|
|
message(STATUS "OpenAL found, enabling OpenAL sound backend")
|
|
|
|
|
else()
|
|
|
|
|
add_definitions(-DHAVE_OPENAL=0)
|
|
|
|
|
message("OpenAL NOT found, disabling OpenAL sound backend")
|
|
|
|
|
message(STATUS "OpenAL NOT found, disabling OpenAL sound backend")
|
|
|
|
|
endif()
|
|
|
|
|
else()
|
|
|
|
|
message("OpenAL explicitly disabled, disabling OpenAL sound backend")
|
|
|
|
|
message(STATUS "OpenAL explicitly disabled, disabling OpenAL sound backend")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_LLVM)
|
|
|
|
|
include(FindLLVM OPTIONAL)
|
|
|
|
|
find_package(LLVM)
|
|
|
|
|
if (LLVM_FOUND)
|
|
|
|
|
add_definitions(-DHAS_LLVM=1)
|
|
|
|
|
set(HAS_LLVM 1)
|
|
|
|
@ -558,16 +561,16 @@ endif()
|
|
|
|
|
set(USE_X11 0)
|
|
|
|
|
|
|
|
|
|
if(UNIX AND NOT APPLE AND NOT ANDROID AND NOT ENABLE_HEADLESS)
|
|
|
|
|
include(FindX11)
|
|
|
|
|
find_package(X11)
|
|
|
|
|
if(TRY_X11 AND X11_FOUND)
|
|
|
|
|
set(USE_X11 1)
|
|
|
|
|
add_definitions(-DHAVE_X11=1)
|
|
|
|
|
include_directories(${X11_INCLUDE_DIR})
|
|
|
|
|
message("X11 support enabled")
|
|
|
|
|
message(STATUS "X11 support enabled")
|
|
|
|
|
else()
|
|
|
|
|
set(USE_X11 0)
|
|
|
|
|
SET(X11_FOUND "")
|
|
|
|
|
message("X11 support disabled")
|
|
|
|
|
message(STATUS "X11 support disabled")
|
|
|
|
|
add_definitions(-DHAVE_X11=0)
|
|
|
|
|
endif(TRY_X11 AND X11_FOUND)
|
|
|
|
|
|
|
|
|
@ -610,19 +613,19 @@ if(NOT ANDROID)
|
|
|
|
|
unset(CMAKE_REQUIRED_LIBRARIES)
|
|
|
|
|
endif()
|
|
|
|
|
if(SYSTEM_PORTAUDIO AND NOT APPLE)
|
|
|
|
|
message("Using shared PortAudio for mic support")
|
|
|
|
|
message(STATUS "Using shared PortAudio for mic support")
|
|
|
|
|
set(PORTAUDIO_LIBRARIES portaudio)
|
|
|
|
|
else()
|
|
|
|
|
message("Using static PortAudio from Externals for mic support")
|
|
|
|
|
message(STATUS "Using static PortAudio from Externals for mic support")
|
|
|
|
|
add_subdirectory(Externals/portaudio)
|
|
|
|
|
set(PORTAUDIO_LIBRARIES portaudio_static)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(OPROFILING)
|
|
|
|
|
include(FindOProfile)
|
|
|
|
|
find_package(OProfile)
|
|
|
|
|
if(OPROFILE_FOUND)
|
|
|
|
|
message("OProfile found, enabling profiling support")
|
|
|
|
|
message(STATUS "OProfile found, enabling profiling support")
|
|
|
|
|
add_definitions(-DUSE_OPROFILE=1)
|
|
|
|
|
include_directories(${OPROFILE_INCLUDE_DIRS})
|
|
|
|
|
else()
|
|
|
|
@ -631,15 +634,15 @@ if(OPROFILING)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(USE_EGL)
|
|
|
|
|
message("EGL OpenGL interface enabled")
|
|
|
|
|
message(STATUS "EGL OpenGL interface enabled")
|
|
|
|
|
add_definitions(-DUSE_EGL=1)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_EVDEV)
|
|
|
|
|
include(FindLibudev REQUIRED)
|
|
|
|
|
include(FindLibevdev REQUIRED)
|
|
|
|
|
find_package(Libudev REQUIRED)
|
|
|
|
|
find_package(Libevdev REQUIRED)
|
|
|
|
|
if(LIBUDEV_FOUND AND LIBEVDEV_FOUND)
|
|
|
|
|
message("libevdev/libudev found, enabling evdev controller backend")
|
|
|
|
|
message(STATUS "libevdev/libudev found, enabling evdev controller backend")
|
|
|
|
|
add_definitions(-DHAVE_LIBUDEV=1)
|
|
|
|
|
add_definitions(-DHAVE_LIBEVDEV=1)
|
|
|
|
|
include_directories(${LIBUDEV_INCLUDE_DIR} ${LIBEVDEV_INCLUDE_DIR})
|
|
|
|
@ -649,14 +652,14 @@ if(ENABLE_EVDEV)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(UNIX)
|
|
|
|
|
message("Using named pipes as controller inputs")
|
|
|
|
|
message(STATUS "Using named pipes as controller inputs")
|
|
|
|
|
add_definitions(-DUSE_PIPES=1)
|
|
|
|
|
message("Watching game memory for changes")
|
|
|
|
|
message(STATUS "Watching game memory for changes")
|
|
|
|
|
add_definitions(-DUSE_MEMORYWATCHER=1)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_ANALYTICS)
|
|
|
|
|
message("Enabling analytics collection (subject to end-user opt-in)")
|
|
|
|
|
message(STATUS "Enabling analytics collection (subject to end-user opt-in)")
|
|
|
|
|
add_definitions(-DUSE_ANALYTICS=1)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
@ -703,32 +706,27 @@ if(USE_SHARED_ENET)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
if (ENET_FOUND)
|
|
|
|
|
message("Using shared enet")
|
|
|
|
|
message(STATUS "Using shared enet")
|
|
|
|
|
else()
|
|
|
|
|
message("Using static enet from Externals")
|
|
|
|
|
message(STATUS "Using static enet from Externals")
|
|
|
|
|
include_directories(Externals/enet/include)
|
|
|
|
|
add_subdirectory(Externals/enet)
|
|
|
|
|
endif()
|
|
|
|
|
LIST(APPEND LIBS enet)
|
|
|
|
|
|
|
|
|
|
if(NOT XXHASH_FOUND)
|
|
|
|
|
message("Using static xxhash from Externals")
|
|
|
|
|
message(STATUS "Using static xxhash from Externals")
|
|
|
|
|
add_subdirectory(Externals/xxhash)
|
|
|
|
|
include_directories(Externals/xxhash)
|
|
|
|
|
endif()
|
|
|
|
|
LIST(APPEND LIBS xxhash)
|
|
|
|
|
|
|
|
|
|
# If zlib has already been found on a previous run of cmake don't check again
|
|
|
|
|
# as the check seems to take a long time.
|
|
|
|
|
if(NOT ZLIB_FOUND)
|
|
|
|
|
include(FindZLIB OPTIONAL)
|
|
|
|
|
endif()
|
|
|
|
|
find_package(ZLIB)
|
|
|
|
|
if(ZLIB_FOUND)
|
|
|
|
|
set(ZLIB_FOUND 1 CACHE INTERNAL "")
|
|
|
|
|
message("Using shared zlib")
|
|
|
|
|
message(STATUS "Using shared zlib")
|
|
|
|
|
include_directories(${ZLIB_INCLUDE_DIRS})
|
|
|
|
|
else(ZLIB_FOUND)
|
|
|
|
|
message("Shared zlib not found, falling back to the static library")
|
|
|
|
|
message(STATUS "Shared zlib not found, falling back to the static library")
|
|
|
|
|
add_subdirectory(Externals/zlib)
|
|
|
|
|
include_directories(Externals/zlib)
|
|
|
|
|
endif(ZLIB_FOUND)
|
|
|
|
@ -737,9 +735,9 @@ if(NOT APPLE)
|
|
|
|
|
check_lib(LZO "(no .pc for lzo2)" lzo2 lzo/lzo1x.h QUIET)
|
|
|
|
|
endif()
|
|
|
|
|
if(LZO_FOUND)
|
|
|
|
|
message("Using shared lzo")
|
|
|
|
|
message(STATUS "Using shared lzo")
|
|
|
|
|
else()
|
|
|
|
|
message("Using static lzo from Externals")
|
|
|
|
|
message(STATUS "Using static lzo from Externals")
|
|
|
|
|
add_subdirectory(Externals/LZO)
|
|
|
|
|
include_directories(Externals/LZO)
|
|
|
|
|
set(LZO lzo2)
|
|
|
|
@ -750,9 +748,9 @@ if(NOT APPLE)
|
|
|
|
|
check_lib(PNG libpng png png.h QUIET)
|
|
|
|
|
endif()
|
|
|
|
|
if (PNG_FOUND)
|
|
|
|
|
message("Using shared libpng")
|
|
|
|
|
message(STATUS "Using shared libpng")
|
|
|
|
|
else()
|
|
|
|
|
message("Using static libpng from Externals")
|
|
|
|
|
message(STATUS "Using static libpng from Externals")
|
|
|
|
|
add_subdirectory(Externals/libpng)
|
|
|
|
|
include_directories(Externals/libpng)
|
|
|
|
|
set(PNG png)
|
|
|
|
@ -763,29 +761,29 @@ if(OPENAL_FOUND)
|
|
|
|
|
check_lib(SOUNDTOUCH soundtouch SoundTouch soundtouch/SoundTouch.h QUIET)
|
|
|
|
|
endif()
|
|
|
|
|
if (SOUNDTOUCH_FOUND)
|
|
|
|
|
message("Using shared soundtouch")
|
|
|
|
|
message(STATUS "Using shared soundtouch")
|
|
|
|
|
else()
|
|
|
|
|
message("Using static soundtouch from Externals")
|
|
|
|
|
message(STATUS "Using static soundtouch from Externals")
|
|
|
|
|
add_subdirectory(Externals/soundtouch)
|
|
|
|
|
include_directories(Externals)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_SDL)
|
|
|
|
|
include(FindSDL2 OPTIONAL)
|
|
|
|
|
find_package(SDL2)
|
|
|
|
|
if(SDL2_FOUND)
|
|
|
|
|
message("Using shared SDL2")
|
|
|
|
|
message(STATUS "Using shared SDL2")
|
|
|
|
|
add_definitions(-DHAVE_SDL=1)
|
|
|
|
|
include_directories(${SDL2_INCLUDE_DIR})
|
|
|
|
|
else(SDL2_FOUND)
|
|
|
|
|
# SDL2 not found, try SDL
|
|
|
|
|
include(FindSDL OPTIONAL)
|
|
|
|
|
find_package(SDL OPTIONAL)
|
|
|
|
|
if(SDL_FOUND)
|
|
|
|
|
message("Using shared SDL")
|
|
|
|
|
message(STATUS "Using shared SDL")
|
|
|
|
|
add_definitions(-DHAVE_SDL=1)
|
|
|
|
|
include_directories(${SDL_INCLUDE_DIR})
|
|
|
|
|
else(SDL_FOUND)
|
|
|
|
|
message("SDL NOT found, disabling SDL input")
|
|
|
|
|
message(STATUS "SDL NOT found, disabling SDL input")
|
|
|
|
|
endif(SDL_FOUND)
|
|
|
|
|
endif(SDL2_FOUND)
|
|
|
|
|
endif()
|
|
|
|
@ -796,10 +794,10 @@ if(NOT ANDROID)
|
|
|
|
|
find_package(LibUSB)
|
|
|
|
|
endif()
|
|
|
|
|
if(LIBUSB_FOUND AND NOT APPLE)
|
|
|
|
|
message("Using shared LibUSB")
|
|
|
|
|
message(STATUS "Using shared LibUSB")
|
|
|
|
|
include_directories(${LIBUSB_INCLUDE_DIR})
|
|
|
|
|
else()
|
|
|
|
|
message("Using static LibUSB from Externals")
|
|
|
|
|
message(STATUS "Using static LibUSB from Externals")
|
|
|
|
|
add_subdirectory(Externals/libusb)
|
|
|
|
|
set(LIBUSB_LIBRARIES usb)
|
|
|
|
|
endif()
|
|
|
|
@ -811,9 +809,9 @@ if(NOT APPLE)
|
|
|
|
|
find_package(SFML ${SFML_REQD_VERSION} COMPONENTS network system)
|
|
|
|
|
endif()
|
|
|
|
|
if(SFML_FOUND)
|
|
|
|
|
message("Using shared SFML")
|
|
|
|
|
message(STATUS "Using shared SFML")
|
|
|
|
|
else()
|
|
|
|
|
message("Using static SFML ${SFML_REQD_VERSION} from Externals")
|
|
|
|
|
message(STATUS "Using static SFML ${SFML_REQD_VERSION} from Externals")
|
|
|
|
|
add_definitions(-DSFML_STATIC)
|
|
|
|
|
add_subdirectory(Externals/SFML)
|
|
|
|
|
include_directories(BEFORE Externals/SFML/include)
|
|
|
|
@ -821,12 +819,12 @@ endif()
|
|
|
|
|
|
|
|
|
|
if(USE_UPNP)
|
|
|
|
|
if(NOT APPLE)
|
|
|
|
|
include(FindMiniupnpc)
|
|
|
|
|
find_package(Miniupnpc)
|
|
|
|
|
endif()
|
|
|
|
|
if(MINIUPNPC_FOUND AND MINIUPNPC_API_VERSION GREATER 8)
|
|
|
|
|
message("Using shared miniupnpc")
|
|
|
|
|
message(STATUS "Using shared miniupnpc")
|
|
|
|
|
else()
|
|
|
|
|
message("Using static miniupnpc from Externals")
|
|
|
|
|
message(STATUS "Using static miniupnpc from Externals")
|
|
|
|
|
add_subdirectory(Externals/miniupnpc)
|
|
|
|
|
set(MINIUPNPC_INCLUDE_DIRS Externals/miniupnpc/src)
|
|
|
|
|
set(MINIUPNPC_LIBRARIES miniupnpc)
|
|
|
|
@ -837,24 +835,24 @@ if(USE_UPNP)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(NOT APPLE)
|
|
|
|
|
include(FindMbedTLS)
|
|
|
|
|
find_package(MbedTLS)
|
|
|
|
|
endif()
|
|
|
|
|
if(MBEDTLS_FOUND)
|
|
|
|
|
message("Using shared mbed TLS")
|
|
|
|
|
message(STATUS "Using shared mbed TLS")
|
|
|
|
|
include_directories(${MBEDTLS_INCLUDE_DIRS})
|
|
|
|
|
else()
|
|
|
|
|
message("Using static mbed TLS from Externals")
|
|
|
|
|
message(STATUS "Using static mbed TLS from Externals")
|
|
|
|
|
set(MBEDTLS_LIBRARIES mbedtls mbedcrypto mbedx509)
|
|
|
|
|
add_subdirectory(Externals/mbedtls/)
|
|
|
|
|
include_directories(Externals/mbedtls/include)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
include(FindCURL OPTIONAL)
|
|
|
|
|
find_package(CURL)
|
|
|
|
|
if(CURL_FOUND)
|
|
|
|
|
message("Using shared libcurl")
|
|
|
|
|
message(STATUS "Using shared libcurl")
|
|
|
|
|
include_directories(${CURL_INCLUDE_DIRS})
|
|
|
|
|
else()
|
|
|
|
|
message("Using static libcurl from Externals")
|
|
|
|
|
message(STATUS "Using static libcurl from Externals")
|
|
|
|
|
add_subdirectory(Externals/curl)
|
|
|
|
|
set(CURL_LIBRARIES curl)
|
|
|
|
|
include_directories(BEFORE Externals/curl/include)
|
|
|
|
@ -864,9 +862,9 @@ if(NOT APPLE)
|
|
|
|
|
check_lib(SOIL "(no .pc for SOIL)" SOIL SOIL/SOIL.h QUIET)
|
|
|
|
|
endif()
|
|
|
|
|
if(SOIL_FOUND)
|
|
|
|
|
message("Using shared SOIL")
|
|
|
|
|
message(STATUS "Using shared SOIL")
|
|
|
|
|
else()
|
|
|
|
|
message("Using static SOIL from Externals")
|
|
|
|
|
message(STATUS "Using static SOIL from Externals")
|
|
|
|
|
add_subdirectory(Externals/SOIL)
|
|
|
|
|
include_directories(Externals/SOIL)
|
|
|
|
|
endif()
|
|
|
|
@ -877,7 +875,7 @@ find_path(ICONV_INCLUDE_DIR NAMES iconv.h)
|
|
|
|
|
if (ICONV_LIBRARIES AND ICONV_INCLUDE_DIR)
|
|
|
|
|
mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIBRARIES)
|
|
|
|
|
else()
|
|
|
|
|
message("Using static iconv from Externals")
|
|
|
|
|
message(STATUS "Using static iconv from Externals")
|
|
|
|
|
include_directories(Externals/libiconv-1.14/include)
|
|
|
|
|
add_subdirectory(Externals/libiconv-1.14)
|
|
|
|
|
set(ICONV_LIBRARIES iconv)
|
|
|
|
@ -885,24 +883,23 @@ endif()
|
|
|
|
|
list(APPEND LIBS ${ICONV_LIBRARIES})
|
|
|
|
|
|
|
|
|
|
if(NOT ANDROID)
|
|
|
|
|
include(FindHIDAPI OPTIONAL)
|
|
|
|
|
find_package(HIDAPI)
|
|
|
|
|
if(HIDAPI_FOUND)
|
|
|
|
|
message("Using shared ${HIDAPI_LIBRARIES} ${HIDAPI_VERSION}")
|
|
|
|
|
message(STATUS "Using shared ${HIDAPI_LIBRARIES} ${HIDAPI_VERSION}")
|
|
|
|
|
include_directories(${HIDAPI_INCLUDE_DIRS})
|
|
|
|
|
list(APPEND LIBS ${HIDAPI_LIBRARIES})
|
|
|
|
|
else()
|
|
|
|
|
include_directories(Externals/hidapi/hidapi)
|
|
|
|
|
if(APPLE)
|
|
|
|
|
message("Using static hidapi from Externals")
|
|
|
|
|
message(STATUS "Using static hidapi from Externals")
|
|
|
|
|
add_subdirectory(Externals/hidapi/mac)
|
|
|
|
|
list(APPEND LIBS hidapi)
|
|
|
|
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
|
message("Using static hidapi-hidraw from Externals")
|
|
|
|
|
message(STATUS "Using static hidapi-hidraw from Externals")
|
|
|
|
|
add_subdirectory(Externals/hidapi/linux)
|
|
|
|
|
list(APPEND LIBS hidapi-hidraw udev)
|
|
|
|
|
else()
|
|
|
|
|
message("Using static hidapi-libusb from Externals")
|
|
|
|
|
message(STATUS "Using static hidapi-libusb from Externals")
|
|
|
|
|
add_subdirectory(Externals/hidapi/libusb)
|
|
|
|
|
list(APPEND LIBS hidapi-libusb)
|
|
|
|
|
endif()
|
|
|
|
@ -918,17 +915,16 @@ if (OPENSLES_LIBRARIES AND OPENSLES_INCLUDE_DIR)
|
|
|
|
|
set(OPENSLES_FOUND 1)
|
|
|
|
|
add_definitions(-DHAVE_OPENSLES=1)
|
|
|
|
|
include_directories(${OPENSLES_INCLUDE_DIR})
|
|
|
|
|
message("OpenSLES found, enabling OpenSLES sound backend")
|
|
|
|
|
message(STATUS "OpenSLES found, enabling OpenSLES sound backend")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(ENABLE_QT2)
|
|
|
|
|
find_package(Qt5Widgets REQUIRED)
|
|
|
|
|
message("Found Qt version ${Qt5Core_VERSION}, enabling the Qt backend")
|
|
|
|
|
message(STATUS "Found Qt version ${Qt5Core_VERSION}, enabling the Qt backend")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(NOT DISABLE_WX)
|
|
|
|
|
include(FindwxWidgets OPTIONAL)
|
|
|
|
|
FIND_PACKAGE(wxWidgets COMPONENTS core aui adv)
|
|
|
|
|
find_package(wxWidgets COMPONENTS core aui adv)
|
|
|
|
|
|
|
|
|
|
if(_ARCH_32)
|
|
|
|
|
add_definitions(-DwxSIZE_T_IS_UINT)
|
|
|
|
@ -942,10 +938,10 @@ if(NOT DISABLE_WX)
|
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
|
ERROR_QUIET
|
|
|
|
|
)
|
|
|
|
|
message("Found wxWidgets version ${wxWidgets_VERSION}")
|
|
|
|
|
message(STATUS "Found wxWidgets version ${wxWidgets_VERSION}")
|
|
|
|
|
set(wxMIN_VERSION "3.1.0")
|
|
|
|
|
if(${wxWidgets_VERSION} VERSION_LESS ${wxMIN_VERSION})
|
|
|
|
|
message("At least ${wxMIN_VERSION} is required; ignoring found version")
|
|
|
|
|
message(STATUS "At least ${wxMIN_VERSION} is required; ignoring found version")
|
|
|
|
|
unset(wxWidgets_FOUND)
|
|
|
|
|
endif()
|
|
|
|
|
endif(wxWidgets_FOUND)
|
|
|
|
@ -964,7 +960,7 @@ if(NOT DISABLE_WX)
|
|
|
|
|
VERSION_EQUAL 2.8.2 OR "${DIST_NAME}" STREQUAL "natty")
|
|
|
|
|
check_lib(GTK2 gtk+-2.0 gtk+-2.0 gtk.h REQUIRED)
|
|
|
|
|
else()
|
|
|
|
|
include(FindGTK2)
|
|
|
|
|
find_package(GTK2)
|
|
|
|
|
if(GTK2_FOUND)
|
|
|
|
|
include_directories(${GTK2_INCLUDE_DIRS})
|
|
|
|
|
list(APPEND LIBS ${GTK2_LIBRARIES})
|
|
|
|
@ -976,9 +972,9 @@ if(NOT DISABLE_WX)
|
|
|
|
|
|
|
|
|
|
if(wxWidgets_FOUND)
|
|
|
|
|
include(${wxWidgets_USE_FILE})
|
|
|
|
|
message("wxWidgets found, enabling GUI build")
|
|
|
|
|
message(STATUS "wxWidgets found, enabling GUI build")
|
|
|
|
|
else(wxWidgets_FOUND)
|
|
|
|
|
message("Using static wxWidgets from Externals")
|
|
|
|
|
message(STATUS "Using static wxWidgets from Externals")
|
|
|
|
|
|
|
|
|
|
# These definitions and includes are used when building dolphin against wx,
|
|
|
|
|
# not when building wx itself (see wxw3 CMakeLists.txt for that)
|
|
|
|
@ -1047,12 +1043,12 @@ include_directories("${PROJECT_BINARY_DIR}/Source/Core")
|
|
|
|
|
########################################
|
|
|
|
|
# Unit testing.
|
|
|
|
|
#
|
|
|
|
|
include(FindGTest)
|
|
|
|
|
find_package(GTest)
|
|
|
|
|
if(GTEST_FOUND AND USE_SHARED_GTEST)
|
|
|
|
|
message("Using shared gtest")
|
|
|
|
|
message(STATUS "Using shared gtest")
|
|
|
|
|
include_directories(${GTEST_INCLUDE_DIRS})
|
|
|
|
|
else()
|
|
|
|
|
message("Using static gtest from Externals")
|
|
|
|
|
message(STATUS "Using static gtest from Externals")
|
|
|
|
|
include_directories(Externals/gtest/include)
|
|
|
|
|
add_subdirectory(Externals/gtest)
|
|
|
|
|
endif()
|
|
|
|
|