Skip to content

Commit 2ba8f11

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 2ba8f11

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CMakeLists.txt

+10
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

+3-1
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)