CMakeLists.txt 2.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
############################################################################
# CMakeLists.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.
#
############################################################################

23
cmake_minimum_required(VERSION 3.0)
24 25 26 27 28 29
project(MSOPENH264 C)
enable_language(CXX)


set(PACKAGE "msopenh264")
set(PACKAGE_NAME "${PACKAGE}")
30
set(PACKAGE_VERSION "0.1.0")
31 32 33 34 35 36 37
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "support@belledonne-communications.com")
set(PACKAGE_TARNAME "msopenh264")
set(PACKAGE_URL "")
set(VERSION "${PACKAGE_VERSION}")


38
option(ENABLE_DECODER "Enable the openh264 decoder" Yes)
39
option(ENABLE_STATIC "Build static library (default is shared library)." NO)
40 41


42
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
43

Ghislain MARY's avatar
Ghislain MARY committed
44
include(CheckIncludeFile)
45 46
check_include_file("stdbool.h" HAVE_STDBOOL_H)

47 48
find_package(Mediastreamer2 REQUIRED)
find_package(OpenH264 REQUIRED)
49 50 51 52 53 54


configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)


include_directories(
55
	${MEDIASTREAMER2_INCLUDE_DIRS}
Ghislain MARY's avatar
Ghislain MARY committed
56
	${OPENH264_INCLUDE_DIRS}
57
	src
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
	${CMAKE_CURRENT_BINARY_DIR}
	${CMAKE_CURRENT_BINARY_DIR}/src
)

add_definitions(-DHAVE_CONFIG_H)
if(NOT MSVC)
	add_definitions(-Wall -Wno-error=unknown-pragmas)
	if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
		add_definitions(-Werror -Wno-error=unknown-warning-option)
	elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
		add_definitions(-Werror -Wno-error=pragmas)
	endif()
endif(NOT MSVC)

add_subdirectory(src)