From 9ebe5614dec003016e608553ad023ea998f37ca0 Mon Sep 17 00:00:00 2001 From: Gennady Pospelov <g.pospelov@fz-juelich.de> Date: Fri, 9 Sep 2016 15:04:28 +0200 Subject: [PATCH] Windows build errors (import dll, path to boost in unit tests) --- Fit/Minimizer/MultiOption.h | 2 +- GUI/coregui/utils/GUIHelpers.cpp | 9 +++++++++ GUI/coregui/utils/GUIHelpers.h | 10 +--------- Tests/UnitTests/Fit/CMakeLists.txt | 1 + 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Fit/Minimizer/MultiOption.h b/Fit/Minimizer/MultiOption.h index 36f16756bb5..a622efe24ea 100644 --- a/Fit/Minimizer/MultiOption.h +++ b/Fit/Minimizer/MultiOption.h @@ -25,7 +25,7 @@ //! @brief The MultiOption class is intended to store a single option for minimization //! algorithm. Int, double, string values are available. //! Relies on boost::variant, will be switched to std::variant in C++-17. -//! (before was https://github.com/mapbox/variant). +//! (before was https://github.com/mapbox/variant. class BA_CORE_API_ MultiOption { diff --git a/GUI/coregui/utils/GUIHelpers.cpp b/GUI/coregui/utils/GUIHelpers.cpp index c4a35a0b111..6aafbf4bf76 100644 --- a/GUI/coregui/utils/GUIHelpers.cpp +++ b/GUI/coregui/utils/GUIHelpers.cpp @@ -230,5 +230,14 @@ QVector<double> fromStdVector(const std::vector<double> &data) return result; } +QStringList fromStdStrings(const std::vector<std::string> &container) +{ + QStringList result; + for(std::string str : container) { + result.append(QString::fromStdString(str)); + } + return result; +} + } // namespace GUIHelpers diff --git a/GUI/coregui/utils/GUIHelpers.h b/GUI/coregui/utils/GUIHelpers.h index 095fd7bf6c9..3ae3cb38aea 100644 --- a/GUI/coregui/utils/GUIHelpers.h +++ b/GUI/coregui/utils/GUIHelpers.h @@ -69,15 +69,7 @@ BA_CORE_API_ bool isVersionMatchMinimal(const QString &version, const QString &m BA_CORE_API_ QString currentDateTime(); -template<class T> -BA_CORE_API_ QStringList fromStdStrings(const T &container) -{ - QStringList result; - for(std::string str : container) { - result.append(QString::fromStdString(str)); - } - return result; -} +BA_CORE_API_ QStringList fromStdStrings(const std::vector<std::string> &container); BA_CORE_API_ QVector<double> fromStdVector(const std::vector<double> &data); diff --git a/Tests/UnitTests/Fit/CMakeLists.txt b/Tests/UnitTests/Fit/CMakeLists.txt index af8ef7fbd61..048d75e17a4 100644 --- a/Tests/UnitTests/Fit/CMakeLists.txt +++ b/Tests/UnitTests/Fit/CMakeLists.txt @@ -8,6 +8,7 @@ include_directories( ${BornAgainCore_INCLUDE_DIRS} ${BornAgainFit_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR} + ${Boost_INCLUDE_DIRS} ${RootMinimizers_INCLUDE_DIRS} ${gtest_SOURCE_DIR} ${gtest_SOURCE_DIR}/include -- GitLab