Fix default int value in build.info

This commit is contained in:
John Zhao 2018-06-07 16:23:38 +08:00
parent 87458482d9
commit 22ea971407
2 changed files with 26 additions and 3 deletions

View File

@ -245,6 +245,25 @@ install(EXPORT ${MYNTEYE_NAME}-targets
find_package(CUDA QUIET) find_package(CUDA QUIET)
macro(set_default_value VARIABLE DEFAULT)
if(NOT ${VARIABLE})
set(${VARIABLE} ${DEFAULT})
endif()
endmacro()
set_default_value(GCC_VERSION_MAJOR 0)
set_default_value(GCC_VERSION_MINOR 0)
set_default_value(CUDA_VERSION_MAJOR 0)
set_default_value(CUDA_VERSION_MINOR 0)
set_default_value(OpenCV_VERSION_MAJOR 0)
set_default_value(OpenCV_VERSION_MINOR 0)
set_default_value(OpenCV_VERSION_PATCH 0)
set_default_value(OpenCV_VERSION_TWEAK 0)
set_default_value(${PROJECT_NAME}_VERSION_MAJOR 0)
set_default_value(${PROJECT_NAME}_VERSION_MINOR 0)
set_default_value(${PROJECT_NAME}_VERSION_PATCH 0)
set_default_value(${PROJECT_NAME}_VERSION_TWEAK 0)
configure_file( configure_file(
cmake/templates/build.info.in cmake/templates/build.info.in
build.info @ONLY build.info @ONLY

View File

@ -301,10 +301,14 @@ void API::Start(const Source &source) {
if (source == Source::VIDEO_STREAMING) { if (source == Source::VIDEO_STREAMING) {
#ifdef WITH_FILESYSTEM #ifdef WITH_FILESYSTEM
if (!synthetic_->HasPlugin()) { if (!synthetic_->HasPlugin()) {
try {
auto &&plugin_paths = get_plugin_paths(); auto &&plugin_paths = get_plugin_paths();
if (plugin_paths.size() > 0) { if (plugin_paths.size() > 0) {
EnablePlugin(plugin_paths[0]); EnablePlugin(plugin_paths[0]);
} }
} catch (...) {
LOG(WARNING) << "Incorrect yaml format: build.info";
}
} }
#endif #endif
synthetic_->StartVideoStreaming(); synthetic_->StartVideoStreaming();