diff --git a/CMakeLists.txt b/CMakeLists.txt index d730c65..0c987f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,6 +245,25 @@ install(EXPORT ${MYNTEYE_NAME}-targets 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( cmake/templates/build.info.in build.info @ONLY diff --git a/src/api/api.cc b/src/api/api.cc index f56582e..dee1974 100644 --- a/src/api/api.cc +++ b/src/api/api.cc @@ -301,9 +301,13 @@ void API::Start(const Source &source) { if (source == Source::VIDEO_STREAMING) { #ifdef WITH_FILESYSTEM if (!synthetic_->HasPlugin()) { - auto &&plugin_paths = get_plugin_paths(); - if (plugin_paths.size() > 0) { - EnablePlugin(plugin_paths[0]); + try { + auto &&plugin_paths = get_plugin_paths(); + if (plugin_paths.size() > 0) { + EnablePlugin(plugin_paths[0]); + } + } catch (...) { + LOG(WARNING) << "Incorrect yaml format: build.info"; } } #endif