-if(MSVC AND NOT PYTHON_EXECUTABLE)
+if(WIN32 AND NOT PYTHON_EXECUTABLE)
# search for executable with the same bitness as resulting binaries
# standard FindPythonInterp always prefers executable from system path
# this is really important because we are using the interpreter for numpy search and for choosing the install location
endmacro()
endif()
-#added include directories in such way that directories from the OpenCV source tree go first
+# adds include directories in such way that directories from the OpenCV source tree go first
function(ocv_include_directories)
set(__add_before "")
foreach(dir ${ARGN})
include_directories(BEFORE ${__add_before})
endfunction()
+# clears all passed variables
+macro(ocv_clear_vars)
+ foreach(_var ${ARGN})
+ unset(${_var} CACHE)
+ endforeach()
+endmacro()
# Provides an option that the user can optionally select.
# Can accept condition to control when option is available for user.
set(${LIBNAME}_VERSION_STRING "${${LIBNAME}_VERSION_STRING}.${${LIBNAME}_VERSION_TWEAK}" ${SCOPE})
endif()
else()
- unset(${LIBNAME}_VERSION_MAJOR CACHE)
- unset(${LIBNAME}_VERSION_MINOR CACHE)
- unset(${LIBNAME}_VERSION_PATCH CACHE)
- unset(${LIBNAME}_VERSION_TWEAK CACHE)
- unset(${LIBNAME}_VERSION_STRING CACHE)
+ ocv_clear_vars(${LIBNAME}_VERSION_MAJOR
+ ${LIBNAME}_VERSION_MAJOR
+ ${LIBNAME}_VERSION_MINOR
+ ${LIBNAME}_VERSION_PATCH
+ ${LIBNAME}_VERSION_TWEAK
+ ${LIBNAME}_VERSION_STRING)
endif()
endmacro()
DWORD defStyle = WS_VISIBLE | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU;
int len;
CvRect rect;
+#ifdef HAVE_OPENGL
+ bool useGl;
+ HDC hGLDC;
+ HGLRC hGLRC;
+#endif
cvInitSystem(0,0);
if (flags & CV_WINDOW_OPENGL)
CV_ERROR( CV_OpenGlNotSupported, "Library was built without OpenGL support" );
#else
- bool useGl = false;
- HDC hGLDC = 0;
- HGLRC hGLRC = 0;
+ useGl = false;
+ hGLDC = 0;
+ hGLRC = 0;
if (flags & CV_WINDOW_OPENGL)
createGlContext(hWnd, hGLDC, hGLRC, useGl);