diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,6 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -add_definitions(-DMAKE_CANTORLIBS_LIB) - # KDE Application Version, managed by release script set (KDE_APPLICATIONS_VERSION_MAJOR "18") set (KDE_APPLICATIONS_VERSION_MINOR "11") @@ -56,6 +54,7 @@ include(KDECMakeSettings) include(KDEFrameworkCompilerSettings) include(ECMAddAppIcon) +include(GenerateExportHeader) if(NOT WIN32) set_package_properties(LibSpectre PROPERTIES DESCRIPTION "A PostScript rendering library" diff --git a/src/backends/maxima/CMakeLists.txt b/src/backends/maxima/CMakeLists.txt --- a/src/backends/maxima/CMakeLists.txt +++ b/src/backends/maxima/CMakeLists.txt @@ -17,9 +17,7 @@ add_backend(maximabackend ${MaximaBackend_SRCS}) -if(NOT WIN32) - target_link_libraries(cantor_maximabackend KF5::Pty KF5::SyntaxHighlighting) -endif(NOT WIN32) +target_link_libraries(cantor_maximabackend KF5::SyntaxHighlighting) if(BUILD_TESTING) add_executable( testmaxima testmaxima.cpp) diff --git a/src/backends/maxima/maximasession.h b/src/backends/maxima/maximasession.h --- a/src/backends/maxima/maximasession.h +++ b/src/backends/maxima/maximasession.h @@ -28,12 +28,6 @@ class MaximaExpression; class MaximaVariableModel; -#ifdef Q_OS_WIN - class KProcess; -#else - class KPtyProcess; -#endif - class MaximaSession : public Cantor::Session { Q_OBJECT diff --git a/src/backends/python/CMakeLists.txt b/src/backends/python/CMakeLists.txt --- a/src/backends/python/CMakeLists.txt +++ b/src/backends/python/CMakeLists.txt @@ -13,6 +13,8 @@ ki18n_wrap_ui(PythonBackend_SRCS settings.ui) add_library(cantor_pythonbackend SHARED ${PythonBackend_SRCS} ${PythonBackend_RSCS}) +generate_export_header(cantor_pythonbackend) + target_link_libraries(cantor_pythonbackend cantorlibs KF5::KIOCore diff --git a/src/backends/python/pythonbackend.h b/src/backends/python/pythonbackend.h --- a/src/backends/python/pythonbackend.h +++ b/src/backends/python/pythonbackend.h @@ -22,8 +22,9 @@ #define _PYTHONBACKEND_H #include "backend.h" +#include -class CANTOR_EXPORT PythonBackend : public Cantor::Backend +class CANTOR_PYTHONBACKEND_EXPORT PythonBackend : public Cantor::Backend { Q_OBJECT public: diff --git a/src/backends/python/pythonsession.h b/src/backends/python/pythonsession.h --- a/src/backends/python/pythonsession.h +++ b/src/backends/python/pythonsession.h @@ -23,6 +23,7 @@ #define _PYTHONSESSION_H #include "session.h" +#include #include namespace Cantor { @@ -34,7 +35,7 @@ class QDBusInterface; class KProcess; -class CANTOR_EXPORT PythonSession : public Cantor::Session +class CANTOR_PYTHONBACKEND_EXPORT PythonSession : public Cantor::Session { Q_OBJECT public: diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -24,7 +24,6 @@ Set( cantor_LIB_HDRS cantor_macros.h - cantor_export.h #base classes backend.h session.h @@ -54,6 +53,7 @@ configure_file (config-cantorlib.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-cantorlib.h ) add_library( cantorlibs SHARED ${cantor_LIB_SRCS} ) +generate_export_header(cantorlibs BASE_NAME cantor) kcoreaddons_desktop_to_json(cantorlibs cantor_assistant.desktop DEFAULT_SERVICE_TYPE) kcoreaddons_desktop_to_json(cantorlibs cantor_backend.desktop DEFAULT_SERVICE_TYPE) diff --git a/src/lib/assistant.h b/src/lib/assistant.h --- a/src/lib/assistant.h +++ b/src/lib/assistant.h @@ -25,7 +25,7 @@ #include #include -#include "cantor_export.h" +#include namespace Cantor { diff --git a/src/lib/backend.h b/src/lib/backend.h --- a/src/lib/backend.h +++ b/src/lib/backend.h @@ -26,7 +26,7 @@ #include #include -#include "cantor_export.h" +#include class KConfigSkeleton; class QWidget; diff --git a/src/lib/cantor_export.h b/src/lib/cantor_export.h deleted file mode 100644 --- a/src/lib/cantor_export.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - --- - Copyright (C) 2009 Alexander Rieder - */ - -#ifndef _CANTOR_EXPORT_H -#define _CANTOR_EXPORT_H - -#ifndef CANTOR_EXPORT -# if defined(MAKE_CANTORLIBS_LIB) -// We are building this library -# define CANTOR_EXPORT Q_DECL_EXPORT -# else -// We are using this library -# define CANTOR_EXPORT Q_DECL_IMPORT -# endif -#endif - -#ifndef CANTORTEST_EXPORT -# if defined(MAKE_CANTORTEST_LIB) -// We are building this library -# define CANTORTEST_EXPORT Q_DECL_EXPORT -# else -// We are using this library -# define CANTORTEST_EXPORT Q_DECL_IMPORT -# endif -#endif - -# ifndef CANTOR_EXPORT_DEPRECATED -# define CANTOR_EXPORT_DEPRECATED Q_DECL_DEPRECATED CANTOR_EXPORT -# endif - -#endif /* _CANTOR_EXPORT_H */ diff --git a/src/lib/completionobject.h b/src/lib/completionobject.h --- a/src/lib/completionobject.h +++ b/src/lib/completionobject.h @@ -23,7 +23,7 @@ #include -#include "cantor_export.h" +#include namespace Cantor { diff --git a/src/lib/defaulthighlighter.h b/src/lib/defaulthighlighter.h --- a/src/lib/defaulthighlighter.h +++ b/src/lib/defaulthighlighter.h @@ -21,7 +21,7 @@ #ifndef DEFAULTHIGHLIGHTER_H #define DEFAULTHIGHLIGHTER_H -#include "cantor_export.h" +#include #include diff --git a/src/lib/directives/plotdirectives.h b/src/lib/directives/plotdirectives.h --- a/src/lib/directives/plotdirectives.h +++ b/src/lib/directives/plotdirectives.h @@ -22,7 +22,7 @@ #define _PLOT_DIRECTIVES_H #include "extension.h" -#include "cantor_export.h" +#include //TODO: comments namespace Cantor diff --git a/src/lib/epsresult.h b/src/lib/epsresult.h --- a/src/lib/epsresult.h +++ b/src/lib/epsresult.h @@ -22,7 +22,7 @@ #define _EPSRESULT_H #include "result.h" -#include "cantor_export.h" +#include #include namespace Cantor diff --git a/src/lib/expression.h b/src/lib/expression.h --- a/src/lib/expression.h +++ b/src/lib/expression.h @@ -24,7 +24,7 @@ #include #include -#include "cantor_export.h" +#include class KZip; diff --git a/src/lib/extension.h b/src/lib/extension.h --- a/src/lib/extension.h +++ b/src/lib/extension.h @@ -26,7 +26,7 @@ #include #include #include -#include "cantor_export.h" +#include namespace Cantor { diff --git a/src/lib/latexrenderer.h b/src/lib/latexrenderer.h --- a/src/lib/latexrenderer.h +++ b/src/lib/latexrenderer.h @@ -22,7 +22,7 @@ #define _LATEXRENDERER_H #include -#include "cantor_export.h" +#include namespace Cantor{ class LatexRendererPrivate; diff --git a/src/lib/latexresult.h b/src/lib/latexresult.h --- a/src/lib/latexresult.h +++ b/src/lib/latexresult.h @@ -22,7 +22,7 @@ #define _LATEXRESULT_H #include "epsresult.h" -#include "cantor_export.h" +#include namespace Cantor{ class LatexResultPrivate; diff --git a/src/lib/panelplugin.h b/src/lib/panelplugin.h --- a/src/lib/panelplugin.h +++ b/src/lib/panelplugin.h @@ -26,7 +26,7 @@ #include "backend.h" -#include "cantor_export.h" +#include namespace Cantor { diff --git a/src/lib/panelpluginhandler.h b/src/lib/panelpluginhandler.h --- a/src/lib/panelpluginhandler.h +++ b/src/lib/panelpluginhandler.h @@ -22,7 +22,7 @@ #define _PANELPLUGINHANDLER_H #include -#include "cantor_export.h" +#include namespace Cantor { diff --git a/src/lib/result.h b/src/lib/result.h --- a/src/lib/result.h +++ b/src/lib/result.h @@ -23,7 +23,7 @@ #include #include -#include "cantor_export.h" +#include class KZip; diff --git a/src/lib/session.h b/src/lib/session.h --- a/src/lib/session.h +++ b/src/lib/session.h @@ -23,7 +23,7 @@ #include -#include "cantor_export.h" +#include #include "expression.h" diff --git a/src/lib/syntaxhelpobject.h b/src/lib/syntaxhelpobject.h --- a/src/lib/syntaxhelpobject.h +++ b/src/lib/syntaxhelpobject.h @@ -22,7 +22,7 @@ #define _SYNTAXHELPOBJECT_H #include -#include "cantor_export.h" +#include namespace Cantor{ diff --git a/src/lib/test/CMakeLists.txt b/src/lib/test/CMakeLists.txt --- a/src/lib/test/CMakeLists.txt +++ b/src/lib/test/CMakeLists.txt @@ -4,6 +4,7 @@ backendtest.cpp) add_library( cantortest SHARED ${cantortest_SRCS} ) +generate_export_header(cantortest) target_link_libraries( cantortest cantorlibs diff --git a/src/lib/test/backendtest.h b/src/lib/test/backendtest.h --- a/src/lib/test/backendtest.h +++ b/src/lib/test/backendtest.h @@ -25,7 +25,7 @@ #include #include -#include "cantor_export.h" +#include namespace Cantor { diff --git a/src/lib/textresult.h b/src/lib/textresult.h --- a/src/lib/textresult.h +++ b/src/lib/textresult.h @@ -23,7 +23,7 @@ #include "result.h" -#include "cantor_export.h" +#include namespace Cantor { diff --git a/src/lib/worksheetaccess.h b/src/lib/worksheetaccess.h --- a/src/lib/worksheetaccess.h +++ b/src/lib/worksheetaccess.h @@ -21,7 +21,7 @@ #ifndef _WORKSHEET_ACCESS_INTERFACE_H #define _WORKSHEET_ACCESS_INTERFACE_H -#include "cantor_export.h" +#include #include