]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
* fixed wrong GCC flags issue for CMAKE_BUILD_TYPE being:
authorjlblanco <jlblanco@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Mon, 11 May 2009 10:37:14 +0000 (10:37 +0000)
committerjlblanco <jlblanco@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Mon, 11 May 2009 10:37:14 +0000 (10:37 +0000)
- "Debug"
- "Release"
- (empty): Release is assumed.

* Fixed compilation error with mingw related to an inline method of cv::Vector

git-svn-id: https://code.ros.org/svn/opencv/trunk@1751 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/CMakeLists.txt
opencv/include/opencv/cxcore.hpp
opencv/include/opencv/cxoperations.hpp

index e7a4705eb9eb72aa6109a533082fc3dcd2664c43..61bf1fde9c687f8cc41b11d7bd759012d873a58b 100644 (file)
@@ -516,9 +516,14 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${OPENCV_E
 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG}")
 
 # If GCC, if the user does not setup CMAKE_BUILD_TYPE, assume it's Release:
-if (CMAKE_COMPILER_IS_GNUCXX AND NOT "${CMAKE_BUILD_TYPE}")
-       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}")
-       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_RELEASE}")
+if (CMAKE_COMPILER_IS_GNUCXX)
+       if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "")
+               set(CMAKE_CXX_FLAGS "")  # JL: Check if the original contents were not null!
+               set(CMAKE_C_FLAGS "")
+       else()
+               set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}")
+               set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_RELEASE}")
+       endif()
 endif()
 
 
index f126bd9c1bcea745d1c0e5f6dc2c18fa38fd9e7f..17f347de13c8211377ccfa025d920f80f514f7af 100644 (file)
@@ -591,8 +591,8 @@ public:
     Vector(const Vector& d);
     Vector(const Vector& d, const Range& r);
 
-    Vector& operator = (const Vector& d);
-
+    inline Vector<_Tp>& operator = (const Vector& d)
+    {        if( this == &d )            return *this;        if( d.hdr.refcount )            ++*d.hdr.refcount;        release();        hdr = d.hdr;        return *this;    }
     ~Vector();
     Vector clone() const;
 
index 43f3f3b5f92ee79f3f00bc6a7740b1d6af0da8ae..47aa476dafcc37e6a95167a315aa14c4223c5416 100644 (file)
@@ -902,16 +902,6 @@ template <typename _Tp> inline Vector<_Tp>::Vector(const Vector& d, const Range&
     }
 }
 
-template <typename _Tp> inline Vector<_Tp>& Vector<_Tp>::operator = (const Vector& d)
-{
-    if( this == &d )
-        return *this;
-    if( d.hdr.refcount )
-        ++*d.hdr.refcount;
-    release();
-    hdr = d.hdr;
-    return *this;
-}
 
 template <typename _Tp> inline Vector<_Tp>::~Vector() { release(); }
 template <typename _Tp> inline Vector<_Tp> Vector<_Tp>::clone() const