mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
#645 Added cv::getBuildInformation function (with sample) to get OpenCV build configuration
This commit is contained in:
@@ -16,7 +16,13 @@ else()
|
||||
set(cuda_link_libs "")
|
||||
endif()
|
||||
|
||||
ocv_glob_module_sources(SOURCES ${lib_cuda} ${cuda_objs})
|
||||
set(OPENCV_VERSION_FILE "${opencv_core_BINARY_DIR}/version_string.inc")
|
||||
add_custom_command(OUTPUT "${OPENCV_VERSION_FILE}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENCV_BUILD_INFO_FILE}" "${OPENCV_VERSION_FILE}"
|
||||
MAIN_DEPENDENCY "${OPENCV_BUILD_INFO_FILE}"
|
||||
COMMENT "")
|
||||
|
||||
ocv_glob_module_sources(SOURCES ${lib_cuda} ${cuda_objs} "${OPENCV_VERSION_FILE}")
|
||||
|
||||
ocv_create_module(${cuda_link_libs})
|
||||
ocv_add_precompiled_headers(${the_module})
|
||||
@@ -24,6 +30,3 @@ ocv_add_precompiled_headers(${the_module})
|
||||
ocv_add_accuracy_tests()
|
||||
ocv_add_perf_tests()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -218,6 +218,8 @@ CV_EXPORTS void setNumThreads(int nthreads);
|
||||
CV_EXPORTS int getNumThreads();
|
||||
CV_EXPORTS int getThreadNum();
|
||||
|
||||
CV_EXPORTS_W const std::string& getBuildInformation();
|
||||
|
||||
//! Returns the number of ticks.
|
||||
|
||||
/*!
|
||||
|
||||
@@ -410,6 +410,14 @@ int getNumberOfCPUs(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
const std::string& getBuildInformation()
|
||||
{
|
||||
static std::string build_info =
|
||||
#include "version_string.inc"
|
||||
;
|
||||
return build_info;
|
||||
}
|
||||
|
||||
string format( const char* fmt, ... )
|
||||
{
|
||||
char buf[1 << 16];
|
||||
|
||||
Reference in New Issue
Block a user