Commit 93bc7363 authored by Michael Abrahams's avatar Michael Abrahams

Add library export definitions

Correctly specify dll export/import in MSVC shared libraries.

Request kritatooltransform target export shared .lib
parent 4e288a7b
......@@ -879,7 +879,9 @@ set(KOPAGEAPP_INCLUDES ${TEXTLAYOUT_INCLUDES}
${PIGMENT_INCLUDES}
${KOMAIN_INCLUDES}
${CMAKE_SOURCE_DIR}/libs/widgets
${CMAKE_SOURCE_DIR}/libs/kopageapp ${CMAKE_SOURCE_DIR}/libs/kopageapp/commands ${CMAKE_BINARY_DIR}/libs/kopageapp )
${CMAKE_SOURCE_DIR}/libs/kopageapp
${CMAKE_SOURCE_DIR}/libs/kopageapp/commands
${CMAKE_BINARY_DIR}/libs/kopageapp )
#############################################
#### filter libraries ####
......
......@@ -41,6 +41,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-memory-leak-tracker.h.cmake ${
include_directories(
${CMAKE_SOURCE_DIR}/krita/image/metadata
${CMAKE_BINARY_DIR}/libs/widgets
3rdparty
)
......@@ -302,6 +303,7 @@ set(einspline_SRCS
)
add_library(kritaimage SHARED ${kritaimage_LIB_SRCS} ${einspline_SRCS})
# generate_export_header(kritaimage BASE_NAME kritaimage)
target_link_libraries(kritaimage kritaglobal kritapsd koodf pigmentcms kundo2 kowidgetutils Qt5::Concurrent)
target_link_libraries(kritaimage LINK_INTERFACE_LIBRARIES kritaglobal kritapsd koodf pigmentcms kundo2 kowidgetutils Qt5::Concurrent)
......
......@@ -28,7 +28,7 @@
#if defined(_WIN32) || defined(_WIN64)
#ifndef KRITAIMAGE_EXPORT
# ifdef MAKE_KRITAIMAGE_LIB
# ifdef kritaimage_EXPORTS
# define KRITAIMAGE_EXPORT KDE_EXPORT
# else
# define KRITAIMAGE_EXPORT KDE_IMPORT
......@@ -44,7 +44,7 @@
/* Now the same for Krita*_TEST_EXPORT, if compiling with unit tests enabled */
#ifdef COMPILING_TESTS
# if defined _WIN32 || defined _WIN64
# if defined(MAKE_KRITAIMAGE_LIB)
# if defined(kritaimage_EXPORTS)
# define KRITAIMAGE_TEST_EXPORT KDE_EXPORT
# else
# define KRITAIMAGE_TEST_EXPORT KDE_IMPORT
......
......@@ -21,6 +21,7 @@ set(kritalibbrush_LIB_SRCS
)
add_library(kritalibbrush SHARED ${kritalibbrush_LIB_SRCS} )
generate_export_header(kritalibbrush BASE_NAME kritabrush EXPORT_MACRO_NAME BRUSH_EXPORT)
if (WIN32)
target_link_libraries(kritalibbrush kritaimage kowidgets Qt5::Svg ${WIN32_PLATFORM_NET_LIBS})
......
/*
This file is part of krita
Copyright (c) 2015 Friedrich W. H. Kossebau <kossebau@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KRITABRUSH_EXPORT_H
#define KRITABRUSH_EXPORT_H
#include <kdemacros.h>
/* We use _WIN32/_WIN64 instead of Q_OS_WIN so that this header can be used from C files too */
#if defined(_WIN32) || defined(_WIN64)
#ifndef BRUSH_EXPORT
# ifdef MAKE_KRITALIBBRUSH_LIB
# define BRUSH_EXPORT KDE_EXPORT
# else
# define BRUSH_EXPORT KDE_IMPORT
# endif
#endif
#else // not windows
#define BRUSH_EXPORT KDE_EXPORT
#endif /* not windows */
#endif /* KRITABRUSH_EXPORT_H */
......@@ -2,11 +2,14 @@ if (UNIX AND NOT APPLE)
add_subdirectory(colord)
set(kritacolor_LIB_SRCS kis_color_manager.h linux/kis_color_manager.cpp)
set(kritacolor_EXTRA_LIBRARIES kritacolord)
elseif (MSVC)
set(kritacolor_LIB_SRCS kis_color_manager.h dummy/kis_color_manager.cpp ${CMAKE_CURRENT_BINARY_DIR}/kritacolor_export.h)
else ()
set(kritacolor_LIB_SRCS dummy/kis_color_manager.cpp)
endif ()
kde4_add_library(kritacolor SHARED ${kritacolor_LIB_SRCS} )
add_library(kritacolor SHARED ${kritacolor_LIB_SRCS} )
generate_export_header(kritacolor BASE_NAME kritacolor)
target_link_libraries(kritacolor ${QT_QTCORE_LIBRARY} KF5::KDELibs4Support ${kritacolor_EXTRA_LIBRARIES})
......
......@@ -30,7 +30,7 @@
*
* TODO: support other devices than monitors
*/
class KRITALIBCOLOR_EXPORT KisColorManager : public QObject
class KRITACOLOR_EXPORT KisColorManager : public QObject
{
Q_OBJECT
......
/* This file is part of the KDE project
Copyright (C) 2006 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KRITACOLOR_EXPORT_H
#define KRITACOLOR_EXPORT_H
/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>
/* We use _WIN32/_WIN64 instead of Q_OS_WIN so that this header can be used from C files too */
#if defined _WIN32 || defined _WIN64
#ifndef KRITALIBCOLOR_EXPORT
# if defined(MAKE_KRITACOLOR_LIB)
/* We are building this library */
# define KRITALIBCOLOR_EXPORT KDE_EXPORT
# else
/* We are using this library */
# define KRITALIBCOLOR_EXPORT KDE_IMPORT
# endif
#endif
#else /* UNIX */
#define KRITALIBCOLOR_EXPORT KDE_EXPORT
#endif
#endif
include_directories(${KOTEXT_INCLUDES})
include_directories(${CMAKE_BINARY_DIR}/krita/libpsd) #For kispsd_include.h
add_subdirectory( tests )
......@@ -19,7 +20,8 @@ set(kritapsd_LIB_SRCS
asl/kis_asl_writer.cpp
)
kde4_add_library(kritapsd SHARED ${kritapsd_LIB_SRCS} )
add_library(kritapsd SHARED ${kritapsd_LIB_SRCS} )
generate_export_header(kritapsd BASE_NAME kritapsd)
if (WIN32)
target_link_libraries(kritapsd pigmentcms kritaglobal KF5::KDELibs4Support ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${WIN32_PLATFORM_NET_LIBS})
......
......@@ -5,6 +5,7 @@ macro_bool_to_01(ZLIB_FOUND HAVE_ZLIB)
configure_file(config_psd.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_psd.h)
include_directories(${ZLIB_INCLUDE_DIR})
include_directories(${CMAKE_BINARY_DIR}/krita/libpsd) #For kispsd_include.h
set(LIB_PSD_SRCS
psd_header.cpp
......
include_directories(${CMAKE_BINARY_DIR}/krita/libpsd) #For kispsd_include.h
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${CMAKE_SOURCE_DIR}/.. ${CMAKE_SOURCE_DIR}/krita/sdk/tests )
......
......@@ -82,6 +82,7 @@ ki18n_wrap_ui(kritalibpaintop_LIB_SRCS
)
add_library(kritalibpaintop SHARED ${kritalibpaintop_LIB_SRCS} )
generate_export_header(kritalibpaintop BASE_NAME paintop EXPORT_MACRO_NAME PAINTOP_EXPORT)
target_link_libraries(kritalibpaintop kritaui kritalibbrush kowidgetutils)
target_link_libraries(kritalibpaintop LINK_INTERFACE_LIBRARIES kritaui kritalibbrush)
......
......@@ -19,7 +19,7 @@
#define KIS_BRUSH_CHOOSER_H_
#include <QLabel>
#include <kritapaintop_export.h>
#include "kritapaintop_export.h"
#include <kis_brush.h>
class KisDoubleSliderSpinBox;
......
......@@ -27,7 +27,7 @@
#if defined(_WIN32) || defined(_WIN64)
#ifndef PAINTOP_EXPORT
# ifdef MAKE_KRITALIBPAINTOP_LIB
# ifdef kritalibpaintop_EXPORTS
# define PAINTOP_EXPORT KDE_EXPORT
# else
# define PAINTOP_EXPORT KDE_IMPORT
......@@ -43,7 +43,7 @@
/* Now the same for Krita*_TEST_EXPORT, if compiling with unit tests enabled */
#ifdef COMPILING_TESTS
# if defined _WIN32 || defined _WIN64
# if defined(MAKE_KRITALIBPAINTOP_LIB)
# if defined(kritalibpaintop_EXPORTS)
# define PAINTOP_TEST_EXPORT KDE_EXPORT
# else
# define PAINTOP_TEST_EXPORT KDE_IMPORT
......
......@@ -25,6 +25,7 @@ set(kritadefaulttools_PART_SRCS
ki18n_wrap_ui(kritadefaulttools_PART_SRCS wdgcolorpicker.ui wdgmovetool.ui)
add_library(kritadefaulttools MODULE ${kritadefaulttools_PART_SRCS})
generate_export_header(kritadefaulttools BASE_NAME kritadefaulttools)
kcoreaddons_desktop_to_json(kritadefaulttools kritadefaulttools.desktop)
target_link_libraries(kritadefaulttools kritaui basicflakes)
......
......@@ -25,7 +25,7 @@
#ifdef COMPILING_TESTS
# if defined _WIN32 || defined _WIN64
# if defined(MAKE_KRITADEFAULTTOOLS_LIB)
# if defined(kritadefaulttools_EXPORTS)
# define KRITADEFAULTTOOLS_TEST_EXPORT KDE_EXPORT
# else
# define KRITADEFAULTTOOLS_TEST_EXPORT KDE_IMPORT
......
......@@ -21,7 +21,7 @@
#include "kis_stroke_strategy_undo_command_based.h"
#include "kis_types.h"
#include "kritadefaulttools_export.h"
#include "../kritadefaulttools_export.h"
class KisUpdatesFacade;
class KisPostExecutionUndoAdapter;
......
......@@ -25,7 +25,9 @@ set(kritatooltransform_PART_SRCS
ki18n_wrap_ui(kritatooltransform_PART_SRCS wdg_tool_transform.ui)
add_library(kritatooltransform MODULE ${kritatooltransform_PART_SRCS})
add_library(kritatooltransform SHARED ${kritatooltransform_PART_SRCS})
generate_export_header(kritatooltransform BASE_NAME kritatooltransform)
kcoreaddons_desktop_to_json(kritatooltransform kritatooltransform.desktop)
if (NOT GSL_FOUND)
......
......@@ -25,7 +25,7 @@
#ifdef COMPILING_TESTS
# if defined _WIN32 || defined _WIN64
# if defined(MAKE_KRITATOOLTRANSFORM_LIB)
# if defined(kritatooltransform_EXPORTS)
# define KRITATOOLTRANSFORM_TEST_EXPORT KDE_EXPORT
# else
# define KRITATOOLTRANSFORM_TEST_EXPORT KDE_IMPORT
......
......@@ -25,6 +25,7 @@
#include <kis_types.h>
#include "tool_transform_args.h"
#include <kis_processing_visitor.h>
#include <kritatooltransform_export.h>
......
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${KOMAIN_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_SOURCE_DIR}/krita/sdk/tests )
include_directories( ${KOMAIN_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_SOURCE_DIR}/krita/sdk/tests )
macro_add_unittest_definitions()
......
......@@ -26,7 +26,7 @@
#include <kis_warptransform_worker.h>
#include <kis_filter_strategy.h>
#include "kis_liquify_properties.h"
#include <kritatooltransform_export.h>
#include "kritatooltransform_export.h"
#include <QScopedPointer>
......
......@@ -112,8 +112,9 @@ endif ()
# =============================================================================
add_library(kritasketchlib SHARED ${kritasketchlib_SRCS})
generate_export_headers(kritasketchlib BASE_NAME kritasketch)
set_target_properties(kritasketchlib
PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION} DEFINE_SYMBOL MAKE_KRITA_SKETCH_LIB
PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION}
)
......
......@@ -451,6 +451,7 @@ ki18n_wrap_ui(kritaui_LIB_SRCS
QT5_WRAP_CPP(kritaui_HEADERS_MOC KisDocumentSectionPropertyAction_p.h)
add_library(kritaui SHARED ${kritaui_HEADERS_MOC} ${kritaui_LIB_SRCS} )
generate_export_header(kritaui BASE_NAME kritaui)
target_link_libraries(kritaui KF5::GlobalAccel KF5::KDELibs4Support)
if (NOT WIN32)
......
......@@ -27,7 +27,7 @@
#if defined(_WIN32) || defined(_WIN64)
#ifndef KRITAUI_EXPORT
# ifdef MAKE_KRITAUI_LIB
# ifdef kritaui_EXPORTS
# define KRITAUI_EXPORT KDE_EXPORT
# else
# define KRITAUI_EXPORT KDE_IMPORT
......@@ -43,7 +43,7 @@
/* Now the same for Krita*_TEST_EXPORT, if compiling with unit tests enabled */
#ifdef COMPILING_TESTS
# if defined _WIN32 || defined _WIN64
# if defined(MAKE_KRITAUI_LIB)
# if defined(kritaui_EXPORTS)
# define KRITAUI_TEST_EXPORT KDE_EXPORT
# else
# define KRITAUI_TEST_EXPORT KDE_IMPORT
......
......@@ -16,6 +16,7 @@ ki18n_wrap_ui( basicflakes_LIB_SRCS
add_library(basicflakes SHARED ${basicflakes_LIB_SRCS})
generate_export_header(basicflakes)
target_link_libraries(basicflakes kowidgets flake pigmentcms)
......@@ -28,7 +29,7 @@ install(TARGETS basicflakes ${INSTALL_TARGETS_DEFAULT_ARGS})
install( FILES
tools/KoCreatePathTool.h
tools/KoPencilTool.h
basicflakes_export.h
${CMAKE_CURRENT_BINARY_DIR}/basicflakes_export.h
DESTINATION
${INCLUDE_INSTALL_DIR}/calligra
......
......@@ -218,6 +218,7 @@ ki18n_wrap_ui(flake_SRCS
)
add_library(flake SHARED ${flake_SRCS})
# generate_export_header(flake BASE_NAME flake)
target_link_libraries(flake pigmentcms kowidgetutils koodf Qt5::Svg)
target_link_libraries(flake LINK_INTERFACE_LIBRARIES pigmentcms kowidgetutils koodf)
......
......@@ -24,6 +24,7 @@
class KoFilterEffect;
class KoFilterEffectConfigWidgetBase;
class QString;
/// API docs go here
class FLAKE_EXPORT KoFilterEffectFactoryBase
......
......@@ -21,6 +21,7 @@
#define KOSNAPDATA_H
#include <KoPathSegment.h>
#include <flake_export.h>
/**
* This class is used to provide additional data to the snap guide.
......
......@@ -24,7 +24,7 @@
#include <kdemacros.h>
#ifndef FLAKE_EXPORT
# if defined(MAKE_FLAKE_LIB)
# if defined(flake_EXPORTS)
/* We are building this library */
# define FLAKE_EXPORT KDE_EXPORT
# define FLAKE_TEST_EXPORT KDE_EXPORT
......
......@@ -70,7 +70,7 @@ set_target_properties(kopageapp PROPERTIES
install(TARGETS kopageapp ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES
kopageapp_export.h
${CMAKE_CURRENT_BINARY_DIR}/kopageapp_export.h
KoPACanvas.h
KoPACanvasItem.h
KoPACanvasBase.h
......
......@@ -132,6 +132,7 @@ if( SHOULD_BUILD_FEATURE_RDF )
endif()
add_library(kotext SHARED ${kotext_LIB_SRCS})
# generate_export_header(kotext BASE_NAME kotext)
target_link_libraries(kotext flake)
if( SHOULD_BUILD_FEATURE_RDF )
......
......@@ -27,7 +27,7 @@
#if defined _WIN32 || defined _WIN64
#ifndef KOTEXT_EXPORT
# if defined(MAKE_KOTEXT_LIB)
# if defined(kotext_EXPORTS)
/* We are building this library */
# define KOTEXT_EXPORT KDE_EXPORT
# else
......@@ -46,7 +46,7 @@
#ifdef COMPILING_TESTS
#if defined _WIN32 || defined _WIN64
# if defined(MAKE_KOTEXT_LIB)
# if defined(kotext_EXPORTS)
# define KOTEXT_TEST_EXPORT KDE_EXPORT
# else
# define KOTEXT_TEST_EXPORT KDE_IMPORT
......
......@@ -28,7 +28,7 @@
#if defined _WIN32 || defined _WIN64
#ifndef KOMAIN_EXPORT
# if defined(MAKE_KOMAIN_LIB)
# if defined(komain_EXPORTS)
/* We are building this library */
# define KOMAIN_EXPORT KDE_EXPORT
# else
......
......@@ -32,6 +32,7 @@ set(textlayout_LIB_SRCS
add_library(kotextlayout SHARED ${textlayout_LIB_SRCS})
generate_export_header(kotextlayout BASE_NAME kotextlayout)
target_link_libraries(kotextlayout kotext)
target_link_libraries(kotextlayout LINK_INTERFACE_LIBRARIES kotext)
......
......@@ -27,7 +27,7 @@
#if defined _WIN32 || defined _WIN64
#ifndef KOTEXTLAYOUT_EXPORT
# if defined(MAKE_KOTEXTLAYOUT_LIB)
# if defined(kotextlayout_EXPORTS)
/* We are building this library */
# define KOTEXTLAYOUT_EXPORT KDE_EXPORT
# else
......@@ -46,7 +46,7 @@
#ifdef COMPILING_TESTS
#if defined _WIN32 || defined _WIN64
# if defined(MAKE_KOTEXTLAYOUT_LIB)
# if defined(kotextlayout_EXPORTS)
# define KOTEXTLAYOUT_TEST_EXPORT KDE_EXPORT
# else
# define KOTEXTLAYOUT_TEST_EXPORT KDE_IMPORT
......
......@@ -26,6 +26,7 @@ set(vectorimage_LIB_SRCS
)
add_library(kovectorimage SHARED ${vectorimage_LIB_SRCS})
generate_export_header(kovectorimage BASE_NAME kovectorimage)
target_link_libraries(kovectorimage KF5::KDELibs4Support Qt5::Gui Qt5::PrintSupport)
target_link_libraries(kovectorimage LINK_INTERFACE_LIBRARIES )
......
......@@ -3,6 +3,7 @@ add_subdirectory( pics )
include_directories(${KOTEXT_INCLUDES} ${KOODF_INCLUDES} ${PIGMENT_INCLUDES})
include_directories(${CMAKE_SOURCE_DIR}/libs/widgetutils)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if (LIBATTICA_FOUND)
include_directories(${LIBATTICA_INCLUDE_DIR})
endif ()
......@@ -99,6 +100,7 @@ ki18n_wrap_ui( kowidgets_LIB_SRCS
add_library(kowidgets SHARED ${kowidgets_LIB_SRCS})
generate_export_header(kowidgets BASE_NAME kowidgets)
target_link_libraries(kowidgets kotext pigmentcms kowidgetutils)
......@@ -127,7 +129,7 @@ install( FILES
KoPageLayoutWidget.h
KoPagePreviewWidget.h
KoPositionSelector.h
kowidgets_export.h
${CMAKE_CURRENT_BINARY_DIR}/kowidgets_export.h
KoZoomAction.h
KoZoomController.h
KoZoomInput.h
......
......@@ -22,6 +22,7 @@
#include <QWidget>
#include "kowidgets_export.h"
#include <kdemacros.h>
class KoColor;
class KoColorDisplayRendererInterface;
......
/* This file is part of the KDE project
Copyright (C) 2006 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KOWIDGETS_EXPORT_H
#define KOWIDGETS_EXPORT_H
/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>
/* We use _WIN32/_WIN64 instead of Q_OS_WIN so that this header can be used from C files too */
#if defined _WIN32 || defined _WIN64
#ifndef KOWIDGETS_EXPORT
# if defined(MAKE_KOWIDGETS_LIB)
/* We are building this library */
# define KOWIDGETS_EXPORT KDE_EXPORT
# else
/* We are using this library */
# define KOWIDGETS_EXPORT KDE_IMPORT
# endif
#endif
#else /* UNIX */
#define KOWIDGETS_EXPORT KDE_EXPORT
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment