-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #809 from adriaandegroot/master
Draft: CMake-ify the build
- Loading branch information
Showing
21 changed files
with
571 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# lumina-core/icon-themes build, CMake edition. EXPERIMENTAL. | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
# SPDX-FileCopyrightText: Copyright 2022 Adriaan de Groot <[email protected]> | ||
|
||
include(CMakeParseArguments) | ||
|
||
# Installs files for a theme. The theme must have a NAME. | ||
# Files are globbed from SUBDIRS, which are assumed to contain | ||
# only SVGs. Those files are installed to corresponding TARGET_SUBDIR/SUBDIRS | ||
# in the destination. TARGET_SUBDIR is optional (some themes are scalable/, | ||
# some aren't). Files listed explicitly in TOPLEVEL are installed at the | ||
# top-level of the theme. | ||
function(install_theme) | ||
set(options "") # None | ||
set(oneValueArgs NAME TARGET_SUBDIR) | ||
set(multiValueArgs TOPLEVEL SUBDIRS) | ||
|
||
cmake_parse_arguments( | ||
THEME | ||
"${options}" | ||
"${oneValueArgs}" | ||
"${multiValueArgs}" | ||
${ARGN} | ||
) | ||
|
||
if(NOT THEME_NAME) | ||
message(FATAL_ERROR "Missing theme name") | ||
endif() | ||
|
||
set(target_directory "${CMAKE_INSTALL_DATADIR}/icons/${THEME_NAME}") | ||
|
||
install(FILES ${THEME_TOPLEVEL} DESTINATION ${target_directory}) | ||
foreach(d ${THEME_SUBDIRS}) | ||
file(GLOB_RECURSE files "${d}/*.svg") | ||
install( | ||
FILES ${files} | ||
DESTINATION ${target_directory}/${THEME_TARGET_SUBDIR}/${d} | ||
) | ||
endforeach() | ||
endfunction() | ||
|
||
add_subdirectory(lumina-icons) | ||
add_subdirectory(material-design-light) | ||
add_subdirectory(material-design-dark) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# lumina-icons installation, CMake edition. EXPERIMENTAL. | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
# SPDX-FileCopyrightText: Copyright 2022 Adriaan de Groot <[email protected]> | ||
|
||
# This is assumed to be used from inside the icon-theme/CMakeLists, | ||
# which in turn is part of the lumina-core build -- even though | ||
# the source-repository layout doesn't suggest that is the case. | ||
|
||
install_theme( | ||
NAME "lumina-icons" | ||
TOPLEVEL | ||
"index.theme" | ||
SUBDIRS | ||
"actions/symbolic" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Theme installation, CMake edition. EXPERIMENTAL. | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
# SPDX-FileCopyrightText: Copyright 2022 Adriaan de Groot <[email protected]> | ||
|
||
# This is assumed to be used from inside the icon-theme/CMakeLists, | ||
# which in turn is part of the lumina-core build -- even though | ||
# the source-repository layout doesn't suggest that is the case. | ||
|
||
install_theme( | ||
NAME "material-design-light" | ||
TARGET_SUBDIR "scalable" | ||
TOPLEVEL | ||
"index.theme" | ||
"LICENSE" | ||
SUBDIRS | ||
actions | ||
applications | ||
categories | ||
devices | ||
emblems | ||
emotes | ||
international | ||
mimetypes | ||
places | ||
status | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Theme installation, CMake edition. EXPERIMENTAL. | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
# SPDX-FileCopyrightText: Copyright 2022 Adriaan de Groot <[email protected]> | ||
|
||
# This is assumed to be used from inside the icon-theme/CMakeLists, | ||
# which in turn is part of the lumina-core build -- even though | ||
# the source-repository layout doesn't suggest that is the case. | ||
|
||
install_theme( | ||
NAME "material-design-dark" | ||
TARGET_SUBDIR "scalable" | ||
TOPLEVEL | ||
"index.theme" | ||
"LICENSE" | ||
SUBDIRS | ||
actions | ||
applications | ||
categories | ||
devices | ||
emblems | ||
emotes | ||
international | ||
mimetypes | ||
places | ||
status | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# lumina-core build, CMake edition. EXPERIMENTAL. | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
# SPDX-FileCopyrightText: Copyright 2022 Adriaan de Groot <[email protected]> | ||
cmake_minimum_required(VERSION 3.22 FATAL_ERROR) | ||
project(lumina-core VERSION 1.6.2 LANGUAGES C CXX) # TODO: inherit this from top-level | ||
|
||
# CMake Settings (policies to do AUTOMOC as much as possible) | ||
cmake_policy(SET CMP0057 NEW) | ||
cmake_policy(SET CMP0071 NEW) | ||
include(GNUInstallDirs) | ||
|
||
# C++ Settings (pretend everything is modern) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
# ECM setup | ||
include(FeatureSummary) | ||
find_package(ECM 5.88.0 NO_MODULE) | ||
set_package_properties( | ||
ECM | ||
PROPERTIES | ||
TYPE REQUIRED | ||
DESCRIPTION "Extra CMake Modules." | ||
URL "https://commits.kde.org/extra-cmake-modules" | ||
) | ||
feature_summary( | ||
WHAT REQUIRED_PACKAGES_NOT_FOUND | ||
FATAL_ON_MISSING_REQUIRED_PACKAGES | ||
) | ||
|
||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) | ||
|
||
# Dependencies | ||
set(QT_VERSION 5.15.0) | ||
find_package( | ||
Qt5 | ||
${QT_VERSION} | ||
CONFIG | ||
REQUIRED | ||
Concurrent | ||
Core | ||
Gui | ||
Multimedia | ||
MultimediaWidgets | ||
Network | ||
Quick | ||
Qml | ||
Svg | ||
Widgets | ||
X11Extras | ||
) | ||
find_package(X11) | ||
find_package( | ||
XCB | ||
MODULE | ||
COMPONENTS | ||
XCB | ||
KEYSYMS | ||
XKB | ||
XFIXES | ||
AUX | ||
COMPOSITE | ||
DAMAGE | ||
DPMS | ||
EWMH | ||
ICCCM | ||
IMAGE | ||
SCREENSAVER | ||
OPTIONAL_COMPONENTS XTEST | ||
) | ||
if(NOT X11_FOUND OR NOT XCB_XCB_FOUND) | ||
message(FATAL_ERROR "Required XCB component for X11 not found.") | ||
endif() | ||
|
||
# OS-detection | ||
# | ||
# This ignores the actual OS and just sets FreeBSD-useful values | ||
add_definitions( | ||
-DL_ETCDIR=QStringLiteral\("${CMAKE_INSTALL_PREFIX}/etc"\) | ||
-DL_SHAREDIR=QStringLiteral\("${CMAKE_INSTALL_PREFIX}/share"\) | ||
) | ||
|
||
# Build options | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
# Lumina Components | ||
add_subdirectory(libLumina) | ||
add_subdirectory(lumina-desktop) | ||
add_subdirectory(lumina-session) | ||
add_subdirectory(lumina-open) | ||
add_subdirectory(lumina-info) | ||
add_subdirectory(lumina-pingcursor) | ||
add_subdirectory(lumina-theme-engine) | ||
|
||
# Additional files | ||
|
||
install( | ||
FILES menu-scripts/README.md menu-scripts/ls.json.sh | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/lumina-desktop/menu-scripts | ||
) | ||
install( | ||
FILES | ||
themes/DarkGlass.qss.template | ||
themes/Glass.qss.template | ||
themes/Lumina-default.qss.template | ||
themes/None.qss.template | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/lumina-desktop/themes | ||
) | ||
|
||
# This is a typo, also in the original core.pro, should be xtrafiles/theme.cfg | ||
# | ||
#install( | ||
# FILES extrafiles/theme.cfg | ||
# DESTINATION ${CMAKE_INSTALL_DATADIR}/fluxbox/style/lumina-dark/theme.cfg | ||
#) | ||
install( | ||
FILES xtrafiles/globs2 | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/lumina-desktop | ||
) | ||
|
||
# The icon theme lives outside of core, but should be | ||
# installed along with it. The icon-themes here is the | ||
# binary-directory to use during the build; there isn't | ||
# much to do there except write Makefiles, since the | ||
# icon themes do nothing but copy files out of the source-tree. | ||
add_subdirectory(../../icon-theme icon-themes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# lumina-core/libLumina build, CMake edition. EXPERIMENTAL. | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
# SPDX-FileCopyrightText: Copyright 2022 Adriaan de Groot <[email protected]> | ||
add_library( | ||
libLumina | ||
STATIC | ||
DesktopSettings.cpp | ||
LDesktopUtils.cpp | ||
LFileInfo.cpp | ||
LIconCache.cpp | ||
LInputDevice.cpp | ||
LUtils.cpp | ||
LVideoLabel.cpp | ||
LVideoSurface.cpp | ||
LVideoWidget.cpp | ||
LuminaRandR-X11.cpp | ||
LuminaSingleApplication.cpp | ||
LuminaThemes.cpp | ||
LuminaX11.cpp | ||
LuminaXDG.cpp | ||
ResizeMenu.cpp | ||
XDGMime.cpp | ||
# Header-only classes | ||
ExternalProcess.h | ||
) | ||
if(CMAKE_SYSTEM MATCHES "FreeBSD") | ||
target_sources(libLumina PUBLIC LuminaOS-FreeBSD.cpp) | ||
endif() | ||
|
||
target_include_directories(libLumina PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_link_libraries( | ||
libLumina | ||
PUBLIC | ||
Qt5::Concurrent | ||
Qt5::Core | ||
Qt5::MultimediaWidgets | ||
Qt5::Svg | ||
Qt5::Widgets | ||
Qt5::X11Extras | ||
XCB::XCB | ||
XCB::AUX | ||
XCB::DAMAGE | ||
XCB::SCREENSAVER | ||
X11::Xdamage | ||
) |
Oops, something went wrong.