CMakeLists.txt 2.5 KB
Newer Older
1
2
3
4
cmake_minimum_required(VERSION 2.8.12)

project(gravatar)

5
set(KF5_VERSION "5.25.0")
Laurent Montel's avatar
Laurent Montel committed
6
find_package(ECM ${KF5_VERSION} CONFIG REQUIRED)
7
8
9
10
11
12
13
14
15
16
17
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
18
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
19
20
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
Laurent Montel's avatar
Laurent Montel committed
21
set(PIM_VERSION "5.3.40")
22

23
set(QT_REQUIRED_VERSION "5.5.0")
Laurent Montel's avatar
Laurent Montel committed
24
set(LIBGRAVATAR_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
25
set(PIMCOMMON_LIB_VERSION "5.3.40")
26
27
28
29
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Network)
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
30
find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
31
32
find_package(KF5TextWidgets ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
33

Laurent Montel's avatar
Laurent Montel committed
34
ecm_setup_version(${LIBGRAVATAR_LIB_VERSION} VARIABLE_PREFIX GRAVATAR
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
                        VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/gravatar_version.h"
                        PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5GravatarConfigVersion.cmake"
                        SOVERSION 5
)


########### Targets ###########

add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")

########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Gravatar")

ecm_configure_package_config_file(
  "${CMAKE_CURRENT_SOURCE_DIR}/KF5GravatarConfig.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5GravatarConfig.cmake"
  INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES
  "${CMAKE_CURRENT_BINARY_DIR}/KF5GravatarConfig.cmake"
  "${CMAKE_CURRENT_BINARY_DIR}/KF5GravatarConfigVersion.cmake"
  DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
  COMPONENT Devel
)

install(EXPORT KF5GravatarTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5GravatarTargets.cmake NAMESPACE KF5::)

install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/gravatar_version.h
  DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

add_subdirectory(src)
if (BUILD_TESTING)
   add_subdirectory(autotests)
   add_subdirectory(tests)
endif()

install( FILES libgravatar.categories DESTINATION ${KDE_INSTALL_CONFDIR} )