OCV_OPTION(INSTALL_ANDROID_EXAMPLES "Install Android examples" OFF IF ANDROID )
OCV_OPTION(INSTALL_TO_MANGLED_PATHS "Enables mangled install paths, that help with side by side installs." OFF IF (UNIX AND NOT ANDROID AND NOT IOS AND BUILD_SHARED_LIBS) )
+
+if(CMAKE_GENERATOR MATCHES Xcode)
+ set(ENABLE_SOLUTION_FOLDERS0 ON)
+elseif(MSVC_IDE)
+ set(ENABLE_SOLUTION_FOLDERS0 ON)
+else()
+ set(ENABLE_SOLUTION_FOLDERS0 OFF)
+endif()
+
# OpenCV build options
# ===================================================
OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS) )
-OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" MSVC_IDE IF (CMAKE_VERSION VERSION_GREATER "2.8.0") )
+OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" ${ENABLE_SOLUTION_FOLDERS0} IF (CMAKE_VERSION VERSION_GREATER "2.8.0") )
OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC" ON IF (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
if(PYTHON_EXECUTABLE)
if(PYTHON_VERSION_STRING)
- set(PYTHON_VERSION_FULL "${PYTHON_VERSION_STRING}")
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
+ string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" PYTHON_VERSION_FULL "${PYTHON_VERSION_STRING}")
else()
execute_process(COMMAND ${PYTHON_EXECUTABLE} --version
ERROR_VARIABLE PYTHON_VERSION_FULL
#
# OPENCV_MODULE_${the_module}_LOCATION
# OPENCV_MODULE_${the_module}_DESCRIPTION
+# OPENCV_MODULE_${the_module}_CLASS - PUBLIC|INTERNAL|BINDINGS
# OPENCV_MODULE_${the_module}_HEADERS
# OPENCV_MODULE_${the_module}_SOURCES
# OPENCV_MODULE_${the_module}_DEPS - final flattened set of module dependencies
# To control the setup of the module you could also set:
# the_description - text to be used as current module description
# 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}
# The verbose template for OpenCV module:
#
# clean flags for modules enabled on previous cmake run
# this is necessary to correctly handle modules removal
-foreach(mod ${OPENCV_MODULES_BUILD})
+foreach(mod ${OPENCV_MODULES_BUILD} ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MODULES_DISABLED_AUTO} ${OPENCV_MODULES_DISABLED_FORCE})
if(HAVE_${mod})
unset(HAVE_${mod} CACHE)
endif()
+ unset(OPENCV_MODULE_${mod}_REQ_DEPS CACHE)
+ unset(OPENCV_MODULE_${mod}_OPT_DEPS CACHE)
endforeach()
# clean modules info which needs to be recalculated
# * <list of dependencies> - can include full names of modules or full pathes to shared/static libraries or cmake targets
macro(ocv_add_dependencies full_modname)
#we don't clean the dependencies here to allow this macro several times for every module
- foreach(d "REQIRED" ${ARGN})
- if(d STREQUAL "REQIRED")
+ foreach(d "REQUIRED" ${ARGN})
+ if(d STREQUAL "REQUIRED")
set(__depsvar OPENCV_MODULE_${full_modname}_REQ_DEPS)
elseif(d STREQUAL "OPTIONAL")
set(__depsvar OPENCV_MODULE_${full_modname}_OPT_DEPS)
# Usage:
# ocv_add_module(<name> [INTERNAL|BINDINGS] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>])
# Example:
-# ocv_add_module(yaom INTERNAL opencv_core opencv_highgui NOLINK opencv_flann OPTIONAL opencv_gpu)
+# ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_gpu)
macro(ocv_add_module _name)
string(TOLOWER "${_name}" name)
string(REGEX REPLACE "^opencv_" "" ${name} "${name}")
endif()
set(OPENCV_MODULE_${the_module}_DESCRIPTION "${the_description}" CACHE INTERNAL "Brief description of ${the_module} module")
set(OPENCV_MODULE_${the_module}_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Location of ${the_module} module sources")
- unset(OPENCV_MODULE_${the_module}_REQ_DEPS CACHE)
- unset(OPENCV_MODULE_${the_module}_OPT_DEPS CACHE)
#create option to enable/disable this module
- option(BUILD_${the_module} "Include ${the_module} module into the OpenCV build" ON)
+ if(NOT DEFINED BUILD_${the_module}_INIT)
+ set(BUILD_${the_module}_INIT ON)
+ endif()
+ option(BUILD_${the_module} "Include ${the_module} module into the OpenCV build" ${BUILD_${the_module}_INIT})
if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS")
+ set(OPENCV_MODULE_${the_module}_CLASS "${ARGV1}" CACHE INTERNAL "The cathegory of the module")
set(__ocv_argn__ ${ARGN})
list(REMOVE_AT __ocv_argn__ 0)
ocv_add_dependencies(${the_module} ${__ocv_argn__})
unset(__ocv_argn__)
else()
+ set(OPENCV_MODULE_${the_module}_CLASS "PUBLIC" CACHE INTERNAL "The cathegory of the module")
ocv_add_dependencies(${the_module} ${ARGN})
if(BUILD_${the_module})
set(OPENCV_MODULES_PUBLIC ${OPENCV_MODULES_PUBLIC} "${the_module}" CACHE INTERNAL "List of OpenCV modules marked for export")
endif()
endif()
+
+ # add self to the world dependencies
+ if(NOT DEFINED OPENCV_MODULE_IS_PART_OF_WORLD AND NOT OPENCV_MODULE_${the_module}_CLASS STREQUAL "BINDINGS" OR OPENCV_MODULE_IS_PART_OF_WORLD)
+ ocv_add_dependencies(opencv_world OPTIONAL ${the_module})
+ endif()
if(BUILD_${the_module})
set(OPENCV_MODULES_BUILD ${OPENCV_MODULES_BUILD} "${the_module}" CACHE INTERNAL "List of OpenCV modules included into the build")
# creates OpenCV module in current folder
# creates new target, configures standard dependencies, compilers flags, install rules
# Usage:
-# ocv_create_module(<extra link dependencies>)
+# ocv_create_module(<extra link dependencies>)
+# ocv_create_module(SKIP_LINK)
macro(ocv_create_module)
add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES})
- target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
+ if(NOT "${ARGN}" STREQUAL "SKIP_LINK")
+ target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
+ endif()
add_dependencies(opencv_modules ${the_module})
if(ENABLE_SOLUTION_FOLDERS)
\r
TEST_CYCLE() src.convertTo(dst, depthDst, alpha);\r
\r
- SANITY_CHECK(dst, 1e-12);\r
+ SANITY_CHECK(dst, alpha == 1.0 ? 1e-12 : 1e-7);\r
}\r
static DotProdFunc dotProdTab[] =
{
- (DotProdFunc)GET_OPTIMIZED(dotProd_8u), (DotProdFunc)dotProd_8s, (DotProdFunc)dotProd_16u,
- (DotProdFunc)dotProd_16s, (DotProdFunc)dotProd_32s, (DotProdFunc)GET_OPTIMIZED(dotProd_32f),
+ (DotProdFunc)GET_OPTIMIZED(dotProd_8u), (DotProdFunc)GET_OPTIMIZED(dotProd_8s),
+ (DotProdFunc)dotProd_16u, (DotProdFunc)dotProd_16s,
+ (DotProdFunc)dotProd_32s, (DotProdFunc)GET_OPTIMIZED(dotProd_32f),
(DotProdFunc)dotProd_64f, 0
};
typedef CvGBTrees GradientBoostingTrees;
template<> CV_EXPORTS void Ptr<CvDTreeSplit>::delete_obj();
+
+CV_EXPORTS bool initModule_ml(void);
}
+set(the_description "The ts module")
+
if(IOS)
ocv_module_disable(ts)
endif()
if(MINGW)
set(OPENCV_MODULE_TYPE STATIC)
endif()
-
-set(the_description "The ts module")
+
+set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
+
ocv_add_module(ts opencv_core)
ocv_glob_module_sources()
ocv_module_include_directories()
#include "opencv2/video/tracking.hpp"
#include "opencv2/video/background_segm.hpp"
+#ifdef __cplusplus
+namespace cv
+{
+
+CV_EXPORTS bool initModule_video(void);
+
+}
+#endif
+
#endif //__OPENCV_VIDEO_HPP__
return;\r
}\r
\r
- // Run test initializers \r
+ // Run test initializers\r
for (vector<Runnable*>::iterator it = inits_.begin(); it != inits_.end(); ++it)\r
{\r
if ((*it)->name().find(test_filter_, 0) != string::npos)\r
speedup_total_ += speedup;\r
\r
printMetrics(cpu_time, gpu_time, speedup);\r
- \r
+\r
num_subtests_called_++;\r
resetCurrentSubtest();\r
}\r
{\r
cout << endl;\r
cout << setiosflags(ios_base::left);\r
- cout << TAB << setw(10) << "CPU, ms" << setw(10) << "GPU, ms" \r
- << setw(14) << "SPEEDUP" \r
+ cout << TAB << setw(10) << "CPU, ms" << setw(10) << "GPU, ms"\r
+ << setw(14) << "SPEEDUP"\r
<< "DESCRIPTION\n";\r
cout << resetiosflags(ios_base::left);\r
}\r
void TestSystem::printSummary()\r
{\r
cout << setiosflags(ios_base::fixed);\r
- cout << "\naverage GPU speedup: x" \r
- << setprecision(3) << speedup_total_ / std::max(1, num_subtests_called_) \r
+ cout << "\naverage GPU speedup: x"\r
+ << setprecision(3) << speedup_total_ / std::max(1, num_subtests_called_)\r
<< endl;\r
cout << resetiosflags(ios_base::fixed);\r
}\r
}\r
\r
\r
-int CV_CDECL cvErrorCallback(int /*status*/, const char* /*func_name*/, \r
+int CV_CDECL cvErrorCallback(int /*status*/, const char* /*func_name*/,\r
const char* err_msg, const char* /*file_name*/,\r
int /*line*/, void* /*userdata*/)\r
{\r
\r
TestSystem::instance().setNumIters(iters);\r
\r
+ cout << "\nNote: the timings for GPU don't include data transfer" << endl;\r
+\r
TestSystem::instance().run();\r
\r
return 0;\r