From 2a0fc46266de4baeadadd8114a1cc70faf78ea6c Mon Sep 17 00:00:00 2001 From: Jacques Beuarain Date: Sat, 18 Nov 2006 02:48:18 +0000 Subject: [PATCH] CMake: Fix FFMPeg/OpenEXR issues in CMake system and possibly the others. OpenEXR can be linked in DEBUG mode on Windows using the libraries in CVS and stub. --- source/blender/blenkernel/CMakeLists.txt | 2 +- source/blender/blenkernel/intern/writeffmpeg.c | 10 +++++++++- source/blender/imbuf/CMakeLists.txt | 2 +- source/blender/imbuf/intern/openexr/openexr_api.cpp | 8 ++++++++ source/blender/python/CMakeLists.txt | 4 ++++ source/blender/src/CMakeLists.txt | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index caf59495f7f..2962997b8ee 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -53,7 +53,7 @@ IF(WITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} FFMPEG_INC) + SET(INC ${INC} ${FFMPEG_INC}) ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 9de7400c688..07a202352b8 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -20,8 +20,12 @@ #include #include +#if defined(_WIN32) && defined(_DEBUG) && !defined(__MINGW32__) && !defined(__CYGWIN__) #include +#endif + #include + #include #include #include @@ -33,6 +37,10 @@ #define FFMPEG_CODEC_TIME_BASE 1 #endif +#if defined(WIN32) && (!(defined snprintf)) +#define snprintf _snprintf +#endif + #include "BKE_writeffmpeg.h" #include "MEM_guardedalloc.h" @@ -471,7 +479,7 @@ static AVStream* alloc_audio_stream(int codec_id, AVFormatContext* of) } /* essential functions -- start, append, end */ -static void start_ffmpeg_impl(RenderData *rd, int rectx, int recty) +void start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty) { /* Handle to the output file */ AVFormatContext* of; diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 6638295525b..146ec654c1e 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -53,7 +53,7 @@ IF(WITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} FFMPEG_INC) + SET(INC ${INC} ${FFMPEG_INC}) ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 01e6c6b3fb7..3027f9508cf 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -35,6 +35,14 @@ extern "C" { + +// The following prevents a linking error in debug mode for MSVC using the libs in CVS +#if defined(_WIN32) && defined(_DEBUG) && !defined(__MINGW32__) && !defined(__CYGWIN__) +_CRTIMP void __cdecl _invalid_parameter_noinfo(void) +{ +} +#endif + #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" diff --git a/source/blender/python/CMakeLists.txt b/source/blender/python/CMakeLists.txt index dc7df2282da..7df1f8a02d5 100644 --- a/source/blender/python/CMakeLists.txt +++ b/source/blender/python/CMakeLists.txt @@ -49,5 +49,9 @@ IF(WITH_OPENEXR) ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) +IF(WITH_FFMPEG) + ADD_DEFINITIONS(-DWITH_FFMPEG) +ENDIF(WITH_FFMPEG) + BLENDERLIB_NOLIST(blender_python "${SRC}" "${INC}") #env.BlenderLib ( libname='blender_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype=['core','game2'], priority = [60,115] ) diff --git a/source/blender/src/CMakeLists.txt b/source/blender/src/CMakeLists.txt index 4ce1d7624ea..20205f237ca 100644 --- a/source/blender/src/CMakeLists.txt +++ b/source/blender/src/CMakeLists.txt @@ -58,7 +58,7 @@ IF(WITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} FFMPEG_INC) + SET(INC ${INC} ${FFMPEG_INC}) ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG)