do not use WIN64/_WIN64 anymore - CMake did not set it anyway. Use WIN32 + __x86_64...
authorVadim Pisarevsky <no@email>
Fri, 16 Jul 2010 22:38:57 +0000 (22:38 +0000)
committerVadim Pisarevsky <no@email>
Fri, 16 Jul 2010 22:38:57 +0000 (22:38 +0000)
24 files changed:
CMakeLists.txt
cvconfig.h.cmake
modules/calib3d/src/modelest.cpp
modules/core/include/opencv2/core/internal.hpp
modules/core/include/opencv2/core/operations.hpp
modules/core/include/opencv2/core/types_c.h
modules/core/src/dxt.cpp
modules/core/src/system.cpp
modules/ffmpeg/ffopencv.cpp
modules/highgui/CMakeLists.txt
modules/highgui/include/opencv2/highgui/highgui_c.h
modules/highgui/src/cap.cpp
modules/highgui/src/cap_dshow.cpp
modules/highgui/src/cap_mil.cpp
modules/highgui/src/cap_pvapi.cpp
modules/highgui/src/cap_vfw.cpp
modules/highgui/src/precomp.hpp
modules/highgui/src/window_QT.cpp
modules/highgui/src/window_w32.cpp
modules/ml/include/opencv2/ml/ml.hpp
tests/cv/src/highguitest.cpp
tests/cxcore/src/adatastruct.cpp
tests/cxcore/src/cxcoretest.h
tests/cxts/_cxts.h

index 769d14d..41ebe6c 100644 (file)
@@ -284,6 +284,10 @@ set(WITH_TBB OFF CACHE BOOL "Include TBB support")
 set(WITH_EIGEN2 ON CACHE BOOL "Include Eigen2 support")\r
 set(WITH_CUDA OFF CACHE BOOL "Include NVidia Cuda Runtime support")\r
 \r
+if(WIN32)\r
+       set(WITH_VIDEOINPUT ON CACHE BOOL "Enable VideoInput support")\r
+endif()\r
+\r
 # ===================================================\r
 # Macros that checks if module have been installed.\r
 # After it adds module to build and define\r
@@ -609,7 +613,7 @@ if (WITH_TBB)
     endif()\r
 endif()\r
 \r
-############################### TBB ################################\r
+############################### CUDA ################################\r
 \r
 if (WITH_CUDA)\r
        find_package(CUDA)      \r
@@ -619,6 +623,15 @@ if (WITH_CUDA)
        endif()\r
 endif()\r
 \r
+############################### VideoInput ################################\r
+\r
+if (WIN32 AND WITH_VIDEOINPUT)\r
+       if(CMAKE_CXX_COMPILER MATCHES "dw2")\r
+       else()\r
+               set(HAVE_VIDEOINPUT 1)\r
+       endif()\r
+endif()\r
+\r
 ############################## Eigen2 ##############################\r
 \r
 if(WITH_EIGEN2)\r
@@ -1241,6 +1254,16 @@ message(STATUS "  Video I/O:                   QTKit")
 endif()\r
 endif()\r
 \r
+if(WIN32)\r
+message(STATUS "")\r
+message(STATUS "  Video I/O: ")\r
+if(HAVE_VIDEOINPUT)\r
+message(STATUS "    VideoInput:                1")\r
+else()\r
+message(STATUS "    VideoInput:                0")\r
+endif()\r
+endif()\r
+\r
 message(STATUS "")\r
 message(STATUS "  Interfaces: ")\r
 message(STATUS "    Python:                    ${BUILD_NEW_PYTHON_SUPPORT}")\r
index 5fb2d88..ebe9528 100644 (file)
 
 /* NVidia Cuda Runtime API*/
 #cmakedefine HAVE_CUDA
+
+/* VideoInput library */
+#cmakedefine HAVE_VIDEOINPUT
+
index 3ffeed8..4c4b00e 100644 (file)
@@ -459,7 +459,7 @@ int cv::estimateAffine3D(const Mat& from, const Mat& to, Mat& out, vector<uchar>
                from.depth() == CV_32F && to.depth() == CV_32F &&
                ((from.rows == 1 && from.channels() == 3) || from.cols*from.channels() == 3) &&
                ((to.rows == 1 && to.channels() == 3) || to.cols*to.channels() == 3) &&
-               count == (size_t)to.cols*to.rows*to.channels()/3);
+               count == to.cols*to.rows*to.channels()/3);
 
     out.create(3, 4, CV_64F); 
     outliers.resize(count);
index cfb6c3e..3347576 100644 (file)
@@ -264,7 +264,7 @@ CV_INLINE IppiSize ippiSize(int width, int height)
 #ifdef __GNUC__
     #undef alloca
     #define alloca __builtin_alloca
-#elif defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64 || \
+#elif defined WIN32 || defined _WIN32 || \
       defined WINCE || defined _MSC_VER || defined __BORLANDC__
     #include <malloc.h>
 #elif defined HAVE_ALLOCA_H
index 0e8f49a..92c4c7b 100644 (file)
@@ -74,7 +74,7 @@
     
 #elif defined WIN32 || defined _WIN32
 
-  #if defined _MSC_VER && !defined WIN64 && !defined _WIN64
+  #if defined _MSC_VER && defined _M_IX86
     static inline int CV_XADD( int* addr, int delta )
     {
         int tmp;
index b58a8fb..d5db676 100644 (file)
@@ -71,7 +71,7 @@
   #endif
 
   #if (_MSC_VER >= 1400 && defined _M_X64) || (__GNUC__ >= 4 && defined __x86_64__)
-    #if defined WIN64
+    #if defined WIN32
                #include <intrin.h>
        #endif
     #include <emmintrin.h>
@@ -85,7 +85,7 @@
 
   #ifdef HAVE_IPL
       #ifndef __IPL_H__
-          #if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
+          #if defined WIN32 || defined _WIN32
               #include <ipl.h>
           #else
               #include <ipl/ipl.h>
@@ -96,7 +96,7 @@
   #endif
 #endif // SKIP_INCLUDES
 
-#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
+#if defined WIN32 || defined _WIN32
     #define CV_CDECL __cdecl
     #define CV_STDCALL __stdcall
 #else
 #ifndef CV_INLINE
 #if defined __cplusplus
     #define CV_INLINE inline
-#elif (defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64 || defined WINCE) && !defined __GNUC__
+#elif (defined WIN32 || defined _WIN32 || defined WINCE) && !defined __GNUC__
     #define CV_INLINE __inline
 #else
     #define CV_INLINE static
 #endif
 #endif /* CV_INLINE */
 
-#if (defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64 || defined WINCE) && defined CVAPI_EXPORTS
+#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS
     #define CV_EXPORTS __declspec(dllexport)
 #else
     #define CV_EXPORTS
index 60ebe72..aa5938d 100644 (file)
@@ -45,7 +45,7 @@ namespace cv
 {
 
 // On Win64 optimized versions of DFT and DCT fail the tests (fixed in VS2010)
-#if (defined WIN64 || defined _WIN64) && defined _MSC_VER && _MSC_VER < 1600
+#if defined _MSC_VER && !defined CV_ICC && defined _M_X64 && _MSC_VER < 1600
 #pragma optimize("", off)
 #endif
 
index 55b1ecd..c04469b 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "precomp.hpp"
 
-#if defined WIN32 || defined WIN64 || defined _WIN64 || defined WINCE
+#if defined WIN32 || defined _WIN32 || defined WINCE
 #include <tchar.h>
 #if defined _MSC_VER
   #if _MSC_VER >= 1400
@@ -184,7 +184,7 @@ bool useOptimized()
     
 int64 getTickCount()
 {
-#if defined WIN32 || defined WIN64 || defined _WIN64 || defined WINCE
+#if defined WIN32 || defined _WIN32 || defined WINCE
     LARGE_INTEGER counter;
     QueryPerformanceCounter( &counter );
     return (int64)counter.QuadPart;
@@ -204,7 +204,7 @@ int64 getTickCount()
 
 double getTickFrequency()
 {
-#if defined WIN32 || defined WIN64 || defined _WIN64 || defined WINCE
+#if defined WIN32 || defined _WIN32 || defined WINCE
     LARGE_INTEGER freq;
     QueryPerformanceFrequency(&freq);
     return (double)freq.QuadPart;
@@ -266,7 +266,7 @@ int64 getCPUTickCount(void)
 
 #endif
 
-#elif defined _MSC_VER && defined WIN32 && !defined _WIN64
+#elif defined _MSC_VER && defined WIN32 && defined _M_IX86
 
 int64 getCPUTickCount(void)
 {
@@ -394,7 +394,7 @@ redirectError( CvErrorCallback errCallback, void* userdata, void** prevUserdata)
 cvGuiBoxReport( int code, const char *func_name, const char *err_msg,
                 const char *file, int line, void* )
 {
-#if (!defined WIN32 && !defined WIN64) || defined WINCE
+#if (!defined WIN32 && !defined _WIN32) || defined WINCE
     return cvStdErrReport( code, func_name, err_msg, file, line, 0 );
 #else
     if( code != CV_StsBackTrace && code != CV_StsAutoTrace )
index 0d56ce7..6fe1f05 100644 (file)
@@ -533,7 +533,7 @@ extern "C" { __declspec(dllexport) unsigned int __lc_codepage = 0; }
 #pragma comment(lib, "libgcc_.a")
 #pragma comment(lib, "libmingwex_.a")
 #pragma comment(lib, "libcoldname_.a")
-#ifdef WIN64
+#ifdef _M_X64
 #pragma comment(lib, "libavformat64.a")
 #pragma comment(lib, "libavcodec64.a")
 #pragma comment(lib, "libavutil64.a")
index 14e0895..0f61330 100644 (file)
@@ -298,9 +298,15 @@ if(WIN32)
 
        if(MINGW)
                if(MINGW64)
-                       target_link_libraries(${the_target} msvfw32 avifil32 avicap32 winmm videoInput64 strmiids)
+                       target_link_libraries(${the_target} msvfw32 avifil32 avicap32 winmm)
+                       if(HAVE_VIDEOINPUT)
+                               target_link_libraries(${the_target} videoInput64 strmiids)
+                       endif()
                else()
-                       target_link_libraries(${the_target} vfw32 winmm videoInput strmiids)
+                       target_link_libraries(${the_target} vfw32 winmm)
+                       if(HAVE_VIDEOINPUT)
+                               target_link_libraries(${the_target} videoInput strmiids)
+                       endif()
                endif()  
     endif()
 endif()
index b76e67f..3e6df3e 100644 (file)
@@ -43,7 +43,7 @@
 #define __OPENCV_HIGHGUI_H__
 
 #include "opencv2/core/core_c.h"
-#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
+#if defined WIN32 || defined _WIN32
        #include <windows.h>
        #undef min
        #undef max
index cbd7554..1fff192 100644 (file)
@@ -45,7 +45,7 @@
 #pragma warning( disable: 4711 )
 #endif
 
-#if (defined WIN64 || defined _WIN64) && defined _MSC_VER && !defined __ICL
+#if defined _M_X64 && defined _MSC_VER && !defined CV_ICC
 #pragma optimize("",off)
 #endif
 
index f3ad3db..20320ce 100644 (file)
@@ -41,7 +41,8 @@
 
 #include "precomp.hpp"
 
-#ifdef HAVE_VIDEOINPUT
+#if defined HAVE_VIDEOINPUT && (_MSC_VER >= 1400 || defined __GNUC__)
+
 #include "videoinput.h"
 
 /********************* Capturing video from camera via VFW *********************/
@@ -183,7 +184,11 @@ CvCapture* cvCreateCameraCapture_DShow( int index )
 }
 
 #ifdef _MSC_VER
+#if defined _M_X64
+#pragma comment(lib, "videoInput64.lib")
+#else
 #pragma comment(lib, "videoInput.lib")
 #endif
+#endif
 
 #endif
index 32e827a..f2797e2 100644 (file)
@@ -48,7 +48,7 @@
   #pragma comment(lib,"milmet2.lib")
 #endif
 
-#if defined WIN64 && defined EM64T && defined _MSC_VER && !defined __ICL
+#if defined _M_X64
   #pragma optimize("",off)
 #endif
 
index ddb05e1..f313ac9 100644 (file)
@@ -50,9 +50,9 @@
 #define _LINUX
 #endif
 
-#if defined(_x64) || defined (__x86_64) || defined (_WIN64)
+#if defined(_x64) || defined (__x86_64) || defined (_M_X64)
 #define _x64 1
-#elif defined(_x86) || defined(__i386) || defined (_WIN32)
+#elif defined(_x86) || defined(__i386) || defined (_M_IX86)
 #define _x86 1
 #endif
 
index 016f572..8721148 100644 (file)
@@ -52,7 +52,7 @@
 #define capSendMessage(hwnd,m,w,l) (IsWindow(hwnd)?SendMessage(hwnd,m,w,l):0)
 #endif
 
-#if (defined WIN64 || defined _WIN64) && defined _MSC_VER && !defined __ICL
+#if defined _M_X64
 #pragma optimize("",off)
 #endif
 
index 0d8764d..6e1a3d7 100644 (file)
@@ -103,13 +103,6 @@ struct CvVideoWriter
 #if defined WIN32 || defined _WIN32
 #define HAVE_VFW 1
 
-#if (_MSC_VER >= 1400 || defined __GNUC__) && !defined WIN64 && !defined _WIN64
-#define HAVE_VIDEOINPUT 1
-#endif
-
-/* uncomment to enable OpenEXR codec (will not compile under MSVC6) */
-//#define HAVE_OPENEXR 1
-
 /* uncomment to enable CMUCamera1394 fireware camera module */
 //#define HAVE_CMU1394 1
 #endif
index 1f5833e..5d53a21 100755 (executable)
@@ -262,7 +262,7 @@ CV_IMPL int cvWaitKey( int arg )
                                waitCondition.wait(&dummy, 2);
                                */
 
-#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
+#if defined WIN32 || defined _WIN32
                sleep(2);
 #else
                usleep(2);//to decrease CPU usage
index aa1603c..04cdde1 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "precomp.hpp"
 
-#if defined WIN32 || defined WIN64 || defined _WIN64
+#if defined WIN32 || defined _WIN32
 
 #if _MSC_VER >= 1200
 #pragma warning( disable: 4710 )
@@ -57,7 +57,7 @@
 static const char* trackbar_text =
 "                                                                                             ";
 
-#if defined WIN64 || defined _WIN64
+#if defined _M_X64 || defined __x86_64
 
 #define icvGetWindowLongPtr GetWindowLongPtr
 #define icvSetWindowLongPtr( hwnd, id, ptr ) SetWindowLongPtr( hwnd, id, (LONG_PTR)(ptr) )
index 33e4cd8..1768a2d 100644 (file)
   #include "opencv2/core/core.hpp"
   #include <limits.h>
 
-  #if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
+  #if defined WIN32 || defined _WIN32
     #include <windows.h>
   #endif
 
 #else // SKIP_INCLUDES
 
-  #if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
+  #if defined WIN32 || defined _WIN32
     #define CV_CDECL __cdecl
     #define CV_STDCALL __stdcall
   #else
   #ifndef CV_INLINE
     #if defined __cplusplus
       #define CV_INLINE inline
-    #elif (defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && !defined __GNUC__
+    #elif (defined WIN32 || defined _WIN32) && !defined __GNUC__
       #define CV_INLINE __inline
     #else
       #define CV_INLINE static
     #endif
   #endif /* CV_INLINE */
 
-  #if (defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && defined CVAPI_EXPORTS
+  #if (defined WIN32 || defined _WIN32) && defined CVAPI_EXPORTS
     #define CV_EXPORTS __declspec(dllexport)
   #else
     #define CV_EXPORTS
index 0ad0281..f4b9843 100644 (file)
@@ -51,7 +51,7 @@
 using namespace cv;\r
 using namespace std;\r
 \r
-#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64\r
+#if defined WIN32 || defined _WIN32\r
 //#if 0\r
     \r
 #else\r
index fe1aeff..74c9547 100644 (file)
@@ -2009,7 +2009,7 @@ void CxCore_GraphTest::run( int )
         struct_idx = iter = -1;
         t = cvTsRandReal(rng)*(max_log_storage_block_size - min_log_storage_block_size) + min_log_storage_block_size;
         int block_size = cvRound( exp(t * CV_LOG2) );
-        block_size = MAX(block_size, sizeof(CvGraph) + sizeof(CvMemBlock));
+        block_size = MAX(block_size, (int)(sizeof(CvGraph) + sizeof(CvMemBlock)));
         
         storage = cvCreateMemStorage(block_size);
 
index e528396..84858c6 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef _CXCORE_TEST_H_
 #define _CXCORE_TEST_H_
 
-#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
+#if defined WIN32 || defined _WIN32
 #include <windows.h>
 #undef min
 #undef max
index e523fed..e2a53cf 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef __CXTS_INTERNAL_H__
 #define __CXTS_INTERNAL_H__
 
-#if (defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && (_MSC_VER >= 1200 || defined _ICL)
+#if (defined WIN32 || defined _WIN32) && (_MSC_VER >= 1200 || defined _ICL)
 #pragma warning( disable: 4251 4514 4996 )
 #endif