CMakeLists.txt 1.96 KB
Newer Older
1
project(calindori)
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
2 3 4 5 6 7 8 9

cmake_minimum_required(VERSION 2.8.12)
set(KF5_MIN_VERSION "5.18.0")
set(QT_MIN_VERSION "5.5.0")

################# Disallow in-source build #################

if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
10
   message(FATAL_ERROR "Calindori requires an out of source build. Please create a separate build directory.")
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
11 12 13 14 15 16 17 18 19
endif()


# Make CPack available to easy generate binary packages
include(CPack)
include(FeatureSummary)

################# set KDE specific information #################

Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
20
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
21 22 23 24 25 26 27 28 29 30 31

# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMPoQmTools)
include(KDECompilerSettings NO_POLICY_SCOPE)

32 33

find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS DBus Core Quick Gui Svg Test Qml QuickControls2)
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
34

Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
35 36
find_package(KF5Config)
find_package(KF5Kirigami2)
37
find_package(KF5I18n)
38
find_package(KF5CalendarCore REQUIRED)
39 40 41
find_package(KF5DBusAddons CONFIG REQUIRED)
find_package(KF5Notifications CONFIG REQUIRED)
find_package(KF5Service CONFIG REQUIRED)
42

Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
43 44 45 46 47 48 49 50 51 52 53 54
################# Enable C++11 features for clang and gcc #################

if(UNIX)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x")
endif()

################# now find all used packages #################

find_package(PkgConfig)
#########################################################################

add_subdirectory(src)
55
add_subdirectory(calindac)
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
56 57 58 59 60

if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
    ecm_install_po_files_as_qm(po)
endif()

61 62
install(FILES org.kde.phone.calindori.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(PROGRAMS org.kde.phone.calindori.desktop DESTINATION ${KDE_INSTALL_APPDIR})
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
63 64 65

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)