Commit e9e37a93 authored by Ghislain MARY's avatar Ghislain MARY

Fix build with CMake on Windows.

parent ac38f5cc
......@@ -35,7 +35,9 @@ set(PACKAGE_URL "")
set(VERSION "${PACKAGE_VERSION}")
set(WITH_MS2 "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Set prefix where the mediastreamer libraries can be found (ex:/usr or /usr/local)")
set(WITH_OPENH264 "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Set prefix where libopenh264 can be found (ex:/usr or /usr/local)")
set(WITH_ORTP "${CMAKE_INSTALL_PREFIX}" CACHE STRING "Set prefix where the oRTP library can be found (ex:/usr or /usr/local)")
if(MSVC)
......@@ -58,14 +60,18 @@ check_include_file("sys/types.h" HAVE_SYS_TYPES_H)
check_include_file("unistd.h" HAVE_UNISTD_H)
check_include_file("stdbool.h" HAVE_STDBOOL_H)
find_package(Ortp)
find_package(Mediastreamer2)
find_package(OpenH264)
if(NOT ORTP_FOUND)
message(FATAL "Could not find oRTP headers/library!")
endif()
if(NOT MEDIASTREAMER2_FOUND)
message(WARNING "Could not find mediastreamer2 headers/library!")
message(FATAL "Could not find mediastreamer2 headers/library!")
endif()
if(NOT OPENH264_FOUND)
message(WARNING "Could not find openh264 headers/library!")
message(FATAL "Could not find openh264 headers/library!")
endif()
......
......@@ -28,7 +28,7 @@
if(UNIX)
find_package(PkgConfig)
pkg_check_modules(_CUNIT QUIET cunit)
pkg_check_modules(PC_MS2 QUIET mediastreamer>=2.7.0)
endif()
set(_MS2_ROOT_PATHS
......
############################################################################
# FindOrtp.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 oRTP include file and library
#
# ORTP_FOUND - system has oRTP
# ORTP_INCLUDE_DIR - the oRTP include directory
# ORTP_LIBRARIES - The libraries needed to use oRTP
if(UNIX)
find_package(PkgConfig)
pkg_check_modules(PC_ORTP QUIET ortp>=0.23.0)
endif()
set(_ORTP_ROOT_PATHS
${WITH_ORTP}
${CMAKE_INSTALL_PREFIX}
)
find_path(ORTP_INCLUDE_DIR
NAMES ortp/ortp.h
HINTS _ORTP_ROOT_PATHS
PATH_SUFFIXES include
)
if(NOT "${ORTP_INCLUDE_DIR}" STREQUAL "")
set(HAVE_ORTP_ORTP_H 1)
find_library(ORTP_LIBRARIES
NAMES ortp
HINTS ${_ORTP_ROOT_PATHS}
PATH_SUFFIXES bin lib
)
if(NOT "${ORTP_LIBRARIES}" STREQUAL "")
set(ORTP_FOUND TRUE)
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ortp
REQUIRED_VARS
ORTP_LIBRARIES
ORTP_INCLUDE_DIR
FAIL_MESSAGE
"Could NOT find oRTP"
)
mark_as_advanced(ORTP_INCLUDE_DIR ORTP_LIBRARIES)
......@@ -23,10 +23,8 @@
set(LIBS
${MS2_LIBRARIES}
${OPENH264_LIBRARIES}
${ORTP_LIBRARIES}
)
if(WIN32)
list(APPEND LIBS ws2_32)
endif()
set(SOURCE_FILES
msopenh264.cpp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment