CMakeLists.txt 3.26 KB
Newer Older
1
project(libksysguard)
2
set(PROJECT_VERSION "5.4.3")
3
set(PROJECT_VERSION_MAJOR 5)
4 5 6 7 8
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)

include(FeatureSummary)
include(WriteBasicConfigVersionFile)

Laurent Montel's avatar
Laurent Montel committed
9
find_package(ECM 1.2.0 REQUIRED NO_MODULE)
10 11
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

12
find_package(Qt5 REQUIRED CONFIG COMPONENTS DBus Network Widgets Script)
13 14 15 16 17 18 19 20
find_package(Qt5WebKitWidgets CONFIG)
set_package_properties(Qt5WebKitWidgets PROPERTIES
                       URL "git://gitorious.org/qt/qtwebkit.git"
                       DESCRIPTION "Qt Webkit module (web browsing engine)"
                       TYPE OPTIONAL
                       PURPOSE "Used by the HTML-based GUI ksysguard library"
                      )

Hrvoje Senjan's avatar
Hrvoje Senjan committed
21
find_package(KF5 REQUIRED COMPONENTS CoreAddons Config I18n WindowSystem Completion Auth WidgetsAddons IconThemes ConfigWidgets Service Plasma)
22 23 24 25 26 27 28 29 30 31
find_package(ZLIB REQUIRED)
set_package_properties(ZLIB PROPERTIES DESCRIPTION "Support for gzip compressed files and data streams"
                       URL "http://www.zlib.net"
                       TYPE REQUIRED
                      )

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)

32
include(ECMAddTests)
33
include(ECMInstallIcons)
34
include(ECMPackageConfigHelpers)
35
include(CheckIncludeFiles)
Eike Hein's avatar
Eike Hein committed
36 37 38 39 40 41
include(ECMSetupVersion)

ecm_setup_version(${PROJECT_VERSION}
                  VARIABLE_PREFIX KSYSGUARD
                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ksysguard_version.h"
                  PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5SysGuardConfigVersion.cmake"
42
                  SOVERSION 7
Eike Hein's avatar
Eike Hein committed
43
)
44

45 46 47 48 49 50 51 52
find_package(X11)
set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
                        URL "http://www.x.org"
                        TYPE OPTIONAL
                        PURPOSE "Required for building the X11 based workspace"
                    )
if(X11_FOUND)
    find_package(Qt5X11Extras REQUIRED)
53 54 55 56 57
    find_library(X11_XRes_LIB XRes ${X11_LIB_SEARCH_PATH})
    find_path(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h ${X11_INC_SEARCH_PATH})

    if(X11_XRes_LIB AND X11_XRes_INCLUDE_PATH)
        set(X11_XRes_FOUND TRUE)
58 59
    endif()
endif()
60

Michael Palimaka's avatar
Michael Palimaka committed
61
set(HAVE_X11 ${X11_FOUND})
62
set(HAVE_XRES ${X11_XRes_FOUND})
63 64
configure_file(config-ksysguard.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ksysguard.h )

65
add_subdirectory( lsofui )
66
add_subdirectory( processcore )
67 68 69
if(Qt5WebKitWidgets_FOUND)
    add_subdirectory( processui )
endif()
70
add_subdirectory( signalplotter )
Bhushan Shah's avatar
Bhushan Shah committed
71
add_subdirectory( ksgrd )
Michael Palimaka's avatar
Michael Palimaka committed
72 73

if(BUILD_TESTING)
74
add_subdirectory( tests )
Michael Palimaka's avatar
Michael Palimaka committed
75
endif()
76

77
install(DIRECTORY scripts/ DESTINATION ${DATA_INSTALL_DIR}/ksysguard/scripts)
78

79
set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/KF5SysGuard)
80 81 82
ecm_configure_package_config_file(KF5SysGuardConfig.cmake.in
    "${CMAKE_CURRENT_BINARY_DIR}/KF5SysGuardConfig.cmake"
    INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR})
83

84 85 86
install(FILES
		${CMAKE_CURRENT_BINARY_DIR}/KF5SysGuardConfig.cmake
		${CMAKE_CURRENT_BINARY_DIR}/KF5SysGuardConfigVersion.cmake
87 88 89 90 91 92 93
        DESTINATION ${CMAKECONFIG_INSTALL_DIR})

install(EXPORT libksysguardLibraryTargets
        NAMESPACE KF5::
        DESTINATION ${CMAKECONFIG_INSTALL_DIR}
        FILE KF5SysGuardLibraryTargets.cmake )

94
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)