OSDN Git Service

generic: generate export headers via generate_export_header()
authorIvailo Monev <xakepa10@gmail.com>
Wed, 10 Mar 2021 14:57:46 +0000 (16:57 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 10 Mar 2021 16:42:58 +0000 (18:42 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
15 files changed:
drkonqi/statuswidget.h
drkonqi/systeminformation.cpp
kcontrol/screensaver/CMakeLists.txt
kdm/kcm/CMakeLists.txt
khotkeys/CMakeLists.txt
krunner/CMakeLists.txt
kscreensaver/libkscreensaver/CMakeLists.txt
kscreensaver/libkscreensaver/kscreensaver_export.h [deleted file]
ksmserver/CMakeLists.txt
kwin/CMakeLists.txt
libs/kworkspace/CMakeLists.txt
libs/kworkspace/kworkspace_export.h [deleted file]
libs/plasmagenericshell/CMakeLists.txt
plasma/CMakeLists.txt
powerdevil/daemon/CMakeLists.txt

index 93ffd83..8fdb901 100644 (file)
 #include <QStackedWidget>
 #include <QLabel>
 #include <QTextDocument>
+#include <QHideEvent>
 
 class WrapLabel;
 class KPixmapSequenceWidget;
-#include <QHideEvent>
 
 class StatusWidget: public QStackedWidget
 {
index 1c17866..c0c0cfb 100644 (file)
@@ -48,7 +48,7 @@ QString SystemInformation::fetchOSDetailInformation() const
     QString operatingSystem = "unspecified";
 #ifdef HAVE_UNAME
     struct utsname buf;
-    if (uname(&buf) == -1) {
+    if (::uname(&buf) == -1) {
         kDebug() << "call to uname failed" << perror;
     } else {
         operatingSystem = QString::fromLocal8Bit(buf.sysname) + ' '
index 0235d78..9a6ae2a 100644 (file)
@@ -1,3 +1,8 @@
+include_directories(
+    # for kworkspace_export.h
+    ${CMAKE_BINARY_DIR}/libs/kworkspace
+)
+
 ########### next target ###############
 
 set(kcm_screensaver_PART_SRCS
index 7e489da..ffa7d2f 100644 (file)
@@ -1,3 +1,8 @@
+include_directories(
+    # for kworkspace_export.h
+    ${CMAKE_BINARY_DIR}/libs/kworkspace
+)
+
 set(kcm_kdm_PART_SRCS
    kdm-gen.cpp
    kdm-theme.cpp
@@ -6,7 +11,8 @@ set(kcm_kdm_PART_SRCS
    kdm-conv.cpp
    main.cpp
    kbackedcombobox.cpp
-   positioner.cpp)
+   positioner.cpp
+)
 
 
 kde4_add_plugin(kcm_kdm ${kcm_kdm_PART_SRCS})
index 2ed03c2..7423895 100644 (file)
@@ -2,7 +2,9 @@
 include_directories(
     ${CMAKE_CURRENT_SOURCE_DIR}/libkhotkeysprivate
     ${CMAKE_CURRENT_BINARY_DIR}/libkhotkeysprivate
-    )
+    # for kworkspace_export.h
+    ${CMAKE_BINARY_DIR}/libs/kworkspace
+)
 
 add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1217)
 
index ed0665c..9464899 100644 (file)
@@ -3,9 +3,13 @@ add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1207)
 # for dbus_add_activation_service
 include(MacroDBusAddActivationService)
 
-include_directories(${CMAKE_SOURCE_DIR}/libs/ksysguard
-                    ${CMAKE_SOURCE_DIR}/libs/ksysguard/processcore
-                    ${CMAKE_SOURCE_DIR}/libs/plasmagenericshell)
+include_directories(
+    ${CMAKE_SOURCE_DIR}/libs/ksysguard
+    ${CMAKE_SOURCE_DIR}/libs/ksysguard/processcore
+    ${CMAKE_SOURCE_DIR}/libs/plasmagenericshell
+    # for kworkspace_export.h
+    ${CMAKE_BINARY_DIR}/libs/kworkspace
+)
 
 set(krunner_KCFG_SRCS kcfg/krunnersettings.kcfgc kcfg/klaunchsettings.kcfgc)
 set(krunner_dbusAppXML dbus/org.kde.krunner.App.xml)
index 37e2dca..67021cd 100644 (file)
@@ -16,9 +16,8 @@ set_target_properties(kscreensaver PROPERTIES
     VERSION ${GENERIC_LIB_VERSION}
     SOVERSION ${GENERIC_LIB_SOVERSION}
 )
-set_target_properties(kscreensaver PROPERTIES
-    DEFINE_SYMBOL MAKE_KSCREENSAVER_LIB
-)
+
+generate_export_header(kscreensaver)
 
 install(
     TARGETS kscreensaver
@@ -35,7 +34,7 @@ install(
     FILES
     kscreensaver.h
     kscreensaver_vroot.h
-    kscreensaver_export.h
+    ${CMAKE_CURRENT_BINARY_DIR}/kscreensaver_export.h
     DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}
     COMPONENT Devel
 )
diff --git a/kscreensaver/libkscreensaver/kscreensaver_export.h b/kscreensaver/libkscreensaver/kscreensaver_export.h
deleted file mode 100644 (file)
index 1fbca52..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*  This file is part of the KDE project
-    Copyright (C) 2012 Andrius da Costa Ribas <andriusmao@gmail.com>
-
-    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 KSCREENSAVER_EXPORT_H
-#define KSCREENSAVER_EXPORT_H
-
-/* needed for KDE_EXPORT and KDE_IMPORT macros */
-#include <kdemacros.h>
-
-#ifndef KSCREENSAVER_EXPORT
-# if defined(MAKE_KSCREENSAVER_LIB)
-   /* We are building this library */ 
-#  define KSCREENSAVER_EXPORT KDE_EXPORT
-# else
-   /* We are using this library */ 
-#  define KSCREENSAVER_EXPORT KDE_IMPORT
-# endif
-#endif
-
-# ifndef KSCREENSAVER_EXPORT_DEPRECATED
-#  define KSCREENSAVER_EXPORT_DEPRECATED KDE_DEPRECATED KSCREENSAVER_EXPORT
-# endif
-
-#endif
index 0d7045d..4ce8c68 100644 (file)
@@ -1,11 +1,13 @@
 
-add_subdirectory( kcm )
-
 include_directories(
    ${CMAKE_SOURCE_DIR}/libs
    ${KDECLARATIVE_INCLUDE_DIR}
+   # for kworkspace_export.h
+   ${CMAKE_BINARY_DIR}/libs/kworkspace
 )
 
+add_subdirectory( kcm )
+
 if(ENABLE_TESTING)
     add_subdirectory(tests)
 endif()
index 69aec95..0cf85f0 100644 (file)
@@ -12,7 +12,11 @@ if(NOT DBUSMENUQT_FOUND)
     set(KWIN_BUILD_KAPPMENU OFF)
 endif()
 
-include_directories(${XCB_INCLUDE_DIR})
+include_directories(
+    ${XCB_INCLUDE_DIR}
+    # for kworkspace_export.h
+    ${CMAKE_BINARY_DIR}/libs/kworkspace
+)
 
 # for kwin internal things
 configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h)
index bc9e900..d2673b5 100644 (file)
@@ -1,4 +1,3 @@
-
 set(kworkspace_LIB_SRCS
     kdisplaymanager.cpp
     kwindowlistmenu.cpp
@@ -32,9 +31,10 @@ target_link_libraries(kworkspace PUBLIC
 set_target_properties(kworkspace PROPERTIES
     VERSION ${GENERIC_LIB_VERSION}
     SOVERSION ${GENERIC_LIB_SOVERSION}
-    DEFINE_SYMBOL MAKE_KWORKSPACE_LIB
 )
 
+generate_export_header(kworkspace)
+
 install(
     TARGETS kworkspace
     EXPORT kdeworkspaceLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
@@ -45,7 +45,7 @@ install(
     kdisplaymanager.h
     kwindowlistmenu.h
     kworkspace.h
-    kworkspace_export.h
+    ${CMAKE_CURRENT_BINARY_DIR}/kworkspace_export.h
     DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}/kworkspace
     COMPONENT Devel
 )
diff --git a/libs/kworkspace/kworkspace_export.h b/libs/kworkspace/kworkspace_export.h
deleted file mode 100644 (file)
index 99fdd6c..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*  This file is part of the KDE project
-    Copyright (C) 2011 Andrius da Costa Ribas <andriusmao@gmail.com>
-
-    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 KWORKSPACE_EXPORT_H
-#define KWORKSPACE_EXPORT_H
-
-/* needed for KDE_EXPORT and KDE_IMPORT macros */
-#include <kdemacros.h>
-
-#ifndef KWORKSPACE_EXPORT
-# if defined(MAKE_KWORKSPACE_LIB)
-   /* We are building this library */ 
-#  define KWORKSPACE_EXPORT KDE_EXPORT
-# else
-   /* We are using this library */ 
-#  define KWORKSPACE_EXPORT KDE_IMPORT
-# endif
-#endif
-
-# ifndef KWORKSPACE_EXPORT_DEPRECATED
-#  define KWORKSPACE_EXPORT_DEPRECATED KDE_DEPRECATED KWORKSPACE_EXPORT
-# endif
-
-#endif
index ec8284f..8c17e39 100644 (file)
@@ -1,3 +1,8 @@
+include_directories(
+   # for kworkspace_export.h
+   ${CMAKE_BINARY_DIR}/libs/kworkspace
+)
+
 if(ENABLE_TESTING)
     add_subdirectory(tests)
 endif()
index b8acb96..1179e4a 100644 (file)
@@ -1,3 +1,8 @@
+include_directories(
+    # for kworkspace_export.h
+    ${CMAKE_BINARY_DIR}/libs/kworkspace
+)
+
 add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1204)
 
 MACRO(installPackage dir component)
index 7d510fe..c3ab68e 100644 (file)
@@ -1,5 +1,9 @@
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}
-                    ${CMAKE_CURRENT_BINARY_DIR})
+include_directories(
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_BINARY_DIR}
+    # for kworkspace_export.h
+    ${CMAKE_BINARY_DIR}/libs/kworkspace
+)
 
 add_subdirectory(actions)