Warning, /plasma/libksysguard/systemstats/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 set(SystemStats_SOVERSION 1)
0002 
0003 set(systemstats_SRCS
0004     AggregateSensor.cpp
0005     SensorObject.cpp
0006     SensorContainer.cpp
0007     SensorPlugin.cpp
0008     SensorProperty.cpp
0009     SysFsSensor.cpp
0010     DBusInterface.cpp
0011 )
0012 
0013 set(systemstats_HDRS
0014     AggregateSensor.h
0015     SensorObject.h
0016     SensorContainer.h
0017     SensorPlugin.h
0018     SensorProperty.h
0019     SensorsFeatureSensor.h
0020     SysFsSensor.h
0021     SysctlSensor.h
0022     SensorInfo.h
0023     DBusInterface.h
0024 )
0025 
0026 set_source_files_properties(org.kde.ksystemstats.xml PROPERTIES INCLUDE SensorInfo.h)
0027 qt_add_dbus_interface(dbusinterface_SRCS org.kde.ksystemstats.xml org.kde.ksystemstats)
0028 
0029 # Symbol visibility trickery: We cannot generate the DBus interface class with
0030 # the right export macro, so instead create it as a static library with the right
0031 # visibility preset set, then link to that in the shared library.
0032 add_library(dbusinterface STATIC ${dbusinterface_SRCS})
0033 set_target_properties(dbusinterface PROPERTIES CXX_VISIBILITY_PRESET default)
0034 target_link_libraries(dbusinterface Qt::Core Qt::DBus KSysGuard::Formatter)
0035 set_property(TARGET dbusinterface PROPERTY POSITION_INDEPENDENT_CODE ON)
0036 
0037 add_library(SystemStats ${systemstats_SRCS})
0038 add_library(KSysGuard::SystemStats ALIAS SystemStats)
0039 
0040 target_include_directories(SystemStats
0041     PUBLIC
0042     "$<BUILD_INTERFACE:${libksysguard_SOURCE_DIR}>"
0043     "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/ksysguard/>"
0044 )
0045 
0046 target_link_libraries(SystemStats PUBLIC Qt::Core Qt::DBus KSysGuard::Formatter PRIVATE dbusinterface)
0047 
0048 if (SENSORS_FOUND)
0049     target_sources(SystemStats PRIVATE SensorsFeatureSensor.cpp)
0050     target_link_libraries(SystemStats PUBLIC ${SENSORS_LIBRARIES} KF5::I18n)
0051     target_include_directories(SystemStats PUBLIC ${SENSORS_INCLUDE_DIR})
0052 endif()
0053 
0054 generate_export_header(SystemStats)
0055 
0056 set_target_properties(SystemStats PROPERTIES
0057     LIBRARY_OUTPUT_NAME KSysGuardSystemStats
0058     VERSION ${KSYSGUARD_VERSION}
0059     SOVERSION ${SystemStats_SOVERSION}
0060 )
0061 
0062 install(TARGETS SystemStats EXPORT libksysguardLibraryTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0063 
0064 install(FILES
0065     ${systemstats_HDRS}
0066     ${CMAKE_CURRENT_BINARY_DIR}/systemstats_export.h
0067     ${CMAKE_CURRENT_BINARY_DIR}/org.kde.ksystemstats.h
0068     DESTINATION ${KDE_INSTALL_INCLUDEDIR}/ksysguard/systemstats
0069 )
0070 
0071 install(FILES org.kde.ksystemstats.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})