mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-12-30 22:20:57 +01:00
76d9209ad4
Make sure the gfx debugger unpauses when the emulator is stopped. When a wad is installed make sure directories exist. For the cmake build if a header is not provided in the check_lib macro don't check for it, and assume pkg-config was supposed to work. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6581 8ced0084-cf51-0410-be5f-012b33b47a6e
71 lines
1.7 KiB
CMake
71 lines
1.7 KiB
CMake
include(FindPkgConfig OPTIONAL)
|
|
|
|
macro(_internal_message msg)
|
|
if(NOT ${_is_quiet})
|
|
message("${msg}")
|
|
endif()
|
|
endmacro()
|
|
|
|
macro(check_lib var lib)
|
|
set(_is_required 0)
|
|
set(_is_quiet 0)
|
|
set(_arg_list ${ARGN})
|
|
foreach(_arg ${ARGN})
|
|
if(_arg STREQUAL "REQUIRED")
|
|
list(REMOVE_ITEM _arg_list "REQUIRED")
|
|
set(_is_required 1)
|
|
endif()
|
|
if(_arg STREQUAL "QUIET")
|
|
list(REMOVE_ITEM _arg_list "QUIET")
|
|
set(_is_quiet 1)
|
|
endif()
|
|
endforeach()
|
|
|
|
if(PKG_CONFIG_FOUND AND NOT ${var}_FOUND)
|
|
string(TOLOWER ${lib} lower_lib)
|
|
pkg_search_module(${var} QUIET ${lower_lib})
|
|
endif()
|
|
|
|
if(${var}_FOUND)
|
|
include_directories(${${var}_INCLUDE_DIRS})
|
|
# Make sure include directories for headers found using find_path below
|
|
# are re-added when reconfiguring
|
|
include_directories(${${var}_INCLUDE})
|
|
_internal_message("${lib} found")
|
|
else()
|
|
find_library(${var} ${lib})
|
|
if(_arg_list)
|
|
find_path(${var}_INCLUDE ${_arg_list})
|
|
else()
|
|
set(${var}_INCLUDE FALSE)
|
|
endif()
|
|
if(${var} AND ${var}_INCLUDE)
|
|
include_directories(${${var}_INCLUDE})
|
|
_internal_message("${lib} found")
|
|
set(${var}_FOUND 1 CACHE INTERNAL "")
|
|
else()
|
|
if(_is_required)
|
|
message(FATAL_ERROR "${lib} is required but not found")
|
|
else()
|
|
_internal_message("${lib} not found")
|
|
endif()
|
|
endif()
|
|
endif()
|
|
endmacro()
|
|
|
|
macro(check_libav)
|
|
if(PKG_CONFIG_FOUND)
|
|
pkg_check_modules(LIBAV libavcodec>=52.72.2 libavformat>=52.64.2
|
|
libswscale>=0.11.0 libavutil>=50.15.1)
|
|
else()
|
|
message("pkg-config is required to check for libav")
|
|
endif()
|
|
if(LIBAV_FOUND)
|
|
message("libav found, enabling AVI frame dumps")
|
|
add_definitions(-DHAVE_LIBAV)
|
|
else()
|
|
message("libav not found, disabling AVI frame dumps")
|
|
endif()
|
|
endmacro()
|
|
|