forked from KDE/libkdegames
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
132 lines (109 loc) · 3.65 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
cmake_minimum_required (VERSION 3.16 FATAL_ERROR)
set(KDEGAMES_VERSION 7.5.0)
set(KDEGAMES_SOVERSION 7)
project(libkdegames VERSION ${KDEGAMES_VERSION})
set (QT_MIN_VERSION "5.15.0")
set (KF_MIN_VERSION "5.98.0")
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDEClangFormat)
include(KDEGitCommitHooks)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMMarkNonGuiExecutable)
include(ECMGenerateExportHeader)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)
include(FeatureSummary)
include(CMakePackageConfigHelpers)
if (QT_MAJOR_VERSION STREQUAL "6")
set(QT_REQUIRED_VERSION "6.5.0")
set(KF_MIN_VERSION "5.240.0")
set(KF_MAJOR_VERSION "6")
else()
set(KF_MAJOR_VERSION "5")
endif()
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Widgets
Qml
Quick
QuickWidgets
Svg
Test
)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6Core5Compat)
endif()
find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS
Archive
Completion
Config
ConfigWidgets
DNSSD
GuiAddons
IconThemes
I18n
NewStuff
Service
XmlGui
WidgetsAddons
)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(KF6ColorScheme ${KF_MIN_VERSION} REQUIRED COMPONENTS)
endif()
include(InternalMacros)
# reset to 0 once all deprecated API has been removed on full switch to Qt6
if (QT_MAJOR_VERSION STREQUAL "6")
set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 7.5.0 CACHE STRING "Control the range of deprecated API excluded from the build [default=7.5.0].")
else()
set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].")
endif()
set(HIGHSCORE_DIRECTORY "" CACHE STRING "Where to install system-wide highscores e.g. /var/games")
find_package(OpenAL)
set_package_properties(OpenAL PROPERTIES
URL "https://www.openal.org/"
TYPE REQUIRED
)
find_package(SndFile)
set_package_properties(SndFile PROPERTIES
URL "http://www.mega-nerd.com/libsndfile/"
TYPE REQUIRED
)
message(STATUS "Checking libsndfile capabilities")
try_compile(SNDFILE_WORKS
${CMAKE_CURRENT_BINARY_DIR}/src/audio/check-libsndfile-capabilities
${CMAKE_CURRENT_SOURCE_DIR}/src/audio/check-libsndfile-capabilities.cpp
CMAKE_FLAGS -DINCLUDE_DIRECTORIES=${SNDFILE_INCLUDE_DIR})
if (NOT SNDFILE_WORKS)
message(FATAL_ERROR "Your version of libsndfile (found in " ${SNDFILE_LIBRARIES} ") is too old. At least version 0.21 is needed.")
endif (NOT SNDFILE_WORKS)
message (STATUS "INCLUDES FOR SOUND: " ${OPENAL_INCLUDE_DIR} " " ${SNDFILE_INCLUDE_DIR})
message (STATUS "LIBRARIES FOR SOUND: " ${OPENAL_LIBRARY} " " ${SNDFILE_LIBRARIES})
set(KGAUDIO_LINKLIBS ${OPENAL_LIBRARY} ${SNDFILE_LIBRARIES})
set(KGAUDIO_BACKEND openal)
set(KGAUDIO_BACKEND_OPENAL TRUE) # for configure_file() below
add_definitions(-DTRANSLATION_DOMAIN="libkdegames5")
if (QT_MAJOR_VERSION STREQUAL "6")
ecm_set_disabled_deprecation_versions(
QT 6.5
KF 5.239
)
else()
ecm_set_disabled_deprecation_versions(
QT 5.15.2
KF 5.103
KCOREADDONS 5.73 # KRandomSequence, cannot be removed
)
endif()
add_subdirectory(src)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
ki18n_install(po)
file(GLOB_RECURSE CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)