-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
141 lines (118 loc) · 3.7 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
cmake_minimum_required(VERSION 3.5)
project(KokoVP)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
message(STATUS "CMAKE_BUILD_TYPE is not Debug, setting QT_NO_DEBUG_OUTPUT.")
add_compile_definitions(QT_NO_DEBUG_OUTPUT)
endif()
find_package(QT NAMES Qt6)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools OpenGLWidgets Network Xml)
find_package(PkgConfig REQUIRED)
pkg_check_modules(mpv REQUIRED mpv)
# Libraries
set(LIBRARIES
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::OpenGLWidgets
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Xml
${mpv_LIBRARIES}
)
set(TS_FILES KokoVP_ru_RU.ts)
qt_wrap_cpp(MOC_FILES
kokovp.h
mpvwidget.h
playerwidget.h
playercontroller.h
tracksmenu.h
autohidewidget.h # From SMPlayer
singleinstance.h
playlist/playlistmodel.h
playlist/playlist.h
actions/timelabelaction.h # From SMPlayer
actions/volumeslideraction.h # From SMPlayer
actions/timeslider.h # From SMPlayer
actions/timeslideraction.h # From SMPlayer
actions/actionwrapper.h
actions/seekinterface.h
actions/bistableaction.h
actions/incdecactions.h
actions/incdecwheelaction.h
prefs/prefappearance.h
prefs/prefdialog.h
prefs/prefsection.h
prefs/prefmain.h
prefs/prefinput.h
prefs/qactionlistmodel.h
prefs/shortcuteditordelegate.h
prefs/prefscreenshots.h
prefs/prefextfile.h
prefs/seekwidget.h
persistency/filesettingshash.h # From SMPlayer
)
set(MAIN_SRC
main.cpp
kokovp.cpp
mpvwidget.cpp
playerwidget.cpp
playercontroller.cpp
tracksmenu.cpp
autohidewidget.cpp # From SMPlayer
config.cpp
helper.cpp # From SMPlayer
cache.cpp
extensions.cpp # From SMPlayer
singleinstance.cpp
playlist/playlistmodel.cpp
playlist/playlist.cpp
playlist/m3ucodec.cpp
playlist/plscodec.cpp
playlist/xspfcodec.cpp
actions/timelabelaction.cpp # From SMPlayer
actions/volumeslideraction.cpp # From SMPlayer
actions/timeslider.cpp # From SMPlayer
actions/timeslideraction.cpp
actions/actionwrapper.cpp
actions/seekinterface.cpp
actions/bistableaction.cpp
actions/incdecactions.cpp
actions/incdecwheelaction.cpp
prefs/prefappearance.cpp
prefs/prefdialog.cpp
prefs/prefmain.cpp
prefs/prefinput.cpp
prefs/qactionlistmodel.cpp
prefs/shortcuteditordelegate.cpp
prefs/prefscreenshots.cpp
prefs/prefextfile.cpp
prefs/seekwidget.cpp
persistency/filehash.cpp # From SMPlayer
persistency/filesettingshash.cpp # From SMPlayer
)
set(UI
prefs/prefappearance.ui
prefs/prefmain.ui
prefs/prefinput.ui
prefs/prefscreenshots.ui
prefs/prefextfile.ui
)
qt_wrap_ui(FORMS ${UI})
qt_create_translation(QM_FILES ${TS_FILES} ${MAIN_SRC})
qt_add_resources(QRC_CPP icons.qrc)
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
add_executable(kokovp ${MOC_FILES} ${FORMS} ${MAIN_SRC} ${QRC_CPP})
target_link_libraries(kokovp ${LIBRARIES})
qt_add_resources(kokovp "translations" BASE ${CMAKE_BINARY_DIR} PREFIX "i18n" FILES ${QM_FILES})
# Awesome ¯\_(ツ)_/¯
include(GNUInstallDirs)
install(TARGETS kokovp
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)