forked from KDE/klook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
102 lines (76 loc) · 3.09 KB
/
CMakeLists.txt
1
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
project( klook )
cmake_minimum_required( VERSION 3.5.1 FATAL_ERROR )
set (QT_MIN_VERSION "5.9.0")
set (KF5_MIN_VERSION "5.35.0") # TODO: find an appropriate version
find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") # Yeah, everything is deprecated, we know
include(FeatureSummary)
include(ECMAddAppIcon)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
kde_enable_exceptions() # We actually use/handle exceptions
find_package( Qt5 ${QT_MIN_VERSION} NO_MODULE REQUIRED Core Gui Quick Qml Multimedia)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
KDELibs4Support
KIO
Parts
Declarative
Plasma
DBusAddons
)
find_package(Phonon4Qt5 REQUIRED)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
add_subdirectory( icons )
set(EXIV2_MIN_VERSION "0.19")
find_package(Exiv2)
set( QRC_RESOURCES src/resources.qrc )
file( GLOB qml_files "${CMAKE_CURRENT_SOURCE_DIR}/src/qml/*.qml" )
set( klook_SRCS src/main.cpp
src/declarativeviewer.cpp
src/video.cpp
src/text.cpp
src/file.cpp
src/listitem.cpp
src/previewgenerator.cpp
src/previewprovider.cpp
src/filemodel.cpp
src/klookapp.cpp
src/audio.cpp
src/mimeprovider.cpp
src/kpartsdeclarativeitem.cpp
src/kpartswidget.cpp
src/listitemcontent.cpp
src/exifimageprovider.cpp
src/rotatedimage.cpp
${qml_files} )
#set_source_files_properties(src/rotatedimage.cpp PROPERTIES COMPILE_FLAGS ${KDE4_ENABLE_EXCEPTIONS})
file(GLOB ICON_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/hi*-apps-klook.png" )
ecm_add_app_icon(klook_SRCS ICONS ${ICON_SRCS})
add_executable( klook ${klook_SRCS} ${QRC_SOURCES} )
target_include_directories(klook SYSTEM PUBLIC ${PHONON_INCLUDE_DIR})
target_link_libraries(klook KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::KIONTLM
${EXIV2_LIBRARIES}
KF5::Plasma
${PHONON_LIBRARY}
KF5::Parts
KF5::Declarative
KF5::KDELibs4Support
KF5::DBusAddons
Qt5::Core Qt5::Gui Qt5::Qml Qt5::Quick Qt5::Multimedia
)
install( TARGETS klook ${INSTALL_TARGETS_DEFAULT_ARGS} )
install( FILES ${qml_files} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/ )
install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/qml/images/
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/images )
#FIX AT SOME OTHER POINT IN TIME
#Translations
#if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/locale)
#find_package( Msgfmt REQUIRED )
#find_package( Gettext REQUIRED )
#add_subdirectory( locale )
#endif()