Skip to content

Commit b40d414

Browse files
nydragona-usr
andcommitted
build: add opt-in installation of QML lib
Override the package with `withQMLLib = true;` to enable lib installation, alternatively add `-DINSTALL_QML_LIB=ON` to your cmake build command. Co-authored-by: a-usr <[email protected]>
1 parent f95e7db commit b40d414

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

BUILD.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ If your package manager supports enabling some features but not others,
2323
we recommend not exposing the subfeatures and just the main ones that introduce
2424
new dependencies: `wayland`, `x11`, `pipewire`, `hyprland`
2525

26+
### QML Library
27+
If you wish to use a linter or similar tools, you will need the QML Modules for it to pick up on the types.
28+
29+
To disable: `-DINSTALL_QML_LIB=OFF`
30+
31+
2632
### Jemalloc
2733
We recommend leaving Jemalloc enabled as it will mask memory fragmentation caused
2834
by the QML engine, which results in much lower memory usage. Without this you

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ option(BUILD_TESTING "Build tests" OFF)
99
option(ASAN "Enable ASAN" OFF) # note: better output with gcc than clang
1010
option(FRAME_POINTERS "Always keep frame pointers" ${ASAN})
1111

12+
option(INSTALL_QML_LIB "Installing the QML lib" ON)
1213
option(CRASH_REPORTER "Enable the crash reporter" ON)
1314
option(USE_JEMALLOC "Use jemalloc over the system malloc implementation" ON)
1415
option(SOCKETS "Enable unix socket support" ON)
@@ -30,6 +31,7 @@ option(SERVICE_UPOWER "UPower service" ON)
3031
option(SERVICE_NOTIFICATIONS "Notification server" ON)
3132

3233
message(STATUS "Quickshell configuration")
34+
message(STATUS " QML lib installation: ${INSTALL_QML_LIB}")
3335
message(STATUS " Crash reporter: ${CRASH_REPORTER}")
3436
message(STATUS " Jemalloc: ${USE_JEMALLOC}")
3537
message(STATUS " Build tests: ${BUILD_TESTING}")
@@ -119,6 +121,14 @@ find_package(Qt6 REQUIRED COMPONENTS ${QT_FPDEPS})
119121
qt_standard_project_setup(REQUIRES 6.6)
120122
set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules)
121123

124+
if (INSTALL_QML_LIB)
125+
install(
126+
DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules/
127+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt-6/qml
128+
FILES_MATCHING PATTERN "*"
129+
)
130+
endif()
131+
122132
# pch breaks clang-tidy..... somehow
123133
if (NOT NO_PCH)
124134
file(GENERATE

default.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
withPipewire ? true,
3838
withPam ? true,
3939
withHyprland ? true,
40+
withQMLLib ? true,
4041
}: buildStdenv.mkDerivation {
4142
pname = "quickshell${lib.optionalString debug "-debug"}";
4243
version = "0.1.0";
@@ -75,7 +76,8 @@
7576
++ lib.optional (!withWayland) "-DWAYLAND=OFF"
7677
++ lib.optional (!withPipewire) "-DSERVICE_PIPEWIRE=OFF"
7778
++ lib.optional (!withPam) "-DSERVICE_PAM=OFF"
78-
++ lib.optional (!withHyprland) "-DHYPRLAND=OFF";
79+
++ lib.optional (!withHyprland) "-DHYPRLAND=OFF"
80+
++ lib.optional (!withQMLLib) "-DINSTALL_QML_LIB=OFF";
7981

8082
buildPhase = "ninjaBuildPhase";
8183
enableParallelBuilding = true;

0 commit comments

Comments
 (0)