CMakeLists.txt 1.81 KB
Newer Older
1 2
cmake_minimum_required(VERSION 3.0)

3
project(calindori)
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
4

5 6
set(KF5_MIN_VERSION "5.63.0")
set(QT_MIN_VERSION "5.7.0")
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
7 8 9 10

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

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

include(FeatureSummary)

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

Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
18
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
19 20

# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
21
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
22 23 24 25

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
26
include(ECMPoQmTools)
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
27

28
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
29

Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
30 31
find_package(KF5Config)
find_package(KF5Kirigami2)
32
find_package(KF5I18n)
33
find_package(KF5CalendarCore REQUIRED)
34 35 36
find_package(KF5DBusAddons CONFIG REQUIRED)
find_package(KF5Notifications CONFIG REQUIRED)
find_package(KF5Service CONFIG REQUIRED)
37

Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
38 39 40 41 42 43 44 45 46 47 48 49
################# 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)
50
add_subdirectory(calindac)
Dimitris Kardarakos's avatar
Dimitris Kardarakos committed
51 52 53 54 55

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

56 57
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
58 59 60

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)