CMakeLists.txt 2.15 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
project(kmag)
2

Christoph Feck's avatar
Christoph Feck committed
3
4
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
set(QT_MIN_VERSION "5.2.0")
5

Christoph Feck's avatar
Christoph Feck committed
6
7
8
9
10
11
12
13
find_package(ECM 1.3.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

add_definitions(-DTRANSLATION_DOMAIN="kmag")

include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
14
include(ECMInstallIcons)
Christoph Feck's avatar
Christoph Feck committed
15
16
17
18
19
include(FeatureSummary)

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    Core
    Widgets
20
    PrintSupport
Christoph Feck's avatar
Christoph Feck committed
21
22
23
)

find_package(KF5 REQUIRED COMPONENTS
24
25
26
27
    DocTools
    I18n
    KIO
    XmlGui
Christoph Feck's avatar
Christoph Feck committed
28
29
30
31
)

#macro_optional_find_package(QAccessibilityClient)
#macro_log_feature(QAccessibilityClient_FOUND "qaccessibilityclient" "KDE client-side accessibility library" "https://projects.kde.org/projects/playground/accessibility/libkdeaccessibilityclient" FALSE "" "Required to enable keyboard focus tracking.")
32
33
34
35

configure_file(
    "${PROJECT_SOURCE_DIR}/focustrackconfig.h.in"
    "${PROJECT_BINARY_DIR}/focustrackconfig.h")
36

37
38
39
40
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)

Sebastian Sauer's avatar
Sebastian Sauer committed
41
42
43
44
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
if(QAccessibilityClient_FOUND)
    include_directories(${QACCESSIBILITYCLIENT_INCLUDE_DIR})
endif(QAccessibilityClient_FOUND)
45

46
add_subdirectory( doc )
Pino Toscano's avatar
Pino Toscano committed
47
add_subdirectory( pics )
48
49
50
51
52
53
########### next target ###############

set(kmag_SRCS 
   kmagzoomview.cpp 
   kmagselrect.cpp 
   kmag.cpp 
54
   colorsim.cpp
55
56
   main.cpp )

Christoph Feck's avatar
Christoph Feck committed
57
add_executable(kmag ${kmag_SRCS})
58

59
60
61
62
63
64
65
66
target_link_libraries(kmag
    Qt5::Core
    Qt5::Widgets
    Qt5::PrintSupport
    KF5::KIOCore
    KF5::I18n
    KF5::XmlGui
)
67
if(QAccessibilityClient_FOUND)
68
    target_link_libraries(kmag ${QACCESSIBILITYCLIENT_LIBRARY})
69
endif(QAccessibilityClient_FOUND)
70

71
install(TARGETS kmag  ${INSTALL_TARGETS_DEFAULT_ARGS} )
72

Christoph Feck's avatar
Christoph Feck committed
73
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
74

75
76
77

########### install files ###############

Laurent Montel's avatar
Laurent Montel committed
78
install( PROGRAMS kmag.desktop  DESTINATION  ${XDG_APPS_INSTALL_DIR} )
Christoph Feck's avatar
Christoph Feck committed
79
install( FILES kmagui.rc  DESTINATION  ${KXMLGUI_INSTALL_DIR}/kmag )
80

81
ecm_install_icons( ICONS 16-apps-kmag.png 32-apps-kmag.png  DESTINATION ${ICON_INSTALL_DIR} )