forked from quickshell/quickshell
		
	build: allow specifying QML install dir
This commit is contained in:
		
							parent
							
								
									cdeec6ee83
								
							
						
					
					
						commit
						2e18340995
					
				
					 3 changed files with 30 additions and 5 deletions
				
			
		
							
								
								
									
										10
									
								
								BUILD.md
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								BUILD.md
									
										
									
									
									
								
							| 
						 | 
					@ -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).
 | 
					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
 | 
					## Dependencies
 | 
				
			||||||
Quickshell has a set of base dependencies you will always need, names vary by distro:
 | 
					Quickshell has a set of base dependencies you will always need, names vary by distro:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -64,6 +64,9 @@ boption(SERVICE_GREETD "Greetd" ON)
 | 
				
			||||||
boption(SERVICE_UPOWER "UPower" ON)
 | 
					boption(SERVICE_UPOWER "UPower" ON)
 | 
				
			||||||
boption(SERVICE_NOTIFICATIONS "Notifications" 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)
 | 
					add_compile_options(-Wall -Wextra)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (FRAME_POINTERS)
 | 
					if (FRAME_POINTERS)
 | 
				
			||||||
| 
						 | 
					@ -154,11 +157,22 @@ if (USE_JEMALLOC)
 | 
				
			||||||
	target_link_libraries(quickshell PRIVATE ${JEMALLOC_LIBRARIES})
 | 
						target_link_libraries(quickshell PRIVATE ${JEMALLOC_LIBRARIES})
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
install(
 | 
					if ("${INSTALL_QMLDIR}" STREQUAL "" AND "${INSTALL_QML_PREFIX}" STREQUAL "")
 | 
				
			||||||
	DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules/
 | 
						message(WARNING "Neither INSTALL_QMLDIR nor INSTALL_QML_PREFIX is set. QML modules will not be installed.")
 | 
				
			||||||
	DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt-6/qml
 | 
					else()
 | 
				
			||||||
	FILES_MATCHING PATTERN "*"
 | 
						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 "
 | 
					install(CODE "
 | 
				
			||||||
	execute_process(
 | 
						execute_process(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -69,6 +69,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  cmakeFlags = [
 | 
					  cmakeFlags = [
 | 
				
			||||||
    (lib.cmakeFeature "DISTRIBUTOR" "Official-Nix-Flake")
 | 
					    (lib.cmakeFeature "DISTRIBUTOR" "Official-Nix-Flake")
 | 
				
			||||||
 | 
					    (lib.cmakeFeature "INSTALL_QML_PREFIX" qt6.qtbase.qtQmlPrefix)
 | 
				
			||||||
    (lib.cmakeBool "DISTRIBUTOR_DEBUGINFO_AVAILABLE" true)
 | 
					    (lib.cmakeBool "DISTRIBUTOR_DEBUGINFO_AVAILABLE" true)
 | 
				
			||||||
    (lib.cmakeFeature "GIT_REVISION" gitRev)
 | 
					    (lib.cmakeFeature "GIT_REVISION" gitRev)
 | 
				
			||||||
    (lib.cmakeBool "CRASH_REPORTER" withCrashReporter)
 | 
					    (lib.cmakeBool "CRASH_REPORTER" withCrashReporter)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue