Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.4' into merge-2.4
Browse files Browse the repository at this point in the history
Conflicts:
	cmake/OpenCVModule.cmake
	doc/tutorials/calib3d/camera_calibration/camera_calibration.rst
	doc/tutorials/features2d/feature_detection/feature_detection.rst
	doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.rst
	doc/tutorials/features2d/feature_homography/feature_homography.rst
	modules/core/include/opencv2/core/operations.hpp
	modules/core/src/arithm.cpp
	modules/gpu/perf/perf_video.cpp
	modules/imgproc/include/opencv2/imgproc/imgproc.hpp
	modules/java/generator/gen_java.py
	modules/java/generator/src/cpp/VideoCapture.cpp
	modules/nonfree/src/opencl/surf.cl
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/perf/perf_precomp.hpp
	modules/ocl/src/color.cpp
	modules/ocl/src/filtering.cpp
	modules/ocl/test/test_color.cpp
	modules/ocl/test/test_objdetect.cpp
	modules/python/src2/cv2.cpp
	samples/gpu/CMakeLists.txt
	samples/gpu/super_resolution.cpp
  • Loading branch information
Roman Donchenko committed Aug 19, 2013
2 parents 473ca08 + bed3512 commit f76dd99
Show file tree
Hide file tree
Showing 148 changed files with 1,847 additions and 2,745 deletions.
4 changes: 4 additions & 0 deletions 3rdparty/libpng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif(MSVC)

if (HAVE_WINRT)
add_definitions(-DHAVE_WINRT)
endif()

add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARY})

Expand Down
22 changes: 22 additions & 0 deletions 3rdparty/libpng/opencv-libpng.path
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h
index 07b2b0b..e7824b8 100644
--- a/3rdparty/libpng/pngpriv.h
+++ b/3rdparty/libpng/pngpriv.h
@@ -360,7 +360,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;

/* Memory model/platform independent fns */
#ifndef PNG_ABORT
-# ifdef _WINDOWS_
+# if defined(_WINDOWS_) && !defined(HAVE_WINRT)
# define PNG_ABORT() ExitProcess(0)
# else
# define PNG_ABORT() abort()
@@ -378,7 +378,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
# define png_memcpy _fmemcpy
# define png_memset _fmemset
#else
-# ifdef _WINDOWS_ /* Favor Windows over C runtime fns */
+# if defined(_WINDOWS_) && !defined(HAVE_WINRT) /* Favor Windows over C runtime fns */
# define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_strlen lstrlenA
4 changes: 2 additions & 2 deletions 3rdparty/libpng/pngpriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;

/* Memory model/platform independent fns */
#ifndef PNG_ABORT
# ifdef _WINDOWS_
# if defined(_WINDOWS_) && !defined(HAVE_WINRT)
# define PNG_ABORT() ExitProcess(0)
# else
# define PNG_ABORT() abort()
Expand All @@ -378,7 +378,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
# define png_memcpy _fmemcpy
# define png_memset _fmemset
#else
# ifdef _WINDOWS_ /* Favor Windows over C runtime fns */
# if defined(_WINDOWS_) && !defined(HAVE_WINRT) /* Favor Windows over C runtime fns */
# define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_strlen lstrlenA
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,8 @@ if(DEFINED WITH_GIGEAPI)
endif(DEFINED WITH_GIGEAPI)

if(DEFINED WITH_QUICKTIME)
status(" QuickTime:" WITH_QUICKTIME THEN YES ELSE NO)
status(" QTKit:" WITH_QUICKTIME THEN NO ELSE YES)
status(" QuickTime:" HAVE_QUICKTIME THEN YES ELSE NO)
status(" QTKit:" HAVE_QTKIT THEN YES ELSE NO)
endif(DEFINED WITH_QUICKTIME)

if(DEFINED WITH_UNICAP)
Expand Down
56 changes: 29 additions & 27 deletions cmake/OpenCVCRTLinkage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,39 @@ endif()

#INCLUDE (CheckIncludeFiles)

if (ENABLE_WINRT_MODE)
set(HAVE_WINRT True)
set(HAVE_WINRT FALSE)

