Merged the trunk r8384:8407 (inclusive)

This commit is contained in:
Andrey Kamaev
2012-05-30 08:04:37 +00:00
parent 72d2311edf
commit 7b5a45eac4
21 changed files with 1169 additions and 1169 deletions

View File

@@ -1,3 +1,18 @@
if(MINGW)
# mingw compiler is known to produce unstable SSE code with -O3 hence we are trying to use -O2 instead
if(CMAKE_COMPILER_IS_GNUCXX)
foreach(flags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
string(REPLACE "-O3" "-O2" ${flags} "${${flags}}")
endforeach()
endif()
if(CMAKE_COMPILER_IS_GNUCC)
foreach(flags CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_DEBUG)
string(REPLACE "-O3" "-O2" ${flags} "${${flags}}")
endforeach()
endif()
endif()
if(MSVC)
if(CMAKE_CXX_FLAGS STREQUAL CMAKE_CXX_FLAGS_INIT)
# override cmake default exception handling option
@@ -14,18 +29,18 @@ set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "")
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG "")
if(MINGW)
# mingw compiler is known to produce unstable SSE code
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838
# here we are trying to workaround the problem
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-mstackrealign HAVE_STACKREALIGN_FLAG)
if(HAVE_STACKREALIGN_FLAG)
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -mstackrealign")
else()
# CHECK_CXX_COMPILER_FLAG(-mstackrealign HAVE_STACKREALIGN_FLAG)
# if(HAVE_STACKREALIGN_FLAG)
# set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -mstackrealign")
#else()
CHECK_CXX_COMPILER_FLAG(-mpreferred-stack-boundary=2 HAVE_PREFERRED_STACKBOUNDARY_FLAG)
if(HAVE_PREFERRED_STACKBOUNDARY_FLAG)
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -mstackrealign")
endif()
endif()
#endif()
endif()
if(CMAKE_COMPILER_IS_GNUCXX)

View File

@@ -8,7 +8,7 @@ file(TO_CMAKE_PATH "$ENV{HOME}" HOME_ENV_PATH)
if(CMAKE_HOST_WIN32)
set(ANDROID_SDK_OS windows)
elseif(CMAKE_HOST_APPLE)
set(ANDROID_SDK_OS mac)
set(ANDROID_SDK_OS macosx)
else()
set(ANDROID_SDK_OS linux)
endif()

View File

@@ -1,4 +1,4 @@
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

View File

@@ -11,7 +11,7 @@ if(NOT COMMAND find_host_program)
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})
@@ -25,6 +25,12 @@ function(ocv_include_directories)
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.
@@ -352,10 +358,11 @@ macro(ocv_parse_header2 LIBNAME HDR_PATH VARNAME SCOPE)
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()