From be1728fba16120fd89fc10f823278bb8f630bab3 Mon Sep 17 00:00:00 2001 From: StevenPuttemans Date: Wed, 28 Jan 2015 13:56:29 +0100 Subject: [PATCH 01/14] fixing tutorial errors master branch --- .../histograms/template_matching/template_matching.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tutorials/imgproc/histograms/template_matching/template_matching.markdown b/doc/tutorials/imgproc/histograms/template_matching/template_matching.markdown index 58774c6d4b..9cf4e216a4 100644 --- a/doc/tutorials/imgproc/histograms/template_matching/template_matching.markdown +++ b/doc/tutorials/imgproc/histograms/template_matching/template_matching.markdown @@ -146,7 +146,7 @@ Explanation int result_cols = img.cols - templ.cols + 1; int result_rows = img.rows - templ.rows + 1; - result.create( result_cols, result_rows, CV_32FC1 ); + result.create( result_rows, result_cols, CV_32FC1 ); @endcode -# Perform the template matching operation: @code{.cpp} From 99aaf4030a221ffd15851a0e7723fef45aaf9ff9 Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Mon, 2 Feb 2015 16:55:11 +0800 Subject: [PATCH 02/14] Remove unnecessary barrier in runHaarClassifier(). Signed-off-by: Yan Wang --- modules/objdetect/src/opencl/cascadedetect.cl | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/objdetect/src/opencl/cascadedetect.cl b/modules/objdetect/src/opencl/cascadedetect.cl index 465fa0c65d..854a7f617d 100644 --- a/modules/objdetect/src/opencl/cascadedetect.cl +++ b/modules/objdetect/src/opencl/cascadedetect.cl @@ -140,7 +140,6 @@ void runHaarClassifier( int dy = i/SUM_BUF_STEP, dx = i - dy*SUM_BUF_STEP; vstore4(vload4(0, psum0 + mad24(dy, sumstep, dx)), 0, ibuf+i); } - barrier(CLK_LOCAL_MEM_FENCE); #endif if( lidx == 0 ) From 79416cdf1066e5a3c3cf830530c873bb1cc30cb4 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 8 Feb 2015 13:08:14 +0300 Subject: [PATCH 03/14] ocl: disable OpenCL by default for Android builds --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 494b851f35..5146a12bd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,7 +161,7 @@ OCV_OPTION(WITH_MSMF "Build VideoIO with Media Foundation support" OFF OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID) ) OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_CLP "Include Clp support (EPL)" OFF) -OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" ON IF (NOT IOS) ) +OCV_OPTION(WITH_OPENCL "Include OpenCL Runtime support" NOT ANDROID IF (NOT IOS) ) OCV_OPTION(WITH_OPENCL_SVM "Include OpenCL Shared Virtual Memory support" OFF ) # experimental OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON IF (NOT ANDROID AND NOT IOS) ) OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON IF (NOT ANDROID AND NOT IOS) ) From a5a510da4bbb0bb73b4ec82570f1d60bbe1af481 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Mon, 19 Jan 2015 18:03:29 +0300 Subject: [PATCH 04/14] Support for compound modules, support for contrib_world --- apps/createsamples/CMakeLists.txt | 2 +- apps/traincascade/CMakeLists.txt | 2 +- cmake/OpenCVGenPkgconfig.cmake | 2 + cmake/OpenCVModule.cmake | 135 ++++++++++++++++++++++-------- cmake/OpenCVUtils.cmake | 17 ++++ doc/CMakeLists.txt | 2 +- modules/java/CMakeLists.txt | 8 +- modules/python/common.cmake | 3 +- platforms/ios/build_framework.py | 18 ++-- 9 files changed, 139 insertions(+), 50 deletions(-) diff --git a/apps/createsamples/CMakeLists.txt b/apps/createsamples/CMakeLists.txt index 591a0b8bca..8acd288ac1 100644 --- a/apps/createsamples/CMakeLists.txt +++ b/apps/createsamples/CMakeLists.txt @@ -35,5 +35,5 @@ if(INSTALL_CREATE_DISTRIB) install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev) endif() else() - install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev) + install(TARGETS ${the_target} OPTIONAL RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev) endif() diff --git a/apps/traincascade/CMakeLists.txt b/apps/traincascade/CMakeLists.txt index 59d48172da..78101c0bc5 100644 --- a/apps/traincascade/CMakeLists.txt +++ b/apps/traincascade/CMakeLists.txt @@ -35,5 +35,5 @@ if(INSTALL_CREATE_DISTRIB) install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} CONFIGURATIONS Release COMPONENT dev) endif() else() - install(TARGETS ${the_target} RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev) + install(TARGETS ${the_target} OPTIONAL RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT dev) endif() diff --git a/cmake/OpenCVGenPkgconfig.cmake b/cmake/OpenCVGenPkgconfig.cmake index fa57db9d3c..a8686e89cd 100644 --- a/cmake/OpenCVGenPkgconfig.cmake +++ b/cmake/OpenCVGenPkgconfig.cmake @@ -37,6 +37,7 @@ ocv_list_reverse(OpenCV_EXTRA_COMPONENTS) #build the list of components set(OpenCV_LIB_COMPONENTS_ "") foreach(CVLib ${OpenCV_LIB_COMPONENTS}) + if (TARGET ${CVLib}) get_target_property(libpath ${CVLib} LOCATION_${CMAKE_BUILD_TYPE}) get_filename_component(libname "${libpath}" NAME) @@ -52,6 +53,7 @@ foreach(CVLib ${OpenCV_LIB_COMPONENTS}) endif() set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} \${exec_prefix}/${installDir}/${libname}") + endif() endforeach() # add extra dependencies required for OpenCV diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index fa02919633..90068dedef 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -19,6 +19,8 @@ # OPENCV_MODULE_${the_module}_PRIVATE_REQ_DEPS # OPENCV_MODULE_${the_module}_PRIVATE_OPT_DEPS # OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD +# OPENCV_MODULE_${the_module}_CUDA_OBJECTS - compiled CUDA objects list +# OPENCV_MODULE_${the_module}_CHILDREN - list of submodules for compound modules # HAVE_${the_module} - for fast check of module availability # To control the setup of the module you could also set: @@ -26,6 +28,7 @@ # OPENCV_MODULE_TYPE - STATIC|SHARED - set to force override global settings for current module # OPENCV_MODULE_IS_PART_OF_WORLD - ON|OFF (default ON) - should the module be added to the opencv_world? # BUILD_${the_module}_INIT - ON|OFF (default ON) - initial value for BUILD_${the_module} +# OPENCV_MODULE_CHILDREN - list of submodules # The verbose template for OpenCV module: # @@ -158,13 +161,9 @@ macro(ocv_add_module _name) endif() # add self to the world dependencies - # add to world only extra modules (ON) or only main modules (OFF) - set(__expected_extra 0) - if (OPENCV_EXTRA_WORLD) - set(__expected_extra 1) - endif() - if((NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD AND NOT OPENCV_MODULE_${the_module}_CLASS STREQUAL "BINDINGS" - AND __expected_extra EQUAL OPENCV_PROCESSING_EXTRA_MODULES) + if((NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD + AND NOT OPENCV_MODULE_${the_module}_CLASS STREQUAL "BINDINGS" + AND NOT OPENCV_PROCESSING_EXTRA_MODULES) OR OPENCV_MODULE_IS_PART_OF_WORLD ) set(OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD ON CACHE INTERNAL "") @@ -179,7 +178,8 @@ macro(ocv_add_module _name) set(OPENCV_MODULES_DISABLED_USER ${OPENCV_MODULES_DISABLED_USER} "${the_module}" CACHE INTERNAL "List of OpenCV modules explicitly disabled by user") endif() - # TODO: add submodules if any + # add submodules if any + set(OPENCV_MODULE_${the_module}_CHILDREN "${OPENCV_MODULE_CHILDREN}" CACHE INTERNAL "List of ${the_module} submodules") # stop processing of current file return() @@ -306,27 +306,42 @@ endfunction() # sort modules by dependencies function(__ocv_sort_modules_by_deps __lst) ocv_list_sort(${__lst}) - set(${__lst}_ORDERED ${${__lst}} CACHE INTERNAL "") - set(__result "") - foreach (m ${${__lst}}) - list(LENGTH __result __lastindex) - set(__index ${__lastindex}) - foreach (__d ${__result}) - set(__deps "${OPENCV_MODULE_${__d}_DEPS}") - if(";${__deps};" MATCHES ";${m};") - list(FIND __result "${__d}" __i) - if(__i LESS "${__index}") - set(__index "${__i}") + set(input ${${__lst}}) + set(result "") + while(input) + list(LENGTH input length_before) + foreach (m ${input}) + # check if module is in the result already + if (NOT ";${result};" MATCHES ";${m};") + # scan through module dependencies... + set(unresolved_deps_found FALSE) + foreach (d ${OPENCV_MODULE_${m}_CHILDREN} ${OPENCV_MODULE_${m}_DEPS}) + # ... which are not already in the result and are enabled + if ((NOT ";${result};" MATCHES ";${d};") AND HAVE_${d}) + set(unresolved_deps_found TRUE) + break() + endif() + endforeach() + # chek if all dependencies for this module has been resolved + if (NOT unresolved_deps_found) + list(APPEND result ${m}) + list(REMOVE_ITEM input ${m}) endif() endif() endforeach() - if(__index STREQUAL __lastindex) - list(APPEND __result "${m}") - else() - list(INSERT __result ${__index} "${m}") + list(LENGTH input length_after) + # check for infinite loop or unresolved dependencies + if (NOT length_after LESS length_before) + message(WARNING "Unresolved dependencies or loop in dependency graph (${length_after})\n" + "Processed ${__lst}: ${${__lst}}\n" + "Good modules: ${result}\n" + "Bad modules: ${input}" + ) + list(APPEND result ${input}) + break() endif() - endforeach() - set(${__lst} "${__result}" PARENT_SCOPE) + endwhile() + set(${__lst} "${result}" PARENT_SCOPE) endfunction() # resolve dependensies @@ -645,9 +660,43 @@ macro(_ocv_create_module) get_native_precompiled_header(${the_module} precomp.hpp) endif() + set(sub_objs "") + set(sub_links "") + set(cuda_objs "") + if (DEFINED OPENCV_MODULE_${the_module}_CHILDREN) + status("Complex module ${the_module}") + foreach (m ${OPENCV_MODULE_${the_module}_CHILDREN}) + if (BUILD_${m} AND TARGET ${m}_object) # ambigous? + get_target_property(_sub_links ${m} LINK_LIBRARIES) + list(APPEND sub_objs $) + list(APPEND sub_links ${_sub_links}) + status(" + ${m}") + else() + status(" - ${m}") + endif() + list(APPEND cuda_objs ${OPENCV_MODULE_${m}_CUDA_OBJECTS}) + endforeach() + endif() + ocv_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" - ${${the_module}_pch}) + ${${the_module}_pch} ${sub_objs}) + + if (cuda_objs) + target_link_libraries(${the_module} ${cuda_objs}) + endif() + + # TODO: is it needed? + if (sub_links) + ocv_list_filterout(sub_links "^opencv_") + ocv_list_unique(sub_links) + target_link_libraries(${the_module} ${sub_links}) + endif() + + unset(sub_objs) + unset(sub_links) + unset(cuda_objs) + if(NOT the_module STREQUAL opencv_ts) set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS OPENCV_NOSTL) endif() @@ -686,6 +735,7 @@ macro(_ocv_create_module) if((NOT DEFINED OPENCV_MODULE_TYPE AND BUILD_SHARED_LIBS) OR (DEFINED OPENCV_MODULE_TYPE AND OPENCV_MODULE_TYPE STREQUAL SHARED)) + set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS CVAPI_EXPORTS) set_target_properties(${the_module} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS) endif() @@ -696,22 +746,35 @@ macro(_ocv_create_module) set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libc /DEBUG") endif() - ocv_install_target(${the_module} EXPORT OpenCVModules + ocv_install_target(${the_module} EXPORT OpenCVModules OPTIONAL RUNTIME DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT libs ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT dev ) - # only "public" headers need to be installed - if(OPENCV_MODULE_${the_module}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${the_module};") - foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS}) - string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}") - if(NOT hdr2 MATCHES "opencv2/${the_module}/private.*" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" ) - install(FILES ${hdr} DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT dev) - endif() - endforeach() - endif() + foreach(m ${OPENCV_MODULE_${the_module}_CHILDREN} ${the_module}) + # only "public" headers need to be installed + if(OPENCV_MODULE_${m}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${m};") + foreach(hdr ${OPENCV_MODULE_${m}_HEADERS}) + string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}") + if(NOT hdr2 MATCHES "opencv2/${m}/private.*" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" ) + install(FILES ${hdr} OPTIONAL DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT dev) + endif() + endforeach() + endif() + endforeach() + _ocv_add_precompiled_headers(${the_module}) + + if (TARGET ${the_module}_object) + # copy COMPILE_DEFINITIONS + get_target_property(main_defs ${the_module} COMPILE_DEFINITIONS) + set_target_properties(${the_module}_object PROPERTIES COMPILE_DEFINITIONS ${main_defs}) + # use same PCH + if (TARGET pch_Generate_${the_module}) + add_dependencies(${the_module}_object pch_Generate_${the_module} ) + endif() + endif() endmacro() # opencv precompiled headers macro (can add pch to modules and tests) diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index 60d862efca..40112d5fbd 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -756,6 +756,9 @@ endfunction() function(_ocv_append_target_includes target) if(DEFINED OCV_TARGET_INCLUDE_DIRS_${target}) target_include_directories(${target} PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}}) + if (TARGET ${target}_object) + target_include_directories(${target}_object PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}}) + endif() unset(OCV_TARGET_INCLUDE_DIRS_${target} CACHE) endif() endfunction() @@ -780,8 +783,22 @@ function(ocv_add_library target) ocv_include_directories(${CUDA_INCLUDE_DIRS}) ocv_cuda_compile(cuda_objs ${lib_cuda_srcs} ${lib_cuda_hdrs}) endif() + set(OPENCV_MODULE_${target}_CUDA_OBJECTS ${cuda_objs} CACHE INTERNAL "Compiled CUDA object files") endif() add_library(${target} ${ARGN} ${cuda_objs}) + + # Add OBJECT library to use in compound modules + if (NOT OPENCV_MODULE_${target}_CHILDREN + AND NOT OPENCV_MODULE_${target}_CLASS STREQUAL "BINDINGS" + AND NOT ${target} STREQUAL "opencv_ts" + ) + set(sources ${ARGN}) + ocv_list_filterout(sources "\\\\.(cl|inc)$") + add_library(${target}_object OBJECT EXCLUDE_FROM_ALL ${sources}) + set_target_properties(${target}_object PROPERTIES POSITION_INDEPENDENT_CODE True) + unset(sources) + endif() + _ocv_append_target_includes(${target}) endfunction() diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index cb0d40d949..a9d6e22a47 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -38,7 +38,7 @@ endif(HAVE_DOC_GENERATOR) if(BUILD_DOCS AND DOXYGEN_FOUND) # not documented modules list - list(APPEND blacklist "ts" "java" "python2" "python3" "world") + list(APPEND blacklist "ts" "java" "python2" "python3" "world" "contrib_world") # gathering headers set(paths_include) diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt index 25c05bc646..8eb2e89382 100644 --- a/modules/java/CMakeLists.txt +++ b/modules/java/CMakeLists.txt @@ -242,7 +242,7 @@ else(ANDROID) else(WIN32) set(JAR_INSTALL_DIR share/OpenCV/java) endif(WIN32) - install(FILES ${JAR_FILE} DESTINATION ${JAR_INSTALL_DIR} COMPONENT java) + install(FILES ${JAR_FILE} OPTIONAL DESTINATION ${JAR_INSTALL_DIR} COMPONENT java) endif(ANDROID) # step 5: build native part @@ -312,16 +312,16 @@ if(ENABLE_SOLUTION_FOLDERS) endif() if(ANDROID) - ocv_install_target(${the_module} EXPORT OpenCVModules + ocv_install_target(${the_module} OPTIONAL EXPORT OpenCVModules LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT java ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT java) else() if(NOT INSTALL_CREATE_DISTRIB) - ocv_install_target(${the_module} EXPORT OpenCVModules + ocv_install_target(${the_module} OPTIONAL EXPORT OpenCVModules RUNTIME DESTINATION ${JAR_INSTALL_DIR} COMPONENT java LIBRARY DESTINATION ${JAR_INSTALL_DIR} COMPONENT java) else() - ocv_install_target(${the_module} EXPORT OpenCVModules + ocv_install_target(${the_module} OPTIONAL EXPORT OpenCVModules RUNTIME DESTINATION ${JAR_INSTALL_DIR}/${OpenCV_ARCH} COMPONENT java LIBRARY DESTINATION ${JAR_INSTALL_DIR}/${OpenCV_ARCH} COMPONENT java) endif() diff --git a/modules/python/common.cmake b/modules/python/common.cmake index 593fee4069..dca4e56a9a 100644 --- a/modules/python/common.cmake +++ b/modules/python/common.cmake @@ -20,6 +20,7 @@ ocv_list_filterout(candidate_deps "^opencv_adas$") ocv_list_filterout(candidate_deps "^opencv_tracking$") ocv_list_filterout(candidate_deps "^opencv_bioinspired$") ocv_list_filterout(candidate_deps "^opencv_java$") +ocv_list_filterout(candidate_deps "^opencv_contrib_world$") ocv_add_module(${MODULE_NAME} BINDINGS OPTIONAL ${candidate_deps}) @@ -113,7 +114,7 @@ else() endif() if(NOT INSTALL_CREATE_DISTRIB) - install(TARGETS ${the_module} + install(TARGETS ${the_module} OPTIONAL ${PYTHON_INSTALL_CONFIGURATIONS} RUNTIME DESTINATION ${PYTHON_PACKAGES_PATH} COMPONENT python LIBRARY DESTINATION ${PYTHON_PACKAGES_PATH} COMPONENT python diff --git a/platforms/ios/build_framework.py b/platforms/ios/build_framework.py index 0846e0f589..1acd2b25e8 100755 --- a/platforms/ios/build_framework.py +++ b/platforms/ios/build_framework.py @@ -52,7 +52,6 @@ def build_opencv(srcroot, buildroot, target, arch): cmakeargs = ("-GXcode " + "-DCMAKE_BUILD_TYPE=Release " + "-DCMAKE_TOOLCHAIN_FILE=%s/platforms/ios/cmake/Toolchains/Toolchain-%s_Xcode.cmake " + - "-DBUILD_opencv_world=ON " + "-DCMAKE_C_FLAGS=\"-Wno-implicit-function-declaration\" " + "-DCMAKE_INSTALL_PREFIX=install") % (srcroot, target) @@ -60,7 +59,13 @@ def build_opencv(srcroot, buildroot, target, arch): cmakeargs += " -DENABLE_NEON=ON" if opencv_contrib_path is not None: - cmakeargs += " -DOPENCV_EXTRA_MODULES_PATH=%s -DOPENCV_EXTRA_WORLD=ON" % opencv_contrib_path + cmakeargs += " -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON -DOPENCV_EXTRA_MODULES_PATH=%s -DBUILD_opencv_contrib_world=ON" % opencv_contrib_path + build_target = "opencv_contrib_world" + libname = "libopencv_contrib_world.a" + else: + cmakeargs += " -DBUILD_opencv_world=ON" + build_target = "ALL_BUILD" + libname = "libopencv_world.a" # if cmake cache exists, just rerun cmake to update OpenCV.xcodeproj if necessary if os.path.isfile(os.path.join(builddir, "CMakeCache.txt")): @@ -68,12 +73,12 @@ def build_opencv(srcroot, buildroot, target, arch): else: execute("cmake %s %s" % (cmakeargs, srcroot)) - for wlib in [builddir + "/modules/world/UninstalledProducts/libopencv_world.a", - builddir + "/lib/Release/libopencv_world.a"]: + for wlib in [builddir + "/modules/world/UninstalledProducts/" + libname, + builddir + "/lib/Release/" + libname]: if os.path.isfile(wlib): os.remove(wlib) - execute("xcodebuild IPHONEOS_DEPLOYMENT_TARGET=6.0 -parallelizeTargets ARCHS=%s -jobs 8 -sdk %s -configuration Release -target ALL_BUILD" % (arch, target.lower())) + execute("xcodebuild IPHONEOS_DEPLOYMENT_TARGET=6.0 -parallelizeTargets ARCHS=%s -jobs 8 -sdk %s -configuration Release -target %s" % (arch, target.lower(), build_target)) execute("xcodebuild IPHONEOS_DEPLOYMENT_TARGET=6.0 ARCHS=%s -sdk %s -configuration Release -target install install" % (arch, target.lower())) os.chdir(currdir) @@ -81,6 +86,7 @@ def put_framework_together(srcroot, dstroot): "constructs the framework directory after all the targets are built" name = "opencv2" if opencv_contrib_path is None else "opencv2_contrib" + libname = "libopencv_world.a" if opencv_contrib_path is None else "libopencv_contrib_world.a" # find the list of targets (basically, ["iPhoneOS", "iPhoneSimulator"]) targetlist = glob.glob(os.path.join(dstroot, "build", "*")) @@ -103,7 +109,7 @@ def put_framework_together(srcroot, dstroot): shutil.copytree(tdir0 + "/install/include/opencv2", dstdir + "/Headers") # make universal static lib - wlist = " ".join(["../build/" + t + "/lib/Release/libopencv_world.a" for t in targetlist]) + wlist = " ".join(["../build/" + t + "/lib/Release/" + libname for t in targetlist]) execute("lipo -create " + wlist + " -o " + dstdir + "/%s" % name) # copy Info.plist From c3f8fc41b7ed113e28aea0606b4461959cf1c1a6 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Thu, 12 Feb 2015 17:32:43 +0300 Subject: [PATCH 05/14] Parameters should have been passed by reference --- modules/calib3d/src/circlesgrid.cpp | 4 ++-- modules/calib3d/src/circlesgrid.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/calib3d/src/circlesgrid.cpp b/modules/calib3d/src/circlesgrid.cpp index ea169bdd72..bda50c05fa 100644 --- a/modules/calib3d/src/circlesgrid.cpp +++ b/modules/calib3d/src/circlesgrid.cpp @@ -66,7 +66,7 @@ void drawPoints(const std::vector &points, Mat &outImage, int radius = } #endif -void CirclesGridClusterFinder::hierarchicalClustering(const std::vector points, const Size &patternSz, std::vector &patternPoints) +void CirclesGridClusterFinder::hierarchicalClustering(const std::vector &points, const Size &patternSz, std::vector &patternPoints) { #ifdef HAVE_TEGRA_OPTIMIZATION if(tegra::hierarchicalClustering(points, patternSz, patternPoints)) @@ -135,7 +135,7 @@ void CirclesGridClusterFinder::hierarchicalClustering(const std::vector } } -void CirclesGridClusterFinder::findGrid(const std::vector points, cv::Size _patternSize, std::vector& centers) +void CirclesGridClusterFinder::findGrid(const std::vector &points, cv::Size _patternSize, std::vector& centers) { patternSize = _patternSize; centers.clear(); diff --git a/modules/calib3d/src/circlesgrid.hpp b/modules/calib3d/src/circlesgrid.hpp index fae6b3cac7..fd1389298c 100644 --- a/modules/calib3d/src/circlesgrid.hpp +++ b/modules/calib3d/src/circlesgrid.hpp @@ -62,10 +62,10 @@ public: squareSize = 1.0f; maxRectifiedDistance = (float)(squareSize / 2.0); } - void findGrid(const std::vector points, cv::Size patternSize, std::vector& centers); + void findGrid(const std::vector &points, cv::Size patternSize, std::vector& centers); //cluster 2d points by geometric coordinates - void hierarchicalClustering(const std::vector points, const cv::Size &patternSize, std::vector &patternPoints); + void hierarchicalClustering(const std::vector &points, const cv::Size &patternSize, std::vector &patternPoints); private: void findCorners(const std::vector &hull2f, std::vector &corners); void findOutsideCorners(const std::vector &corners, std::vector &outsideCorners); From a932d8aba1e4c58f944d89559939a0780e0ef45f Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Mon, 16 Feb 2015 11:31:21 +0300 Subject: [PATCH 06/14] use full qualified name for all internal namespaces to prevent ambiguous symbol errors --- modules/calib3d/src/fisheye.cpp | 10 ++++---- modules/core/include/opencv2/core/matx.hpp | 10 ++++---- .../core/include/opencv2/core/operations.hpp | 4 ++-- .../core/include/opencv2/core/persistence.hpp | 24 +++++++++---------- modules/core/src/algorithm.cpp | 2 +- modules/core/src/persistence.cpp | 2 +- modules/cudaarithm/src/reductions.cpp | 4 ++-- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/calib3d/src/fisheye.cpp b/modules/calib3d/src/fisheye.cpp index b0e92a3adc..a11bea0ceb 100644 --- a/modules/calib3d/src/fisheye.cpp +++ b/modules/calib3d/src/fisheye.cpp @@ -872,8 +872,8 @@ double cv::fisheye::stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayO if ((flags & CALIB_FIX_INTRINSIC)) { - internal::CalibrateExtrinsics(objectPoints, imagePoints1, intrinsicLeft, check_cond, thresh_cond, rvecs1, tvecs1); - internal::CalibrateExtrinsics(objectPoints, imagePoints2, intrinsicRight, check_cond, thresh_cond, rvecs2, tvecs2); + cv::internal::CalibrateExtrinsics(objectPoints, imagePoints1, intrinsicLeft, check_cond, thresh_cond, rvecs1, tvecs1); + cv::internal::CalibrateExtrinsics(objectPoints, imagePoints2, intrinsicRight, check_cond, thresh_cond, rvecs2, tvecs2); } intrinsicLeft.isEstimate[0] = flags & CALIB_FIX_INTRINSIC ? 0 : 1; @@ -918,8 +918,8 @@ double cv::fisheye::stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayO om_ref.reshape(3, 1).copyTo(om_list.col(image_idx)); T_ref.reshape(3, 1).copyTo(T_list.col(image_idx)); } - cv::Vec3d omcur = internal::median3d(om_list); - cv::Vec3d Tcur = internal::median3d(T_list); + cv::Vec3d omcur = cv::internal::median3d(om_list); + cv::Vec3d Tcur = cv::internal::median3d(T_list); cv::Mat J = cv::Mat::zeros(4 * n_points * n_images, 18 + 6 * (n_images + 1), CV_64FC1), e = cv::Mat::zeros(4 * n_points * n_images, 1, CV_64FC1), Jkk, ekk; @@ -961,7 +961,7 @@ double cv::fisheye::stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayO jacobians.col(14).copyTo(Jkk.col(4).rowRange(0, 2 * n_points)); //right camera jacobian - internal::compose_motion(rvec, tvec, omcur, Tcur, omr, Tr, domrdomckk, domrdTckk, domrdom, domrdT, dTrdomckk, dTrdTckk, dTrdom, dTrdT); + cv::internal::compose_motion(rvec, tvec, omcur, Tcur, omr, Tr, domrdomckk, domrdTckk, domrdom, domrdT, dTrdomckk, dTrdTckk, dTrdom, dTrdT); rvec = cv::Mat(rvecs2[image_idx]); tvec = cv::Mat(tvecs2[image_idx]); diff --git a/modules/core/include/opencv2/core/matx.hpp b/modules/core/include/opencv2/core/matx.hpp index 5f94cccccf..6cc5d06251 100644 --- a/modules/core/include/opencv2/core/matx.hpp +++ b/modules/core/include/opencv2/core/matx.hpp @@ -817,7 +817,7 @@ Vec<_Tp, n> Matx<_Tp, m, n>::solve(const Vec<_Tp, m>& rhs, int method) const template static inline double determinant(const Matx<_Tp, m, m>& a) { - return internal::Matx_DetOp<_Tp, m>()(a); + return cv::internal::Matx_DetOp<_Tp, m>()(a); } template static inline @@ -960,25 +960,25 @@ Vec<_Tp, cn> Vec<_Tp, cn>::mul(const Vec<_Tp, cn>& v) const template<> inline Vec Vec::conj() const { - return internal::conjugate(*this); + return cv::internal::conjugate(*this); } template<> inline Vec Vec::conj() const { - return internal::conjugate(*this); + return cv::internal::conjugate(*this); } template<> inline Vec Vec::conj() const { - return internal::conjugate(*this); + return cv::internal::conjugate(*this); } template<> inline Vec Vec::conj() const { - return internal::conjugate(*this); + return cv::internal::conjugate(*this); } template inline diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index c59919321f..dd9fe1e7bd 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -193,7 +193,7 @@ Matx<_Tp, n, m> Matx<_Tp, m, n>::inv(int method, bool *p_is_ok /*= NULL*/) const Matx<_Tp, n, m> b; bool ok; if( method == DECOMP_LU || method == DECOMP_CHOLESKY ) - ok = internal::Matx_FastInvOp<_Tp, m>()(*this, b, method); + ok = cv::internal::Matx_FastInvOp<_Tp, m>()(*this, b, method); else { Mat A(*this, false), B(b, false); @@ -209,7 +209,7 @@ Matx<_Tp, n, l> Matx<_Tp, m, n>::solve(const Matx<_Tp, m, l>& rhs, int method) c Matx<_Tp, n, l> x; bool ok; if( method == DECOMP_LU || method == DECOMP_CHOLESKY ) - ok = internal::Matx_FastSolveOp<_Tp, m, l>()(*this, rhs, x, method); + ok = cv::internal::Matx_FastSolveOp<_Tp, m, l>()(*this, rhs, x, method); else { Mat A(*this, false), B(rhs, false), X(x, false); diff --git a/modules/core/include/opencv2/core/persistence.hpp b/modules/core/include/opencv2/core/persistence.hpp index cc98e86c5d..fd691cc6cc 100644 --- a/modules/core/include/opencv2/core/persistence.hpp +++ b/modules/core/include/opencv2/core/persistence.hpp @@ -914,7 +914,7 @@ void write(FileStorage& fs, const Range& r ) template static inline void write( FileStorage& fs, const std::vector<_Tp>& vec ) { - internal::VecWriterProxy<_Tp, DataType<_Tp>::fmt != 0> w(&fs); + cv::internal::VecWriterProxy<_Tp, DataType<_Tp>::fmt != 0> w(&fs); w(vec); } @@ -922,63 +922,63 @@ void write( FileStorage& fs, const std::vector<_Tp>& vec ) template static inline void write(FileStorage& fs, const String& name, const Point_<_Tp>& pt ) { - internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, pt); } template static inline void write(FileStorage& fs, const String& name, const Point3_<_Tp>& pt ) { - internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, pt); } template static inline void write(FileStorage& fs, const String& name, const Size_<_Tp>& sz ) { - internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, sz); } template static inline void write(FileStorage& fs, const String& name, const Complex<_Tp>& c ) { - internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, c); } template static inline void write(FileStorage& fs, const String& name, const Rect_<_Tp>& r ) { - internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, r); } template static inline void write(FileStorage& fs, const String& name, const Vec<_Tp, cn>& v ) { - internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, v); } template static inline void write(FileStorage& fs, const String& name, const Scalar_<_Tp>& s ) { - internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, s); } static inline void write(FileStorage& fs, const String& name, const Range& r ) { - internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+FileNode::FLOW); write(fs, r); } template static inline void write( FileStorage& fs, const String& name, const std::vector<_Tp>& vec ) { - internal::WriteStructContext ws(fs, name, FileNode::SEQ+(DataType<_Tp>::fmt != 0 ? FileNode::FLOW : 0)); + cv::internal::WriteStructContext ws(fs, name, FileNode::SEQ+(DataType<_Tp>::fmt != 0 ? FileNode::FLOW : 0)); write(fs, vec); } @@ -1030,7 +1030,7 @@ void read(const FileNode& node, short& value, short default_value) template static inline void read( FileNodeIterator& it, std::vector<_Tp>& vec, size_t maxCount = (size_t)INT_MAX ) { - internal::VecReaderProxy<_Tp, DataType<_Tp>::fmt != 0> r(&it); + cv::internal::VecReaderProxy<_Tp, DataType<_Tp>::fmt != 0> r(&it); r(vec, maxCount); } @@ -1101,7 +1101,7 @@ FileNodeIterator& operator >> (FileNodeIterator& it, _Tp& value) template static inline FileNodeIterator& operator >> (FileNodeIterator& it, std::vector<_Tp>& vec) { - internal::VecReaderProxy<_Tp, DataType<_Tp>::fmt != 0> r(&it); + cv::internal::VecReaderProxy<_Tp, DataType<_Tp>::fmt != 0> r(&it); r(vec, (size_t)INT_MAX); return it; } diff --git a/modules/core/src/algorithm.cpp b/modules/core/src/algorithm.cpp index 9f9493e8a0..f817a987b4 100644 --- a/modules/core/src/algorithm.cpp +++ b/modules/core/src/algorithm.cpp @@ -423,7 +423,7 @@ void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const cv::write(fs, pname, algo->get >(pname)); else if( p.type == Param::ALGORITHM ) { - internal::WriteStructContext ws(fs, pname, CV_NODE_MAP); + cv::internal::WriteStructContext ws(fs, pname, CV_NODE_MAP); Ptr nestedAlgo = algo->get(pname); nestedAlgo->write(fs); } diff --git a/modules/core/src/persistence.cpp b/modules/core/src/persistence.cpp index fb5648d06f..5e14e81aa8 100644 --- a/modules/core/src/persistence.cpp +++ b/modules/core/src/persistence.cpp @@ -5548,7 +5548,7 @@ void read( const FileNode& node, SparseMat& mat, const SparseMat& default_mat ) void write(FileStorage& fs, const String& objname, const std::vector& keypoints) { - internal::WriteStructContext ws(fs, objname, CV_NODE_SEQ + CV_NODE_FLOW); + cv::internal::WriteStructContext ws(fs, objname, CV_NODE_SEQ + CV_NODE_FLOW); int i, npoints = (int)keypoints.size(); for( i = 0; i < npoints; i++ ) diff --git a/modules/cudaarithm/src/reductions.cpp b/modules/cudaarithm/src/reductions.cpp index 8d0add4537..04d1ac5de0 100644 --- a/modules/cudaarithm/src/reductions.cpp +++ b/modules/cudaarithm/src/reductions.cpp @@ -106,11 +106,11 @@ void cv::cuda::calcNorm(InputArray _src, OutputArray dst, int normType, InputArr } else if (normType == NORM_L2) { - internal::normL2(src_single_channel, dst, mask, stream); + cv::cuda::internal::normL2(src_single_channel, dst, mask, stream); } else // NORM_INF { - internal::findMaxAbs(src_single_channel, dst, mask, stream); + cv::cuda::internal::findMaxAbs(src_single_channel, dst, mask, stream); } } From 103687871dfed049427e7a4ff4f19b761ddf630b Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Mon, 16 Feb 2015 15:39:52 +0300 Subject: [PATCH 07/14] Reduce variable scope --- modules/core/src/conjugate_gradient.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/core/src/conjugate_gradient.cpp b/modules/core/src/conjugate_gradient.cpp index caf41fc954..90353cc7fd 100644 --- a/modules/core/src/conjugate_gradient.cpp +++ b/modules/core/src/conjugate_gradient.cpp @@ -136,7 +136,6 @@ namespace cv dprintf(("d first time\n"));print_matrix(d); dprintf(("r\n"));print_matrix(r); - double beta=0; for(int count=0;count<_termcrit.maxCount;count++){ minimizeOnTheLine(_Function,proxy_x,d,minimizeOnTheLine_buf1,minimizeOnTheLine_buf2); r.copyTo(r_old); @@ -147,7 +146,7 @@ namespace cv break; } r_norm_sq=r_norm_sq*r_norm_sq; - beta=MAX(0.0,(r_norm_sq-r.dot(r_old))/r_norm_sq); + double beta=MAX(0.0,(r_norm_sq-r.dot(r_old))/r_norm_sq); d=r+beta*d; } From 21ee113af30a2efba8faac4811d55822ff878b0e Mon Sep 17 00:00:00 2001 From: Ahmatnurov Dinar Date: Mon, 16 Feb 2015 16:28:33 +0300 Subject: [PATCH 08/14] fixig std::bad_alloc if points0 is empty checkVector(2) return -1, it causes the exception --- modules/videostab/src/global_motion.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/videostab/src/global_motion.cpp b/modules/videostab/src/global_motion.cpp index d840e895d2..f7938d5c4c 100644 --- a/modules/videostab/src/global_motion.cpp +++ b/modules/videostab/src/global_motion.cpp @@ -544,6 +544,9 @@ Mat MotionEstimatorL1::estimate(InputArray points0, InputArray points1, bool *ok CV_Assert(motionModel() <= MM_AFFINE && motionModel() != MM_RIGID); + if(npoints <= 0) + return Mat::eye(3, 3, CV_32F); + // prepare LP problem const Point2f *points0_ = points0.getMat().ptr(); From b51805e245a19ec332f60bbf2161ea6617d08043 Mon Sep 17 00:00:00 2001 From: exeltior Date: Mon, 16 Feb 2015 18:17:41 +0100 Subject: [PATCH 09/14] Update mser.cpp Need to initialize boolean variable pass2Only, otherwise the result is not predictable --- modules/features2d/src/mser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/features2d/src/mser.cpp b/modules/features2d/src/mser.cpp index f5c08d1a16..7b920465f4 100644 --- a/modules/features2d/src/mser.cpp +++ b/modules/features2d/src/mser.cpp @@ -67,6 +67,7 @@ public: areaThreshold = _area_threshold; minMargin = _min_margin; edgeBlurSize = _edge_blur_size; + pass2Only = false; } int delta; From 437ef99ba5756a18852ef2aef8a132590a2453f0 Mon Sep 17 00:00:00 2001 From: Nisarg Thakkar Date: Tue, 17 Feb 2015 22:14:57 +0530 Subject: [PATCH 10/14] Fixed doc error in optical flow --- .../py_video/py_lucas_kanade/py_lucas_kanade.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.markdown b/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.markdown index 1ea6cd69dc..48c8761c76 100644 --- a/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.markdown +++ b/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.markdown @@ -46,7 +46,7 @@ get the following equation: where: -\f[f_x = \frac{\partial f}{\partial x} \; ; \; f_y = \frac{\partial f}{\partial x}\f]\f[u = \frac{dx}{dt} \; ; \; v = \frac{dy}{dt}\f] +\f[f_x = \frac{\partial f}{\partial x} \; ; \; f_y = \frac{\partial f}{\partial y}\f]\f[u = \frac{dx}{dt} \; ; \; v = \frac{dy}{dt}\f] Above equation is called Optical Flow equation. In it, we can find \f$f_x\f$ and \f$f_y\f$, they are image gradients. Similarly \f$f_t\f$ is the gradient along time. But \f$(u,v)\f$ is unknown. We cannot solve this From 1944443d101863ce3f41e76e5689597299105935 Mon Sep 17 00:00:00 2001 From: UQ Times Date: Wed, 18 Feb 2015 13:30:08 +0900 Subject: [PATCH 11/14] iOS: fix crash from overrelease in UIImageToMat - previous pull request: https://github.com/Itseez/opencv/pull/3340 --- modules/imgcodecs/src/ios_conversions.mm | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/imgcodecs/src/ios_conversions.mm b/modules/imgcodecs/src/ios_conversions.mm index c191ffeaec..43268734c9 100644 --- a/modules/imgcodecs/src/ios_conversions.mm +++ b/modules/imgcodecs/src/ios_conversions.mm @@ -120,5 +120,4 @@ void UIImageToMat(const UIImage* image, CGContextDrawImage(contextRef, CGRectMake(0, 0, cols, rows), image.CGImage); CGContextRelease(contextRef); - CGColorSpaceRelease(colorSpace); } From 553020c44866b3d29ded0970d3222f4889c568bc Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Wed, 18 Feb 2015 12:36:50 +0300 Subject: [PATCH 12/14] Enabled STL usage within the library --- cmake/OpenCVModule.cmake | 4 ---- modules/java/CMakeLists.txt | 1 - modules/python/common.cmake | 1 - 3 files changed, 6 deletions(-) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 90068dedef..958be3dab9 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -697,10 +697,6 @@ macro(_ocv_create_module) unset(sub_links) unset(cuda_objs) - if(NOT the_module STREQUAL opencv_ts) - set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS OPENCV_NOSTL) - endif() - ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK}) ocv_target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK}) ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN}) diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt index 8eb2e89382..1d7a467869 100644 --- a/modules/java/CMakeLists.txt +++ b/modules/java/CMakeLists.txt @@ -253,7 +253,6 @@ string(REPLACE "-fvisibility=hidden" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") ocv_add_library(${the_module} SHARED ${handwrittren_h_sources} ${handwrittren_cpp_sources} ${generated_cpp_sources} ${copied_files} "${JAR_FILE}" "${JAR_FILE}.dephelper") -set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS OPENCV_NOSTL) if(BUILD_FAT_JAVA_LIB) set(__deps ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULES_BUILD}) diff --git a/modules/python/common.cmake b/modules/python/common.cmake index dca4e56a9a..a082d0777a 100644 --- a/modules/python/common.cmake +++ b/modules/python/common.cmake @@ -58,7 +58,6 @@ add_custom_command( DEPENDS ${opencv_hdrs}) ocv_add_library(${the_module} SHARED ${PYTHON_SOURCE_DIR}/src2/cv2.cpp ${cv2_generated_hdrs}) -set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS OPENCV_NOSTL) if(PYTHON_DEBUG_LIBRARIES AND NOT PYTHON_LIBRARIES MATCHES "optimized.*debug") ocv_target_link_libraries(${the_module} debug ${PYTHON_DEBUG_LIBRARIES} optimized ${PYTHON_LIBRARIES}) From c41db69f987e3a32876f0cf85eb6ce17785926ba Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Wed, 18 Feb 2015 12:44:48 +0300 Subject: [PATCH 13/14] Fixed cmake issues --- cmake/OpenCVModule.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 958be3dab9..f1c35b4c3f 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -663,7 +663,7 @@ macro(_ocv_create_module) set(sub_objs "") set(sub_links "") set(cuda_objs "") - if (DEFINED OPENCV_MODULE_${the_module}_CHILDREN) + if (OPENCV_MODULE_${the_module}_CHILDREN) status("Complex module ${the_module}") foreach (m ${OPENCV_MODULE_${the_module}_CHILDREN}) if (BUILD_${m} AND TARGET ${m}_object) # ambigous? @@ -765,7 +765,9 @@ macro(_ocv_create_module) if (TARGET ${the_module}_object) # copy COMPILE_DEFINITIONS get_target_property(main_defs ${the_module} COMPILE_DEFINITIONS) - set_target_properties(${the_module}_object PROPERTIES COMPILE_DEFINITIONS ${main_defs}) + if (main_defs) + set_target_properties(${the_module}_object PROPERTIES COMPILE_DEFINITIONS ${main_defs}) + endif() # use same PCH if (TARGET pch_Generate_${the_module}) add_dependencies(${the_module}_object pch_Generate_${the_module} ) From 2085251df23515fbbf1f9937efab9340e4014832 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Wed, 18 Feb 2015 14:16:54 +0300 Subject: [PATCH 14/14] Exclude object libraries from visual studio solution build --- cmake/OpenCVUtils.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index 40112d5fbd..3bb0279ea4 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -795,8 +795,15 @@ function(ocv_add_library target) ) set(sources ${ARGN}) ocv_list_filterout(sources "\\\\.(cl|inc)$") - add_library(${target}_object OBJECT EXCLUDE_FROM_ALL ${sources}) - set_target_properties(${target}_object PROPERTIES POSITION_INDEPENDENT_CODE True) + add_library(${target}_object OBJECT ${sources}) + set_target_properties(${target}_object PROPERTIES + EXCLUDE_FROM_ALL True + EXCLUDE_FROM_DEFAULT_BUILD True + POSITION_INDEPENDENT_CODE True + ) + if (ENABLE_SOLUTION_FOLDERS) + set_target_properties(${target}_object PROPERTIES FOLDER "object_libraries") + endif() unset(sources) endif()