Commit ca290e7e authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Peter Korsgaard
Browse files

qt: move host programs and specs in HOST_DIR



The Qt build system installs all host programs (uic, rcc, moc, qmake,
etc.) in the same base directory as the headers and libraries, but
that's not great for Buildroot.

So we now move the host programs and the mkspecs files to the
$(HOST_DIR), and create a qt.conf, which tells qmake where everything
is located.

Tested with Qmake and Cmake as build system for a simple Qt
application.

Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent 0c19765b
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -536,8 +536,24 @@ $(QT_TARGET_DIR)/.compiled: $(QT_TARGET_DIR)/.configured
	$(MAKE) -C $(QT_TARGET_DIR)
	touch $@

$(STAGING_DIR)/usr/lib/libQtCore.la: $(QT_TARGET_DIR)/.compiled
$(HOST_DIR)/usr/bin/qt.conf:
	mkdir -p $(dir $@)
	echo "[Paths]" > $@
	echo "Prefix=$(HOST_DIR)/usr" >> $@
	echo "Headers=$(STAGING_DIR)/usr/include" >> $@
	echo "Libraries=$(STAGING_DIR)/usr/lib" >> $@
	echo "Data=$(HOST_DIR)/usr" >> $@
	echo "Binaries=$(HOST_DIR)/usr/bin" >> $@

$(STAGING_DIR)/usr/lib/libQtCore.la: $(QT_TARGET_DIR)/.compiled $(HOST_DIR)/usr/bin/qt.conf
	$(MAKE) -C $(QT_TARGET_DIR) install
	# Move host programs and spec files to the host directory. The
	# generated qt.conf file will tell qmake where everything is.
	mv $(addprefix $(STAGING_DIR)/usr/bin/,moc rcc qmake lrelease) $(HOST_DIR)/usr/bin
ifeq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
	mv $(STAGING_DIR)/usr/bin/uic $(HOST_DIR)/usr/bin
endif
	mv $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/usr

qt-gui: $(STAGING_DIR)/usr/lib/libQtCore.la
	mkdir -p $(TARGET_DIR)/usr/lib/fonts