Patrick Spendrin wrote:

> One issue I have found was that KDE_EXPORT and KDE_IMPORT went missing.
> 
> KDE_EXPORT and KDE_IMPORT are needed e.g. if you want to export a
> function from a plugin (you never want to import it)

Sounds like something that should be changed in generate_export_header in 
CMake.

> meaning that it is
> needed for K_EXPORT_PLUGIN to work properly. In that special case we
> could use Q_DECL_EXPORT but since we can't always rely on Qt being
> available I would prefer if we define those two again.

Could you try the attached patch to cmake? If it works, we can apply it to a 
copy of the two affected files which we keep in frameworks until 2.8.10 is 
out.

Thanks,

Steve.
>From fb5a85f299b1a22d5fcc7d61cde55f0469210c7a Mon Sep 17 00:00:00 2001
From: Stephen Kelly <steve...@gmail.com>
Date: Wed, 4 Jul 2012 16:28:46 +0200
Subject: [PATCH] Add a DECL_EXPORT macro which is always defined as an
 export.

Plugins on windows are exported, but never imported, so we need a
define which can be used to represent that.
---
 Modules/GenerateExportHeader.cmake |    6 +++++-
 Modules/exportheader.cmake.in      |    2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index ce23d5d..edf3ad9 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -240,7 +240,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
   set(options DEFINE_NO_DEPRECATED)
   set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME EXPORT_FILE_NAME
     DEPRECATED_MACRO_NAME NO_EXPORT_MACRO_NAME STATIC_DEFINE
-    NO_DEPRECATED_MACRO_NAME)
+    NO_DEPRECATED_MACRO_NAME DECL_EXPORT_MACRO_NAME)
   set(multiValueArgs)
 
   cmake_parse_arguments(_GEH "${options}" "${oneValueArgs}" "${multiValueArgs}"
@@ -257,6 +257,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
 
   # Default options
   set(EXPORT_MACRO_NAME "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_EXPORT")
+  set(DECL_EXPORT_MACRO_NAME "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_DECL_EXPORT")
   set(NO_EXPORT_MACRO_NAME "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_NO_EXPORT")
   set(EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${BASE_NAME_LOWER}_export.h")
   set(DEPRECATED_MACRO_NAME "${_GEH_PREFIX_NAME}${BASE_NAME_UPPER}_DEPRECATED")
@@ -271,6 +272,9 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
   if(_GEH_EXPORT_MACRO_NAME)
     set(EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_EXPORT_MACRO_NAME})
   endif()
+  if(_GEH_DECL_EXPORT_MACRO_NAME)
+    set(DECL_EXPORT_MACRO_NAME ${_GEH_PREFIX_NAME}${_GEH_DECL_EXPORT_MACRO_NAME})
+  endif()
   if(_GEH_EXPORT_FILE_NAME)
     if(IS_ABSOLUTE ${_GEH_EXPORT_FILE_NAME})
       set(EXPORT_FILE_NAME ${_GEH_EXPORT_FILE_NAME})
diff --git a/Modules/exportheader.cmake.in b/Modules/exportheader.cmake.in
index 80a879d..f173cfc 100644
--- a/Modules/exportheader.cmake.in
+++ b/Modules/exportheader.cmake.in
@@ -6,6 +6,7 @@
 #  define @EXPORT_MACRO_NAME@
 #  define @NO_EXPORT_MACRO_NAME@
 #else
+#  define @DECL_EXPORT_MACRO_NAME@ @DEFINE_EXPORT@
 #  ifndef @EXPORT_MACRO_NAME@
 #    ifdef @EXPORT_IMPORT_CONDITION@
         /* We are building this library */
@@ -25,6 +26,7 @@
 #  define @DEPRECATED_MACRO_NAME@ @DEFINE_DEPRECATED@
 #  define @DEPRECATED_MACRO_NAME@_EXPORT @EXPORT_MACRO_NAME@ @DEFINE_DEPRECATED@
 #  define @DEPRECATED_MACRO_NAME@_NO_EXPORT @NO_EXPORT_MACRO_NAME@ @DEFINE_DEPRECATED@
+#  define @DEPRECATED_MACRO_NAME@_DECL_EXPORT @DECL_EXPORT_MACRO_NAME@ @DEFINE_DEPRECATED@
 #endif
 
 #cmakedefine01 DEFINE_NO_DEPRECATED
-- 
1.7.10.207.g0bb2e


_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel

Reply via email to