-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
86 lines (69 loc) · 2.5 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
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(PhononVLC VERSION 0.12.0)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(PHONON_BUILD_QT5 "Build for Qt5" ON)
option(PHONON_BUILD_QT6 "Build for Qt6" ON)
# CI is stupid and doesn't allow us to set CMAKE options per build variant
if($ENV{CI_JOB_NAME_SLUG} MATCHES "qt5")
set(PHONON_BUILD_QT5 ON)
set(PHONON_BUILD_QT6 OFF)
elseif($ENV{CI_JOB_NAME_SLUG} MATCHES "qt6")
set(PHONON_BUILD_QT5 OFF)
set(PHONON_BUILD_QT6 ON)
endif()
set(VERSIONS)
if(PHONON_BUILD_QT5)
list(APPEND VERSIONS "5")
endif()
if(PHONON_BUILD_QT6)
list(APPEND VERSIONS "6")
set(BUILD_WITH_QT6 ON) # necessary on older ECMs
endif()
set(QT_NO_CREATE_VERSIONLESS_TARGETS ON)
set(QT_NO_CREATE_VERSIONLESS_FUNCTIONS ON)
include(FeatureSummary)
# ECM
find_package(ECM 5.90 NO_MODULE)
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
set_package_properties(ECM PROPERTIES
TYPE REQUIRED
DESCRIPTION "Extra CMake Modules"
URL "https://api.kde.org/frameworks/extra-cmake-modules/html/index.html")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
# PVLC only uses static mimetype lists, they are created by cmake, hooray.
include(MimeTypes.cmake)
# LibVLC
find_package(LIBVLC 3.0.0)
set_package_properties(LIBVLC PROPERTIES
TYPE REQUIRED
DESCRIPTION "VLC C library"
URL "http://git.videolan.org")
function(build_Qt version)
set(QT_MAJOR_VERSION ${version})
include(KDEInstallDirs${QT_MAJOR_VERSION})
include(ECMPoQmTools)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(ECMSetupVersion)
# Phonon
find_package(Phonon4Qt${QT_MAJOR_VERSION} 4.12.0 NO_MODULE)
set_package_properties(Phonon4Qt${QT_MAJOR_VERSION} PROPERTIES
TYPE REQUIRED
DESCRIPTION "Phonon core library"
URL "https://api.kde.org/phonon/html/index.html")
find_package(Phonon4Qt${QT_MAJOR_VERSION}Experimental 4.12.0 NO_MODULE)
set_package_properties(Phonon4Qt${QT_MAJOR_VERSION}Experimental PROPERTIES
TYPE OPTIONAL
DESCRIPTION "Phonon experimental library"
URL "https://api.kde.org/phonon/html/index.html")
if(Phonon4Qt${QT_MAJOR_VERSION}Experimental_FOUND)
set(PHONON_EXPERIMENTAL TRUE)
endif()
ecm_setup_version(PROJECT VARIABLE_PREFIX PHONON_VLC)
add_subdirectory(src src${version})
unset(QUERY_EXECUTABLE CACHE)
endfunction()
foreach(version ${VERSIONS})
build_Qt(${version})
endforeach()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)