generic: generate export headers via generate_export_header()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-03-10 16:57:46 +02:00
parent f29ab97f5a
commit 49d6d22951
15 changed files with 55 additions and 99 deletions

View file

@ -23,10 +23,10 @@
#include <QStackedWidget> #include <QStackedWidget>
#include <QLabel> #include <QLabel>
#include <QTextDocument> #include <QTextDocument>
#include <QHideEvent>
class WrapLabel; class WrapLabel;
class KPixmapSequenceWidget; class KPixmapSequenceWidget;
#include <QHideEvent>
class StatusWidget: public QStackedWidget class StatusWidget: public QStackedWidget
{ {

View file

@ -48,7 +48,7 @@ QString SystemInformation::fetchOSDetailInformation() const
QString operatingSystem = "unspecified"; QString operatingSystem = "unspecified";
#ifdef HAVE_UNAME #ifdef HAVE_UNAME
struct utsname buf; struct utsname buf;
if (uname(&buf) == -1) { if (::uname(&buf) == -1) {
kDebug() << "call to uname failed" << perror; kDebug() << "call to uname failed" << perror;
} else { } else {
operatingSystem = QString::fromLocal8Bit(buf.sysname) + ' ' operatingSystem = QString::fromLocal8Bit(buf.sysname) + ' '

View file

@ -1,3 +1,8 @@
include_directories(
# for kworkspace_export.h
${CMAKE_BINARY_DIR}/libs/kworkspace
)
########### next target ############### ########### next target ###############
set(kcm_screensaver_PART_SRCS set(kcm_screensaver_PART_SRCS

View file

@ -1,3 +1,8 @@
include_directories(
# for kworkspace_export.h
${CMAKE_BINARY_DIR}/libs/kworkspace
)
set(kcm_kdm_PART_SRCS set(kcm_kdm_PART_SRCS
kdm-gen.cpp kdm-gen.cpp
kdm-theme.cpp kdm-theme.cpp
@ -6,7 +11,8 @@ set(kcm_kdm_PART_SRCS
kdm-conv.cpp kdm-conv.cpp
main.cpp main.cpp
kbackedcombobox.cpp kbackedcombobox.cpp
positioner.cpp) positioner.cpp
)
kde4_add_plugin(kcm_kdm ${kcm_kdm_PART_SRCS}) kde4_add_plugin(kcm_kdm ${kcm_kdm_PART_SRCS})

View file

@ -2,7 +2,9 @@
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/libkhotkeysprivate ${CMAKE_CURRENT_SOURCE_DIR}/libkhotkeysprivate
${CMAKE_CURRENT_BINARY_DIR}/libkhotkeysprivate ${CMAKE_CURRENT_BINARY_DIR}/libkhotkeysprivate
) # for kworkspace_export.h
${CMAKE_BINARY_DIR}/libs/kworkspace
)
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1217) add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1217)

View file

@ -3,9 +3,13 @@ add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1207)
# for dbus_add_activation_service # for dbus_add_activation_service
include(MacroDBusAddActivationService) include(MacroDBusAddActivationService)
include_directories(${CMAKE_SOURCE_DIR}/libs/ksysguard include_directories(
${CMAKE_SOURCE_DIR}/libs/ksysguard/processcore ${CMAKE_SOURCE_DIR}/libs/ksysguard
${CMAKE_SOURCE_DIR}/libs/plasmagenericshell) ${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_KCFG_SRCS kcfg/krunnersettings.kcfgc kcfg/klaunchsettings.kcfgc)
set(krunner_dbusAppXML dbus/org.kde.krunner.App.xml) set(krunner_dbusAppXML dbus/org.kde.krunner.App.xml)

View file

@ -16,9 +16,8 @@ set_target_properties(kscreensaver PROPERTIES
VERSION ${GENERIC_LIB_VERSION} VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION} SOVERSION ${GENERIC_LIB_SOVERSION}
) )
set_target_properties(kscreensaver PROPERTIES
DEFINE_SYMBOL MAKE_KSCREENSAVER_LIB generate_export_header(kscreensaver)
)
install( install(
TARGETS kscreensaver TARGETS kscreensaver
@ -35,7 +34,7 @@ install(
FILES FILES
kscreensaver.h kscreensaver.h
kscreensaver_vroot.h kscreensaver_vroot.h
kscreensaver_export.h ${CMAKE_CURRENT_BINARY_DIR}/kscreensaver_export.h
DESTINATION ${KDE4_INCLUDE_INSTALL_DIR} DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}
COMPONENT Devel COMPONENT Devel
) )

View file

@ -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

View file

@ -1,11 +1,13 @@
add_subdirectory( kcm )
include_directories( include_directories(
${CMAKE_SOURCE_DIR}/libs ${CMAKE_SOURCE_DIR}/libs
${KDECLARATIVE_INCLUDE_DIR} ${KDECLARATIVE_INCLUDE_DIR}
# for kworkspace_export.h
${CMAKE_BINARY_DIR}/libs/kworkspace
) )
add_subdirectory( kcm )
if(ENABLE_TESTING) if(ENABLE_TESTING)
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()

View file

@ -12,7 +12,11 @@ if(NOT DBUSMENUQT_FOUND)
set(KWIN_BUILD_KAPPMENU OFF) set(KWIN_BUILD_KAPPMENU OFF)
endif() endif()
include_directories(${XCB_INCLUDE_DIR}) include_directories(
${XCB_INCLUDE_DIR}
# for kworkspace_export.h
${CMAKE_BINARY_DIR}/libs/kworkspace
)
# for kwin internal things # for kwin internal things
configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h) configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h)

View file

@ -1,4 +1,3 @@
set(kworkspace_LIB_SRCS set(kworkspace_LIB_SRCS
kdisplaymanager.cpp kdisplaymanager.cpp
kwindowlistmenu.cpp kwindowlistmenu.cpp
@ -32,9 +31,10 @@ target_link_libraries(kworkspace PUBLIC
set_target_properties(kworkspace PROPERTIES set_target_properties(kworkspace PROPERTIES
VERSION ${GENERIC_LIB_VERSION} VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION} SOVERSION ${GENERIC_LIB_SOVERSION}
DEFINE_SYMBOL MAKE_KWORKSPACE_LIB
) )
generate_export_header(kworkspace)
install( install(
TARGETS kworkspace TARGETS kworkspace
EXPORT kdeworkspaceLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS} EXPORT kdeworkspaceLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
@ -45,7 +45,7 @@ install(
kdisplaymanager.h kdisplaymanager.h
kwindowlistmenu.h kwindowlistmenu.h
kworkspace.h kworkspace.h
kworkspace_export.h ${CMAKE_CURRENT_BINARY_DIR}/kworkspace_export.h
DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}/kworkspace DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}/kworkspace
COMPONENT Devel COMPONENT Devel
) )

View file

@ -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

View file

@ -1,3 +1,8 @@
include_directories(
# for kworkspace_export.h
${CMAKE_BINARY_DIR}/libs/kworkspace
)
if(ENABLE_TESTING) if(ENABLE_TESTING)
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()

View file

@ -1,3 +1,8 @@
include_directories(
# for kworkspace_export.h
${CMAKE_BINARY_DIR}/libs/kworkspace
)
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1204) add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1204)
MACRO(installPackage dir component) MACRO(installPackage dir component)

View file

@ -1,5 +1,9 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR} include_directories(
${CMAKE_CURRENT_BINARY_DIR}) ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
# for kworkspace_export.h
${CMAKE_BINARY_DIR}/libs/kworkspace
)
add_subdirectory(actions) add_subdirectory(actions)