Skip to content
Snippets Groups Projects
Commit 59140733 authored by calrama's avatar calrama
Browse files

Don't create genicam_xml_cache in home directory

parent 127a10b4
No related branches found
No related tags found
No related merge requests found
Pipeline #33061 passed
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
#include "util/Config.h" #include "util/Config.h"
#include <QDir> #include <QDir>
#include <boost/filesystem.hpp>
#if HAS_PYLON
#include <GenApi/GenApi.h>
#endif
//This will hide the console. //This will hide the console.
//See https://stackoverflow.com/questions/2139637/hide-console-of-windows-application //See https://stackoverflow.com/questions/2139637/hide-console-of-windows-application
#ifdef _WIN32 #ifdef _WIN32
...@@ -54,6 +60,16 @@ int main(int argc, char* argv[]) { ...@@ -54,6 +60,16 @@ int main(int argc, char* argv[]) {
cfg->load(cfgLoc, "config.ini"); cfg->load(cfgLoc, "config.ini");
cfg->save(cfgLoc, "config.ini"); cfg->save(cfgLoc, "config.ini");
#if HAS_PYLON
const auto cache = boost::filesystem::path{QStandardPaths::writableLocation(QStandardPaths::CacheLocation).toStdString()};
const auto genicamCache = cache / "genicam_xml_cache";
boost::filesystem::create_directories(genicamCache);
GenICam::SetGenICamCacheFolder(GenICam::gcstring{genicamCache.c_str()});
qputenv(GENICAM_CACHE_VERSION, QByteArray::fromStdString(genicamCache.string()));
#endif
qRegisterMetaType<cv::Mat>("cv::Mat"); qRegisterMetaType<cv::Mat>("cv::Mat");
qRegisterMetaType<std::shared_ptr<cv::Mat>>("std::shared_ptr<cv::Mat>"); qRegisterMetaType<std::shared_ptr<cv::Mat>>("std::shared_ptr<cv::Mat>");
qRegisterMetaType<std::size_t>("std::size_t"); qRegisterMetaType<std::size_t>("std::size_t");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment