Fix openexr build with MSVC
authorAndrey Kamaev <andrey.kamaev@itseez.com>
Sat, 25 Aug 2012 13:12:17 +0000 (17:12 +0400)
committerAndrey Kamaev <andrey.kamaev@itseez.com>
Sun, 2 Sep 2012 16:44:07 +0000 (20:44 +0400)
3rdparty/openexr/CMakeLists.txt
3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp
3rdparty/openexr/IlmImf/ImfZipCompressor.cpp
3rdparty/openexr/Imath/ImathBox.cpp [deleted file]
3rdparty/openexr/Imath/ImathShear.cpp [deleted file]
modules/highgui/src/grfmt_exr.cpp

index 3b811e2..60bfa3c 100644 (file)
@@ -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})
index 270facf..8f3fb2c 100644 (file)
@@ -62,7 +62,7 @@
 //     string of bytes is compressed with zlib.
 //
 //-----------------------------------------------------------------------------
-#define ZLIB_WINAPI 
+//#define ZLIB_WINAPI 
 
 #include <ImfPxr24Compressor.h>
 #include <ImfHeader.h>
index 80cefa1..1a56adf 100644 (file)
@@ -39,7 +39,7 @@
 //     class ZipCompressor
 //
 //-----------------------------------------------------------------------------
-#define ZLIB_WINAPI
+//#define ZLIB_WINAPI
 
 #include <ImfZipCompressor.h>
 #include <ImfCheckedArithmetic.h>
diff --git a/3rdparty/openexr/Imath/ImathBox.cpp b/3rdparty/openexr/Imath/ImathBox.cpp
deleted file mode 100644 (file)
index 07bddfd..0000000
+++ /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 (file)
index 72541f5..0000000
+++ /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<T> template.
-//
-//----------------------------------------------------------------------------
-
-#include "ImathShear.h"
-
-namespace Imath {
-
-
-
-// empty
-
-
-
-} // namespace Imath
index ac874ae..f01f1fd 100644 (file)
 
 #ifdef HAVE_OPENEXR
 
+#if defined _MSC_VER && _MSC_VER >= 1200
+#  pragma warning( disable: 4100 4244 4267 )
+#endif
+
 #include <ImfHeader.h>
 #include <ImfInputFile.h>
 #include <ImfOutputFile.h>
 #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)