diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index c96774f..78a4781 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -29,6 +29,9 @@ SCIQLOP_FIND_QT(Core Network) # # Compile the library library # + +ADD_DEFINITIONS(-DCORE_LIB) + FILE (GLOB_RECURSE MODULE_SOURCES ${INCLUDES_DIR}/*.h ${SOURCES_DIR}/*.c diff --git a/core/include/CoreGlobal.h b/core/include/CoreGlobal.h new file mode 100644 index 0000000..34581fc --- /dev/null +++ b/core/include/CoreGlobal.h @@ -0,0 +1,12 @@ +#ifndef SCIQLOP_COREGLOBAL_H +#define SCIQLOP_COREGLOBAL_H + +#include + +#ifdef CORE_LIB +#define SCIQLOP_CORE_EXPORT Q_DECL_EXPORT +#else +#define SCIQLOP_CORE_EXPORT Q_DECL_IMPORT +#endif + +#endif // SCIQLOP_COREGLOBAL_H diff --git a/core/include/Data/IDataProvider.h b/core/include/Data/IDataProvider.h index 4af05f0..0648402 100644 --- a/core/include/Data/IDataProvider.h +++ b/core/include/Data/IDataProvider.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_IDATAPROVIDER_H #define SCIQLOP_IDATAPROVIDER_H +#include "CoreGlobal.h" + #include #include @@ -25,7 +27,7 @@ class QNetworkRequest; * * @sa IDataSeries */ -class IDataProvider : public QObject { +class SCIQLOP_CORE_EXPORT IDataProvider : public QObject { Q_OBJECT public: diff --git a/core/include/Data/ScalarSeries.h b/core/include/Data/ScalarSeries.h index 6be68df..ce301f4 100644 --- a/core/include/Data/ScalarSeries.h +++ b/core/include/Data/ScalarSeries.h @@ -1,12 +1,14 @@ #ifndef SCIQLOP_SCALARSERIES_H #define SCIQLOP_SCALARSERIES_H +#include "CoreGlobal.h" + #include /** * @brief The ScalarSeries class is the implementation for a data series representing a scalar. */ -class ScalarSeries : public DataSeries<1> { +class SCIQLOP_CORE_EXPORT ScalarSeries : public DataSeries<1> { public: /** * Ctor with two vectors. The vectors must have the same size, otherwise a ScalarSeries with no diff --git a/core/include/DataSource/DataSourceController.h b/core/include/DataSource/DataSourceController.h index ce458d8..568f5a9 100644 --- a/core/include/DataSource/DataSourceController.h +++ b/core/include/DataSource/DataSourceController.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_DATASOURCECONTROLLER_H #define SCIQLOP_DATASOURCECONTROLLER_H +#include "CoreGlobal.h" + #include #include #include @@ -19,7 +21,7 @@ class IDataProvider; * source) then others specifics method will be able to access it. You can load a data source driver * plugin then create a data source. */ -class DataSourceController : public QObject { +class SCIQLOP_CORE_EXPORT DataSourceController : public QObject { Q_OBJECT public: explicit DataSourceController(QObject *parent = 0); diff --git a/core/include/DataSource/DataSourceItem.h b/core/include/DataSource/DataSourceItem.h index 684da09..0a8194e 100644 --- a/core/include/DataSource/DataSourceItem.h +++ b/core/include/DataSource/DataSourceItem.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_DATASOURCEITEM_H #define SCIQLOP_DATASOURCEITEM_H +#include "CoreGlobal.h" + #include #include @@ -19,7 +21,7 @@ enum class DataSourceItemType { NODE, PRODUCT, COMPONENT }; * containing other DataSourceItem objects (children). * For each DataSourceItem can be associated a set of data representing it. */ -class DataSourceItem { +class SCIQLOP_CORE_EXPORT DataSourceItem { public: /// Key associated with the name of the item static const QString NAME_DATA_KEY; diff --git a/core/include/DataSource/DataSourceItemAction.h b/core/include/DataSource/DataSourceItemAction.h index 1dff4be..72f2a88 100644 --- a/core/include/DataSource/DataSourceItemAction.h +++ b/core/include/DataSource/DataSourceItemAction.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_DATASOURCEITEMACTION_H #define SCIQLOP_DATASOURCEITEMACTION_H +#include "CoreGlobal.h" + #include #include @@ -17,7 +19,7 @@ class DataSourceItem; * * An action is a function that will be executed when the slot execute() is called. */ -class DataSourceItemAction : public QObject { +class SCIQLOP_CORE_EXPORT DataSourceItemAction : public QObject { Q_OBJECT diff --git a/core/include/Network/NetworkController.h b/core/include/Network/NetworkController.h index 2778624..ca19b89 100644 --- a/core/include/Network/NetworkController.h +++ b/core/include/Network/NetworkController.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_NETWORKCONTROLLER_H #define SCIQLOP_NETWORKCONTROLLER_H +#include "CoreGlobal.h" + #include #include #include @@ -16,7 +18,7 @@ class QNetworkRequest; /** * @brief The NetworkController class aims to handle all network connection of SciQlop. */ -class NetworkController : public QObject { +class SCIQLOP_CORE_EXPORT NetworkController : public QObject { Q_OBJECT public: explicit NetworkController(QObject *parent = 0); diff --git a/core/include/Plugin/PluginManager.h b/core/include/Plugin/PluginManager.h index b54c733..dd76163 100644 --- a/core/include/Plugin/PluginManager.h +++ b/core/include/Plugin/PluginManager.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_PLUGINMANAGER_H #define SCIQLOP_PLUGINMANAGER_H +#include "CoreGlobal.h" + #include #include @@ -12,7 +14,7 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_PluginManager) /** * @brief The PluginManager class aims to handle the plugins loaded dynamically into SciQLop. */ -class PluginManager { +class SCIQLOP_CORE_EXPORT PluginManager { public: explicit PluginManager(); diff --git a/core/include/Time/TimeController.h b/core/include/Time/TimeController.h index fe94644..9c6d7b0 100644 --- a/core/include/Time/TimeController.h +++ b/core/include/Time/TimeController.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_TIMECONTROLLER_H #define SCIQLOP_TIMECONTROLLER_H +#include "CoreGlobal.h" + #include #include @@ -14,7 +16,7 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_TimeController) /** * @brief The TimeController class aims to handle the Time parameters notification in SciQlop. */ -class TimeController : public QObject { +class SCIQLOP_CORE_EXPORT TimeController : public QObject { Q_OBJECT public: explicit TimeController(QObject *parent = 0); diff --git a/core/include/Variable/Variable.h b/core/include/Variable/Variable.h index ed1d3d7..cbdb30f 100644 --- a/core/include/Variable/Variable.h +++ b/core/include/Variable/Variable.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_VARIABLE_H #define SCIQLOP_VARIABLE_H +#include "CoreGlobal.h" + #include #include @@ -17,7 +19,7 @@ class QString; /** * @brief The Variable class represents a variable in SciQlop. */ -class Variable : public QObject { +class SCIQLOP_CORE_EXPORT Variable : public QObject { Q_OBJECT diff --git a/core/include/Variable/VariableCacheController.h b/core/include/Variable/VariableCacheController.h index 3ddf33e..56da394 100644 --- a/core/include/Variable/VariableCacheController.h +++ b/core/include/Variable/VariableCacheController.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_VARIABLECACHECONTROLLER_H #define SCIQLOP_VARIABLECACHECONTROLLER_H +#include "CoreGlobal.h" + #include #include @@ -15,7 +17,7 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_VariableCacheController) class Variable; /// This class aims to store in the cache all of the dateTime already requested to the variable. -class VariableCacheController : public QObject { +class SCIQLOP_CORE_EXPORT VariableCacheController : public QObject { Q_OBJECT public: explicit VariableCacheController(QObject *parent = 0); diff --git a/core/include/Variable/VariableController.h b/core/include/Variable/VariableController.h index c896d44..d353ad7 100644 --- a/core/include/Variable/VariableController.h +++ b/core/include/Variable/VariableController.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_VARIABLECONTROLLER_H #define SCIQLOP_VARIABLECONTROLLER_H +#include "CoreGlobal.h" + #include #include @@ -19,7 +21,7 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_VariableController) /** * @brief The VariableController class aims to handle the variables in SciQlop. */ -class VariableController : public QObject { +class SCIQLOP_CORE_EXPORT VariableController : public QObject { Q_OBJECT public: explicit VariableController(QObject *parent = 0); diff --git a/core/include/Variable/VariableModel.h b/core/include/Variable/VariableModel.h index 21e4edc..44fa7b7 100644 --- a/core/include/Variable/VariableModel.h +++ b/core/include/Variable/VariableModel.h @@ -1,6 +1,7 @@ #ifndef SCIQLOP_VARIABLEMODEL_H #define SCIQLOP_VARIABLEMODEL_H +#include "CoreGlobal.h" #include @@ -21,7 +22,7 @@ class Variable; /** * @brief The VariableModel class aims to hold the variables that have been created in SciQlop */ -class VariableModel : public QAbstractTableModel { +class SCIQLOP_CORE_EXPORT VariableModel : public QAbstractTableModel { Q_OBJECT public: explicit VariableModel(QObject *parent = nullptr); diff --git a/core/include/Visualization/VisualizationController.h b/core/include/Visualization/VisualizationController.h index 74ff980..1993e01 100644 --- a/core/include/Visualization/VisualizationController.h +++ b/core/include/Visualization/VisualizationController.h @@ -1,6 +1,8 @@ #ifndef SCIQLOP_VISUALIZATIONCONTROLLER_H #define SCIQLOP_VISUALIZATIONCONTROLLER_H +#include "CoreGlobal.h" + #include #include @@ -21,7 +23,7 @@ class Variable; * plugin source) then others specifics method will be able to access it. You can load a data source * driver plugin then create a data source. */ -class VisualizationController : public QObject { +class SCIQLOP_CORE_EXPORT VisualizationController : public QObject { Q_OBJECT public: explicit VisualizationController(QObject *parent = 0);