Commit 664d60e1 authored by Ghislain MARY's avatar Ghislain MARY

Improve compilation with CMake.

parent c6889187
This diff is collapsed.
############################################################################
# FindArts.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the arts include file and library
#
# ARTS_FOUND - system has arts
# ARTS_INCLUDE_DIRS - the arts include directory
# ARTS_LIBRARIES - The libraries needed to use arts
include(CheckSymbolExists)
set(_ARTS_ROOT_PATHS
${WITH_ARTS}
${CMAKE_INSTALL_PREFIX}
)
find_path(ARTS_INCLUDE_DIRS
NAMES kde/artsc/artsc.h
HINTS _ARTS_ROOT_PATHS
PATH_SUFFIXES include
)
if(ARTS_INCLUDE_DIRS)
set(HAVE_KDE_ARTSC_ARTSC_H 1)
endif()
find_library(ARTS_LIBRARIES
NAMES artsc
HINTS _ARTS_ROOT_PATHS
PATH_SUFFIXES bin lib
)
if(ARTS_LIBRARIES)
check_symbol_exists(arts_init kde/artsc/artsc.h HAVE_ARTS_INIT)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Arts
DEFAULT_MSG
ARTS_INCLUDE_DIRS ARTS_LIBRARIES HAVE_ARTS_INIT
)
mark_as_advanced(ARTS_INCLUDE_DIRS ARTS_LIBRARIES HAVE_ARTS_INIT)
############################################################################
# FindFFMpeg.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the ffmpeg include file and library
#
# FFMPEG_FOUND - system has ffmpeg
# FFMPEG_INCLUDE_DIRS - the ffmpeg include directory
# FFMPEG_LIBRARIES - The libraries needed to use ffmpeg
include(CMakePushCheckState)
include(CheckSymbolExists)
set(_FFMPEG_ROOT_PATHS
${WITH_FFMPEG}
${CMAKE_INSTALL_PREFIX}
)
find_path(LIBAVCODEC_INCLUDE_DIRS
NAMES libavcodec/avcodec.h
HINTS _FFMPEG_ROOT_PATHS
PATH_SUFFIXES include
)
if(LIBAVCODEC_INCLUDE_DIRS)
set(HAVE_LIBAVCODEC_AVCODEC_H 1)
endif()
find_path(LIBAVUTIL_INCLUDE_DIRS
NAMES libavutil/avutil.h
HINTS _FFMPEG_ROOT_PATHS
PATH_SUFFIXES include
)
if(LIBAVUTIL_INCLUDE_DIRS)
set(HAVE_LIBAVUTIL_AVUTIL_H 1)
endif()
find_path(LIBSWSCALE_INCLUDE_DIRS
NAMES libswscale/swscale.h
HINTS _FFMPEG_ROOT_PATHS
PATH_SUFFIXES include
)
if(LIBSWSCALE_INCLUDE_DIRS)
set(HAVE_LIBSWSCALE_SWSCALE_H 1)
endif()
find_library(LIBAVCODEC_LIBRARIES
NAMES avcodec
HINTS _FFMPEG_ROOT_PATHS
PATH_SUFFIXES bin lib
)
find_library(LIBAVUTIL_LIBRARIES
NAMES avutil
HINTS _FFMPEG_ROOT_PATHS
PATH_SUFFIXES bin lib
)
find_library(LIBSWSCALE_LIBRARIES
NAMES swscale
HINTS _FFMPEG_ROOT_PATHS
PATH_SUFFIXES bin lib
)
set(FFMPEG_INCLUDE_DIRS ${LIBAVCODEC_INCLUDE_DIRS} ${LIBAVUTIL_INCLUDE_DIRS} ${LIBSWSCALE_INCLUDE_DIRS})
set(FFMPEG_LIBRARIES ${LIBAVCODEC_LIBRARIES} ${LIBAVUTIL_LIBRARIES} ${LIBSWSCALE_LIBRARIES})
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
list(REMOVE_DUPLICATES FFMPEG_LIBRARIES)
if(FFMPEG_LIBRARIES)
cmake_push_check_state(RESET)
list(APPEND CMAKE_REQUIRED_INCLUDES ${FFMPEG_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_LIBRARIES ${FFMPEG_LIBRARIES})
if(MSVC)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -Dinline=__inline)
endif()
check_symbol_exists(avcodec_get_context_defaults3 libavcodec/avcodec.h HAVE_FUN_avcodec_get_context_defaults3)
check_symbol_exists(avcodec_open2 libavcodec/avcodec.h HAVE_FUN_avcodec_open2)
check_symbol_exists(avcodec_encode_video2 libavcodec/avcodec.h HAVE_FUN_avcodec_encode_video2)
check_symbol_exists(av_frame_alloc libavutil/avutil.h HAVE_FUN_av_frame_alloc)
check_symbol_exists(av_frame_free libavutil/avutil.h HAVE_FUN_av_frame_free)
check_symbol_exists(av_frame_unref libavutil/avutil.h HAVE_FUN_av_frame_unref)
cmake_pop_check_state()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFMpeg
DEFAULT_MSG
FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES
LIBAVCODEC_INCLUDE_DIRS LIBAVUTIL_INCLUDE_DIRS LIBSWSCALE_INCLUDE_DIRS
LIBAVCODEC_LIBRARIES LIBAVUTIL_LIBRARIES LIBSWSCALE_LIBRARIES
)
mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES
LIBAVCODEC_INCLUDE_DIRS LIBAVUTIL_INCLUDE_DIRS LIBSWSCALE_INCLUDE_DIRS
LIBAVCODEC_LIBRARIES LIBAVUTIL_LIBRARIES LIBSWSCALE_LIBRARIES)
############################################################################
# FindGLX.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the GLX include file and library
#
# GLX_FOUND - system has GLX
# GLX_INCLUDE_DIRS - the GLX include directory
# GLX_LIBRARIES - The libraries needed to use GLX
include(CheckIncludeFile)
include(CheckSymbolExists)
set(_GLX_ROOT_PATHS
${WITH_GLX}
${CMAKE_INSTALL_PREFIX}
)
find_path(GLX_INCLUDE_DIRS
NAMES GL/gl.h
HINTS _GLX_ROOT_PATHS
PATH_SUFFIXES include
)
if(GLX_INCLUDE_DIRS)
check_include_file(GL/gl.h HAVE_GL_GL_H)
check_include_file(GL/glx.h HAVE_GL_GLX_H)
endif()
find_library(GL_LIBRARY
NAMES GL
HINTS _GLX_ROOT_PATHS
PATH_SUFFIXES bin lib
)
find_library(GLEW_LIBRARY
NAMES GLEW
HINTS _GLX_ROOT_PATHS
PATH_SUFFIXES bin lib
)
set(GLX_LIBRARIES ${GL_LIBRARY} ${GLEW_LIBRARY})
if(GLX_LIBRARIES)
# TODO: check symbols in gl and glew
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GLX
DEFAULT_MSG
GLX_INCLUDE_DIRS HAVE_GL_GL_H HAVE_GL_GLX_H GLX_LIBRARIES
)
mark_as_advanced(GLX_INCLUDE_DIRS HAVE_GL_GL_H HAVE_GL_GLX_H GLX_LIBRARIES)
############################################################################
# FindGSM.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the gsm include file and library
#
# GSM_FOUND - system has gsm
# GSM_INCLUDE_DIRS - the gsm include directory
# GSM_LIBRARIES - The libraries needed to use gsm
set(_GSM_ROOT_PATHS
${WITH_GSM}
${CMAKE_INSTALL_PREFIX}
)
find_path(GSM_INCLUDE_DIRS
NAMES gsm/gsm.h
HINTS _GSM_ROOT_PATHS
PATH_SUFFIXES include
)
if(GSM_INCLUDE_DIRS)
set(HAVE_GSM_GSM_H 1)
endif()
find_library(GSM_LIBRARIES
NAMES gsm
HINTS _GSM_ROOT_PATHS
PATH_SUFFIXES bin lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GSM
DEFAULT_MSG
GSM_INCLUDE_DIRS GSM_LIBRARIES
)
mark_as_advanced(GSM_INCLUDE_DIRS GSM_LIBRARIES)
############################################################################
# FindOpus.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the opus include file and library
#
# OPUS_FOUND - system has opus
# OPUS_INCLUDE_DIRS - the opus include directory
# OPUS_LIBRARIES - The libraries needed to use opus
set(_OPUS_ROOT_PATHS
${WITH_OPUS}
${CMAKE_INSTALL_PREFIX}
)
find_path(OPUS_INCLUDE_DIRS
NAMES opus/opus.h
HINTS _OPUS_ROOT_PATHS
PATH_SUFFIXES include
)
if(OPUS_INCLUDE_DIRS)
set(HAVE_OPUS_OPUS_H 1)
endif()
find_library(OPUS_LIBRARIES
NAMES opus
HINTS _OPUS_ROOT_PATHS
PATH_SUFFIXES bin lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Opus
DEFAULT_MSG
OPUS_INCLUDE_DIRS OPUS_LIBRARIES
)
mark_as_advanced(OPUS_INCLUDE_DIRS OPUS_LIBRARIES)
############################################################################
# FindPortAudio.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the portaudio include file and library
#
# PORTAUDIO_FOUND - system has portaudio
# PORTAUDIO_INCLUDE_DIRS - the portaudio include directory
# PORTAUDIO_LIBRARIES - The libraries needed to use portaudio
include(CheckSymbolExists)
set(_PORTAUDIO_ROOT_PATHS
${WITH_PORTAUDIO}
${CMAKE_INSTALL_PREFIX}
)
find_path(PORTAUDIO_INCLUDE_DIRS
NAMES portaudio.h
HINTS _PORTAUDIO_ROOT_PATHS
PATH_SUFFIXES include
)
if(PORTAUDIO_INCLUDE_DIRS)
set(HAVE_PORTAUDIO_H 1)
endif()
find_library(PORTAUDIO_LIBRARIES
NAMES portaudio
HINTS _PORTAUDIO_ROOT_PATHS
PATH_SUFFIXES bin lib
)
if(PORTAUDIO_LIBRARIES)
check_symbol_exists(Pa_Initialize portaudio.h HAVE_PA_INITIALIZE)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PortAudio
DEFAULT_MSG
PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES HAVE_PA_INITIALIZE
)
mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES HAVE_PA_INITIALIZE)
############################################################################
# FindPulseAudio.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the pulseaudio include file and library
#
# PULSEAUDIO_FOUND - system has pulseaudio
# PULSEAUDIO_INCLUDE_DIRS - the pulseaudio include directory
# PULSEAUDIO_LIBRARIES - The libraries needed to use pulseaudio
include(CheckSymbolExists)
set(_PULSEAUDIO_ROOT_PATHS
${WITH_PULSEAUDIO}
${CMAKE_INSTALL_PREFIX}
)
find_path(PULSEAUDIO_INCLUDE_DIRS
NAMES pulse/pulseaudio.h
HINTS _PULSEAUDIO_ROOT_PATHS
PATH_SUFFIXES include
)
if(PULSEAUDIO_INCLUDE_DIRS)
set(HAVE_PULSE_PULSEAUDIO_H 1)
endif()
find_library(PULSEAUDIO_LIBRARIES
NAMES pulse
HINTS _PULSEAUDIO_ROOT_PATHS
PATH_SUFFIXES bin lib
)
if(PULSEAUDIO_LIBRARIES)
check_symbol_exists(pa_mainloop_new pulse/pulseaudio.h HAVE_PA_MAINLOOP_NEW)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PulseAudio
DEFAULT_MSG
PULSEAUDIO_INCLUDE_DIRS PULSEAUDIO_LIBRARIES HAVE_PA_MAINLOOP_NEW
)
mark_as_advanced(PULSEAUDIO_INCLUDE_DIRS PULSEAUDIO_LIBRARIES HAVE_PA_MAINLOOP_NEW)
############################################################################
# FindQSA.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the QSA include file and library
#
# QSA_FOUND - system has QSA
# QSA_INCLUDE_DIRS - the QSA include directory
# QSA_LIBRARIES - The libraries needed to use QSA
include(CheckSymbolExists)
set(_QSA_ROOT_PATHS
${WITH_QSA}
${CMAKE_INSTALL_PREFIX}
)
find_path(QSA_INCLUDE_DIRS
NAMES sys/asoundlib.h
HINTS _QSA_ROOT_PATHS
PATH_SUFFIXES include
)
if(QSA_INCLUDE_DIRS)
set(HAVE_SYS_ASOUNDLIB_H 1)
endif()
find_library(QSA_LIBRARIES
NAMES asound
HINTS _QSA_ROOT_PATHS
PATH_SUFFIXES bin lib
)
if(QSA_LIBRARIES)
check_symbol_exists(snd_pcm_open sys/asound.h HAVE_SND_PCM_OPEN)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QSA
DEFAULT_MSG
QSA_INCLUDE_DIRS QSA_LIBRARIES HAVE_SND_PCM_OPEN
)
mark_as_advanced(QSA_INCLUDE_DIRS QSA_LIBRARIES HAVE_SND_PCM_OPEN)
############################################################################
# FindSpeex.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the speex include file and library
#
# SPEEX_FOUND - system has speex
# SPEEX_INCLUDE_DIRS - the speex include directory
# SPEEX_LIBRARIES - The libraries needed to use speex
set(_SPEEX_ROOT_PATHS
${WITH_SPEEX}
${CMAKE_INSTALL_PREFIX}
)
find_path(SPEEX_INCLUDE_DIRS
NAMES speex/speex.h
HINTS _SPEEX_ROOT_PATHS
PATH_SUFFIXES include
)
if(SPEEX_INCLUDE_DIRS)
set(HAVE_SPEEX_SPEEX_H 1)
endif()
find_library(SPEEX_LIBRARIES
NAMES speex
HINTS _SPEEX_ROOT_PATHS
PATH_SUFFIXES bin lib
)
find_library(SPEEXDSP_LIBRARIES
NAMES speexdsp
HINTS _SPEEX_ROOT_PATHS
PATH_SUFFIXES bin lib
)
list(APPEND SPEEX_LIBRARIES ${SPEEXDSP_LIBRARIES})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Speex
DEFAULT_MSG
SPEEX_INCLUDE_DIRS SPEEX_LIBRARIES SPEEXDSP_LIBRARIES
)
mark_as_advanced(SPEEX_INCLUDE_DIRS SPEEX_LIBRARIES)
############################################################################
# FindVPX.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the VPX include file and library
#
# VPX_FOUND - system has VPX
# VPX_INCLUDE_DIRS - the VPX include directory
# VPX_LIBRARIES - The libraries needed to use VPX
set(_VPX_ROOT_PATHS
${WITH_VPX}
${CMAKE_INSTALL_PREFIX}
)
find_path(VPX_INCLUDE_DIRS
NAMES vpx/vpx_encoder.h
HINTS _VPX_ROOT_PATHS
PATH_SUFFIXES include
)
if(VPX_INCLUDE_DIRS)
set(HAVE_VPX_VPX_ENCODER_H 1)
endif()
find_library(VPX_LIBRARIES
NAMES vpx
HINTS _VPX_ROOT_PATHS
PATH_SUFFIXES bin lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VPX
DEFAULT_MSG
VPX_INCLUDE_DIRS VPX_LIBRARIES
)
mark_as_advanced(VPX_INCLUDE_DIRS VPX_LIBRARIES)
############################################################################
# FindX11.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the X11 include file and library
#
# X11_FOUND - system has X11
# X11_INCLUDE_DIRS - the X11 include directory
# X11_LIBRARIES - The libraries needed to use X11
set(_X11_ROOT_PATHS
${WITH_X11}
${CMAKE_INSTALL_PREFIX}
)
find_path(X11_INCLUDE_DIRS
NAMES X11/Xlib.h
HINTS _X11_ROOT_PATHS
PATH_SUFFIXES include
)
if(X11_INCLUDE_DIRS)
set(HAVE_X11_XLIB_H 1)
endif()
find_library(X11_LIBRARIES
NAMES X11
HINTS _X11_ROOT_PATHS
PATH_SUFFIXES bin lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(X11
DEFAULT_MSG
X11_INCLUDE_DIRS X11_LIBRARIES
)
mark_as_advanced(X11_INCLUDE_DIRS X11_LIBRARIES)
############################################################################
# FindXv.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the Xv include file and library
#
# XV_FOUND - system has Xv
# XV_INCLUDE_DIRS - the Xv include directory
# XV_LIBRARIES - The libraries needed to use Xv
include(CheckIncludeFile)
include(CheckSymbolExists)
find_package(X11 REQUIRED)
set(_XV_ROOT_PATHS
${WITH_XV}
${CMAKE_INSTALL_PREFIX}
)
find_path(XV_INCLUDE_DIRS
NAMES X11/extensions/Xv.h
HINTS _XV_ROOT_PATHS
PATH_SUFFIXES include
)
if(XV_INCLUDE_DIRS)
check_include_file(X11/extensions/Xv.h HAVE_X11_EXTENSIONS_XV_H)
check_include_file(X11/extensions/Xvlib.h HAVE_X11_EXTENSIONS_XVLIB_H)
endif()
find_library(XV_LIBRARIES
NAMES Xv
HINTS _XV_ROOT_PATHS