1
0
Fork 0

build: allow specifying QML install dir

This commit is contained in:
outfoxxed 2024-11-04 13:42:21 -08:00
parent cdeec6ee83
commit 2e18340995
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 30 additions and 5 deletions

View file

@ -25,6 +25,16 @@ If we cannot retrieve debug information, please set this to `NO` and
In both cases you should build with `-DCMAKE_BUILD_TYPE=RelWithDebInfo` (then split or keep the debuginfo).
### QML Module dir
Currently all QML modules are statically linked to quickshell, but this is where
tooling information will go.
`-DINSTALL_QML_PREFIX="path/to/qml"`
`-DINSTALL_QMLDIR="/full/path/to/qml"`
`INSTALL_QML_PREFIX` works the same as `INSTALL_QMLDIR`, except it prepends `CMAKE_INSTALL_PREFIX`. You usually want this.
## Dependencies
Quickshell has a set of base dependencies you will always need, names vary by distro:

View file

@ -64,6 +64,9 @@ boption(SERVICE_GREETD "Greetd" ON)
boption(SERVICE_UPOWER "UPower" ON)
boption(SERVICE_NOTIFICATIONS "Notifications" ON)
set(INSTALL_QMLDIR "" CACHE STRING "QML install dir")
set(INSTALL_QML_PREFIX "" CACHE STRING "QML install prefix")
add_compile_options(-Wall -Wextra)
if (FRAME_POINTERS)
@ -154,11 +157,22 @@ if (USE_JEMALLOC)
target_link_libraries(quickshell PRIVATE ${JEMALLOC_LIBRARIES})
endif()
install(
DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt-6/qml
FILES_MATCHING PATTERN "*"
)
if ("${INSTALL_QMLDIR}" STREQUAL "" AND "${INSTALL_QML_PREFIX}" STREQUAL "")
message(WARNING "Neither INSTALL_QMLDIR nor INSTALL_QML_PREFIX is set. QML modules will not be installed.")
else()
if ("${INSTALL_QMLDIR}" STREQUAL "")
set(INSTALLDIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_QML_PREFIX}")
else()
set(INSTALLDIR "${INSTALL_QMLDIR}")
endif()
message(STATUS "QML install dir: ${INSTALLDIR}")
install(
DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules/
DESTINATION ${INSTALLDIR}
FILES_MATCHING PATTERN "*"
)
endif()
install(CODE "
execute_process(

View file

@ -69,6 +69,7 @@
cmakeFlags = [
(lib.cmakeFeature "DISTRIBUTOR" "Official-Nix-Flake")
(lib.cmakeFeature "INSTALL_QML_PREFIX" qt6.qtbase.qtQmlPrefix)
(lib.cmakeBool "DISTRIBUTOR_DEBUGINFO_AVAILABLE" true)
(lib.cmakeFeature "GIT_REVISION" gitRev)
(lib.cmakeBool "CRASH_REPORTER" withCrashReporter)