2 cmake_minimum_required(VERSION 2.8.12)
6 if(${CMAKE_SOURCE_DIR} STREQUAL ${kdgantt2_SOURCE_DIR})
8 find_package(ECM 5.16.0 CONFIG REQUIRED)
9 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
11 include(GenerateExportHeader)
12 include(ECMSetupVersion)
13 include(ECMGenerateHeaders)
14 include(ECMGeneratePriFile)
15 include(ECMPackageConfigHelpers)
16 include(ECMSetupVersion)
17 include(FeatureSummary)
18 include(KDEInstallDirs)
19 include(KDECMakeSettings)
20 include(KDEFrameworkCompilerSettings)
21 include(ECMQtDeclareLoggingCategory)
25 set(KF5_VERSION "5.16.0")
26 set(KDEPIM_LIB_VERSION "5.1")
27 set(QT_REQUIRED_VERSION "5.4.0")
28 set(KMIME_LIB_VERSION "4.87.0")
30 find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test PrintSupport)
31 find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
33 ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX KDGANTT2
34 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdgantt2_version.h"
35 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KDGantt2ConfigVersion.cmake"
39 ########### Targets ###########
41 add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
42 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
43 ########### CMake Config Files ###########
44 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KDGantt2")
46 ecm_configure_package_config_file(
47 "${CMAKE_CURRENT_SOURCE_DIR}/KF5KDGantt2Config.cmake.in"
48 "${CMAKE_CURRENT_BINARY_DIR}/KF5KDGantt2Config.cmake"
49 INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
53 "${CMAKE_CURRENT_BINARY_DIR}/KF5KDGantt2Config.cmake"
54 "${CMAKE_CURRENT_BINARY_DIR}/KF5KDGantt2ConfigVersion.cmake"
55 DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
59 install(EXPORT KF5KDGantt2Targets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5KDGantt2Targets.cmake NAMESPACE KF5::)
62 ${CMAKE_CURRENT_BINARY_DIR}/kdgantt2_version.h
63 DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
66 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
68 ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX KDGANTT2
69 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdgantt2_version.h"
70 PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KDGantt2ConfigVersion.cmake"
75 # Laurent install it if you want to debug it
76 #add_subdirectory(tests)