CMakeLists.txt 1.66 KB
Newer Older
Jonah Brüchert's avatar
Jonah Brüchert committed
1
project(qrca)
Jonah Brüchert's avatar
Jonah Brüchert committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

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

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

if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
   message(FATAL_ERROR "This application requires an out of source build. Please create a separate build directory.")
endif()

include(FeatureSummary)

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

find_package(ECM 0.0.8 REQUIRED NO_MODULE)

# 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)
27
kde_enable_exceptions()
Jonah Brüchert's avatar
Jonah Brüchert committed
28 29 30

################# Find dependencies #################

Mathis Brüchert's avatar
Mathis Brüchert committed
31
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg QuickControls2 Multimedia DBus)
32
find_package(KF5 REQUIRED COMPONENTS Kirigami2 Purpose I18n Contacts CoreAddons)
Jonah Brüchert's avatar
Jonah Brüchert committed
33 34 35 36 37 38 39 40 41 42 43
find_package(ZXing REQUIRED COMPONENTS Core)

################# Enable C++11 features for clang and gcc #################

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

################# build and install #################
add_subdirectory(src)

Jonah Brüchert's avatar
Jonah Brüchert committed
44 45
install(PROGRAMS org.kde.qrca.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.qrca.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
Mathis Brüchert's avatar
Mathis Brüchert committed
46
install(FILES org.kde.qrca.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps/)
Jonah Brüchert's avatar
Jonah Brüchert committed
47 48

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)