# search Windows Platform SDK
message(STATUS "Checking for Windows Platfrom SDK")
GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
if (WINDOWS_SDK_PATH STREQUAL "")
message(ERROR "Windows Platform SDK 8.0 was not found!")
set(HAVE_WINRT False)
endif()
# search Windows Platform SDK
message(STATUS "Checking for Windows Platform SDK")
GET_FILENAME_COMPONENT(WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
if (WINDOWS_SDK_PATH STREQUAL "")
set(HAVE_MSPDK FALSE)
message(STATUS "Windows Platform SDK 8.0 was not found")
else()
set(HAVE_MSPDK TRUE)
endif()

#search for Visual Studio 11.0 install directory
message(STATUS "Checking for Visual Studio 2012")
GET_FILENAME_COMPONENT(VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH CACHE)
if (VISUAL_STUDIO_PATH STREQUAL "")
message(ERROR "Visual Studio 2012 was not found!")
set(HAVE_WINRT False)
endif()
#search for Visual Studio 11.0 install directory
message(STATUS "Checking for Visual Studio 2012")
GET_FILENAME_COMPONENT(VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH CACHE)
if (VISUAL_STUDIO_PATH STREQUAL "")
set(HAVE_MSVC2012 FALSE)
message(STATUS "Visual Studio 2012 was not found")
else()
set(HAVE_MSVC2012 TRUE)
endif()

if (HAVE_WINRT)
TRY_COMPILE(HAVE_WINRT
"${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp"
"${OpenCV_SOURCE_DIR}/cmake/checks/winrttest.cpp"
CMAKE_FLAGS "\"kernel.lib\" \"user32.lib\""
OUTPUT_VARIABLE OUTPUT)
endif()
TRY_COMPILE(HAVE_WINRT_SDK
"${OPENCV_BINARY_DIR}/CMakeFiles/CMakeTmp"
"${OpenCV_SOURCE_DIR}/cmake/checks/winrttest.cpp")

if (HAVE_WINRT)
add_definitions(/DWINVER=0x0602 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=0x0602)
endif()
endif(ENABLE_WINRT_MODE)
if (ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK)
set(HAVE_WINRT TRUE)
endif()

if (HAVE_WINRT)
add_definitions(/DWINVER=0x0602 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=0x0602)
endif()

if(NOT BUILD_SHARED_LIBS AND BUILD_WITH_STATIC_CRT)
foreach(flag_var
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenCVFindLibsGUI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ endif(WITH_OPENGL)
if(APPLE)
if(WITH_CARBON)
set(HAVE_CARBON YES)
elif(NOT IOS)
elseif(NOT IOS)
set(HAVE_COCOA YES)
endif()
endif()
2 changes: 2 additions & 0 deletions cmake/OpenCVFindLibsVideo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,6 @@ endif()
# --- QuickTime ---
if(WITH_QUICKTIME)
set(HAVE_QUICKTIME YES)
elseif(APPLE)
set(HAVE_QTKIT YES)
endif()
18 changes: 15 additions & 3 deletions cmake/OpenCVModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,16 @@ endmacro()
# ocv_create_module(<extra link dependencies>)
# ocv_create_module(SKIP_LINK)
macro(ocv_create_module)
# The condition we ought to be testing here is whether ocv_add_precompiled_headers will
# be called at some point in the future. We can't look into the future, though,
# so this will have to do.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp")
get_native_precompiled_header(${the_module} precomp.hpp)
endif()

add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
"${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp")
"${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp"
${${the_module}_pch})
if(NOT the_module STREQUAL opencv_ts)
set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS OPENCV_NOSTL)
endif()
Expand Down Expand Up @@ -640,7 +648,9 @@ function(ocv_add_perf_tests)
set(OPENCV_PERF_${the_module}_SOURCES ${perf_srcs} ${perf_hdrs})
endif()

add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES})
get_native_precompiled_header(${the_target} test_precomp.hpp)

add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch})
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})
add_dependencies(opencv_perf_tests ${the_target})

Expand Down Expand Up @@ -688,7 +698,9 @@ function(ocv_add_accuracy_tests)
set(OPENCV_TEST_${the_module}_SOURCES ${test_srcs} ${test_hdrs})
endif()

add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES})
get_native_precompiled_header(${the_target} test_precomp.hpp)

add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
add_dependencies(opencv_tests ${the_target})

Expand Down
13 changes: 3 additions & 10 deletions cmake/OpenCVPCHSupport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,9 @@ ENDMACRO(ADD_PRECOMPILED_HEADER)
MACRO(GET_NATIVE_PRECOMPILED_HEADER _targetName _input)

if(CMAKE_GENERATOR MATCHES "^Visual.*$")
SET(_dummy_str "#include \"${_input}\"\n"
"// This is required to suppress LNK4221. Very annoying.\n"
"void *g_${_targetName}Dummy = 0\;\n")
set(_dummy_str "#include \"${_input}\"\n")

# Use of cxx extension for generated files (as Qt does)
SET(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cxx)
set(${_targetName}_pch ${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch.cpp)
if(EXISTS ${${_targetName}_pch})
# Check if contents is the same, if not rewrite
# todo
Expand Down Expand Up @@ -344,11 +341,7 @@ ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER)

macro(ocv_add_precompiled_header_to_target the_target pch_header)
if(PCHSupport_FOUND AND ENABLE_PRECOMPILED_HEADERS AND EXISTS "${pch_header}")
if(CMAKE_GENERATOR MATCHES Visual)
string(REGEX REPLACE "hpp$" "cpp" ${the_target}_pch "${pch_header}")
add_native_precompiled_header(${the_target} ${pch_header})
unset(${the_target}_pch)
elseif(CMAKE_GENERATOR MATCHES Xcode)
if(CMAKE_GENERATOR MATCHES "^Visual" OR CMAKE_GENERATOR MATCHES Xcode)
add_native_precompiled_header(${the_target} ${pch_header})
elseif(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_GENERATOR MATCHES "Makefiles|Ninja")
add_precompiled_header(${the_target} ${pch_header})
Expand Down
3 changes: 3 additions & 0 deletions cmake/templates/cvconfig.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@
/* QuickTime video libraries */
#cmakedefine HAVE_QUICKTIME

/* QTKit video libraries */
#cmakedefine HAVE_QTKIT

/* Intel Threading Building Blocks */
#cmakedefine HAVE_TBB

Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if(BUILD_DOCS AND HAVE_SPHINX)
set(toc_file "${OPENCV_MODULE_opencv_${mod}_LOCATION}/doc/${mod}.rst")
if(EXISTS "${toc_file}")
file(RELATIVE_PATH toc_file "${OpenCV_SOURCE_DIR}/modules" "${toc_file}")
set(OPENCV_REFMAN_TOC "${OPENCV_REFMAN_TOC} ${toc_file}\r\n")
set(OPENCV_REFMAN_TOC "${OPENCV_REFMAN_TOC} ${toc_file}\n")
endif()
endforeach()

Expand Down
Loading

0 comments on commit f76dd99

Please sign in to comment.