From 941391c0bead29f29904b49e776d5468ac8c20ff Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Sat, 25 Aug 2012 17:12:17 +0400 Subject: [PATCH] Fix openexr build with MSVC --- 3rdparty/openexr/CMakeLists.txt | 7 ++- .../openexr/IlmImf/ImfPxr24Compressor.cpp | 2 +- 3rdparty/openexr/IlmImf/ImfZipCompressor.cpp | 2 +- 3rdparty/openexr/Imath/ImathBox.cpp | 37 ------------- 3rdparty/openexr/Imath/ImathShear.cpp | 54 ------------------- modules/highgui/src/grfmt_exr.cpp | 9 ++-- 6 files changed, 11 insertions(+), 100 deletions(-) delete mode 100644 3rdparty/openexr/Imath/ImathBox.cpp delete mode 100644 3rdparty/openexr/Imath/ImathShear.cpp diff --git a/3rdparty/openexr/CMakeLists.txt b/3rdparty/openexr/CMakeLists.txt index 3b811e2ee8..60bfa3ca77 100644 --- a/3rdparty/openexr/CMakeLists.txt +++ b/3rdparty/openexr/CMakeLists.txt @@ -37,8 +37,11 @@ endif() source_group("Include" FILES ${lib_hdrs} ) source_group("Src" FILES ${lib_srcs}) -ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch - /wd4018 /wd4099 /wd4100 /wd4101 /wd4127 /wd4189 /wd4244 /wd4245 /wd4267 /wd4305 /wd4334 /wd4389 /wd4512 /wd4701 /wd4702 /wd4706 /wd4800) +ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses) +ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4099 /wd4100 /wd4101 /wd4127 /wd4189 /wd4245 /wd4305 /wd4389 /wd4512 /wd4701 /wd4702 /wd4706 /wd4800) # vs2005 +ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4334) # vs2005 Win64 +ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008 +ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267) # vs2008 Win64 add_library(IlmImf STATIC ${lib_hdrs} ${lib_srcs}) target_link_libraries(IlmImf ${ZLIB_LIBRARIES}) diff --git a/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp b/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp index 270facfce9..8f3fb2ca6b 100644 --- a/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp +++ b/3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp @@ -62,7 +62,7 @@ // string of bytes is compressed with zlib. // //----------------------------------------------------------------------------- -#define ZLIB_WINAPI +//#define ZLIB_WINAPI #include #include diff --git a/3rdparty/openexr/IlmImf/ImfZipCompressor.cpp b/3rdparty/openexr/IlmImf/ImfZipCompressor.cpp index 80cefa1e0d..1a56adf71c 100644 --- a/3rdparty/openexr/IlmImf/ImfZipCompressor.cpp +++ b/3rdparty/openexr/IlmImf/ImfZipCompressor.cpp @@ -39,7 +39,7 @@ // class ZipCompressor // //----------------------------------------------------------------------------- -#define ZLIB_WINAPI +//#define ZLIB_WINAPI #include #include diff --git a/3rdparty/openexr/Imath/ImathBox.cpp b/3rdparty/openexr/Imath/ImathBox.cpp deleted file mode 100644 index 07bddfd3bd..0000000000 --- a/3rdparty/openexr/Imath/ImathBox.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (c) 2004, Industrial Light & Magic, a division of Lucas -// Digital Ltd. LLC -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Industrial Light & Magic nor the names of -// its contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////// - -#include "ImathBox.h" - -// this file is necessary for template instantiation on windows diff --git a/3rdparty/openexr/Imath/ImathShear.cpp b/3rdparty/openexr/Imath/ImathShear.cpp deleted file mode 100644 index 72541f58b9..0000000000 --- a/3rdparty/openexr/Imath/ImathShear.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// -// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas -// Digital Ltd. LLC -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Industrial Light & Magic nor the names of -// its contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////// - - - - -//---------------------------------------------------------------------------- -// -// Specializations of the Shear6 template. -// -//---------------------------------------------------------------------------- - -#include "ImathShear.h" - -namespace Imath { - - - -// empty - - - -} // namespace Imath diff --git a/modules/highgui/src/grfmt_exr.cpp b/modules/highgui/src/grfmt_exr.cpp index ac874ae61b..f01f1fd8cb 100644 --- a/modules/highgui/src/grfmt_exr.cpp +++ b/modules/highgui/src/grfmt_exr.cpp @@ -44,6 +44,10 @@ #ifdef HAVE_OPENEXR +#if defined _MSC_VER && _MSC_VER >= 1200 +# pragma warning( disable: 4100 4244 4267 ) +#endif + #include #include #include @@ -53,11 +57,6 @@ #include "grfmt_exr.hpp" #if defined _MSC_VER && _MSC_VER >= 1200 -#pragma comment(lib, "Half.lib") -#pragma comment(lib, "Iex.lib") -#pragma comment(lib, "IlmImf.lib") -#pragma comment(lib, "IlmThread.lib") -#pragma comment(lib, "Imath.lib") #undef UINT #define UINT ((Imf::PixelType)0)