Commit 4b28ead6 authored by Ghislain MARY's avatar Ghislain MARY

Fix compilation with CMake on Linux.

parent cdc17ca0
......@@ -25,26 +25,26 @@
#define MEDIASTREAMER_MICRO_VERSION ${MEDIASTREAMER_MICRO_VERSION}
#define MEDIASTREAMER_VERSION "${MEDIASTREAMER_VERSION}"
#cmakedefine HAVE_INTTYPES_H
#cmakedefine HAVE_MEMORY_H
#cmakedefine HAVE_STDINT_H
#cmakedefine HAVE_STDLIB_H
#cmakedefine HAVE_STRINGS_H
#cmakedefine HAVE_STRING_H
#cmakedefine HAVE_SYS_STAT_H
#cmakedefine HAVE_SYS_TYPES_H
#cmakedefine HAVE_POLL_H
#cmakedefine HAVE_SYS_POLL_H
#cmakedefine HAVE_SYS_UIO_H
#cmakedefine HAVE_FCNTL_H
#cmakedefine HAVE_SYS_TIME_H
#cmakedefine HAVE_UNISTD_H
#cmakedefine HAVE_SYS_SHM_H
#cmakedefine HAVE_WINDOWS_H
#cmakedefine HAVE_DLFCN_H
#cmakedefine HAVE_ALLOCA_H
#cmakedefine HAVE_INTTYPES_H 1
#cmakedefine HAVE_MEMORY_H 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_STDLIB_H 1
#cmakedefine HAVE_STRINGS_H 1
#cmakedefine HAVE_STRING_H 1
#cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_POLL_H 1
#cmakedefine HAVE_SYS_POLL_H 1
#cmakedefine HAVE_SYS_UIO_H 1
#cmakedefine HAVE_FCNTL_H 1
#cmakedefine HAVE_SYS_TIME_H 1
#cmakedefine HAVE_UNISTD_H 1
#cmakedefine HAVE_SYS_SHM_H 1
#cmakedefine HAVE_WINDOWS_H 1
#cmakedefine HAVE_DLFCN_H 1
#cmakedefine HAVE_ALLOCA_H 1
#cmakedefine HAVE_DLOPEN
#cmakedefine HAVE_DLOPEN 1
#cmakedefine WORDS_BIGENDIAN
......@@ -61,14 +61,14 @@
#cmakedefine PACKAGE_PLUGINS_DIR "${PACKAGE_PLUGINS_DIR}"
#cmakedefine PACKAGE_DATA_DIR "${PACKAGE_DATA_DIR}"
#cmakedefine HAVE_LIBAVCODEC_AVCODEC_H
#cmakedefine HAVE_LIBSWSCALE_SWSCALE_H
#cmakedefine HAVE_FUN_avcodec_get_context_defaults3
#cmakedefine HAVE_FUN_avcodec_open2
#cmakedefine HAVE_FUN_avcodec_encode_video2
#cmakedefine HAVE_FUN_av_frame_alloc
#cmakedefine HAVE_FUN_av_frame_free
#cmakedefine HAVE_FUN_av_frame_unref
#cmakedefine HAVE_GL
#cmakedefine HAVE_X11_XLIB_H
#cmakedefine HAVE_XV
#cmakedefine HAVE_LIBAVCODEC_AVCODEC_H 1
#cmakedefine HAVE_LIBSWSCALE_SWSCALE_H 1
#cmakedefine HAVE_FUN_avcodec_get_context_defaults3 1
#cmakedefine HAVE_FUN_avcodec_open2 1
#cmakedefine HAVE_FUN_avcodec_encode_video2 1
#cmakedefine HAVE_FUN_av_frame_alloc 1
#cmakedefine HAVE_FUN_av_frame_free 1
#cmakedefine HAVE_FUN_av_frame_unref 1
#cmakedefine HAVE_GL 1
#cmakedefine HAVE_X11_XLIB_H 1
#cmakedefine HAVE_XV 1
......@@ -277,29 +277,36 @@ endif()
set(VOIP_GENERATED_SOURCE_FILES
${CMAKE_CURRENT_BINARY_DIR}/voipdescs.h
)
set_source_files_properties(${VOIP_GENERATED_SOURCE_FILES} PROPERTIES GENERATED TRUE)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/voipdescs.h
COMMAND ${CMAKE_COMMAND} -DAWK_PROGRAM=${AWK_PROGRAM} -DAWK_SCRIPTS_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../
-DINPUT_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}
-DTYPE=voip -DSOURCE_FILES="${VOIP_SOURCE_FILES}"
-P ${CMAKE_CURRENT_SOURCE_DIR}/generate_descs_header.cmake)
# if(APPLE)
# list(APPEND VOIP_GENERATED_SOURCE_FILES
# ${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.fs.h
# ${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.vs.h
# )
# execute_process(
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# COMMAND xxd -i yuv2rgb.fs | sed s/}\;/,0x00}\;/
# OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.fs.h
# )
# execute_process(
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# COMMAND xxd -i yuv2rgb.vs | sed s/}\;/,0x00}\;/
# OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.vs.h
# )
# endif(APPLE)
if(APPLE OR GLX_FOUND)
find_program(XXD_PROGRAM xxd)
if(NOT XXD_PROGRAM)
message(FATAL_ERROR "You need the xxd program to build mediastreamer2.")
endif()
find_program(SED_PROGRAM sed)
if(NOT SED_PROGRAM)
message(FATAL_ERROR "You need the sed program to build mediastreamer2.")
endif()
list(APPEND VOIP_GENERATED_SOURCE_FILES
${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.fs.h
${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.vs.h
)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.fs.h
COMMAND ${CMAKE_COMMAND} -DXXD_PROGRAM=${XXD_PROGRAM} -DSED_PROGRAM=${SED_PROGRAM}
-DINPUT_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}
-DSOURCE_FILE="yuv2rgb.fs"
-P ${CMAKE_CURRENT_SOURCE_DIR}/generate_yuv2rgb_header.cmake)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yuv2rgb.vs.h
COMMAND ${CMAKE_COMMAND} -DXXD_PROGRAM=${XXD_PROGRAM} -DSED_PROGRAM=${SED_PROGRAM}
-DINPUT_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}
-DSOURCE_FILE="yuv2rgb.vs"
-P ${CMAKE_CURRENT_SOURCE_DIR}/generate_yuv2rgb_header.cmake)
endif(UNIX)
set_source_files_properties(${VOIP_GENERATED_SOURCE_FILES} PROPERTIES GENERATED TRUE)
set(VOIP_LIBS
......
......@@ -531,7 +531,7 @@ int ms_factory_load_plugins(MSFactory *factory, const char *dir){
/* Close the search handle. */
FindClose(hSearch);
#elif HAVE_DLOPEN
#elif defined(HAVE_DLOPEN)
char plugin_name[64];
DIR *ds;
MSList *loaded_plugins = NULL;
......
############################################################################
# CMakeLists.txt
# generate_descs_header.cmake
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
......
############################################################################
# generate_yuv2rgb_header.cmake
# 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.
#
############################################################################
execute_process(
COMMAND "${XXD_PROGRAM}" "-i" "${SOURCE_FILE}"
OUTPUT_FILE "${OUTPUT_DIR}/${SOURCE_FILE}.tmp"
WORKING_DIRECTORY ${INPUT_DIR}
)
execute_process(
COMMAND "${SED_PROGRAM}" "s/}\;/,0x00}\;/" "${OUTPUT_DIR}/${SOURCE_FILE}.tmp"
OUTPUT_FILE "${OUTPUT_DIR}/${SOURCE_FILE}.h"
)
\ No newline at end of file
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