Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create an 'install' package for a Qt application?

Generally to install a package on a linux-based operating system you use

./configure
make 
make install

How does this work? And how do I create a package that can be installed this way?

My application uses the Qt framework and I think I'm aiming for something like "MyPackage.tar.gz"

like image 710
sanjay Avatar asked Jan 27 '12 10:01

sanjay


2 Answers

You can create a debian package from your projects. As I understood you want to create a package intended for distibution so I would suggest creating a debian package from your project. Here is an introduction for Debian Packaging system. In the article they at some point describe how to create a "rules" file which is at the core of the build process. Here is a sample of it that I typically use for my Qt/KDE projects:

#!/usr/bin/make -f
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.

#export DH_COMPAT=3
DESTDIR=$(CURDIR)/debian/project
TR_DIR=$(CURDIR)/debian/project/usr/share/qt4/translations

configure:
        qmake project.pro

clean:
        dh_testdir
        dh_testroot
        dh_clean

build:  configure
        dh_testdir
        lrelease translations/project_en.ts
        $(MAKE)

install: build
        mkdir -p $(TR_DIR)
        cp translations/project_en.qm $(TR_DIR)
        $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/project install
        dh_installdirs

binary-arch: build install
         dh_testdir
         dh_testroot
         dh_installmenu
         dh_link
         dh_strip
         dh_compress
         dh_fixperms
         dh_installdeb
         dh_shlibdeps
         dh_gencontrol
         dh_md5sums
         dh_builddeb

This is normally sufficent for small projects.

like image 99
Neox Avatar answered Sep 29 '22 07:09

Neox


configure is usually part of GNU build system (autotools), which is not in use in a typical Qt project. qmake is used instead for build file generation and it internally handles most of the tasks configure does for non-qt projects.

The typical build install process for a Qt application is

qmake
make 
make install

You could create a simple ./configure script that calls qmake if you need the command names to be identical. You can also use autotools with Qt if you need it, see e.g. Qt Creator Instructions For Autotools

like image 21
Tatu Lahtela Avatar answered Sep 29 '22 06:09

Tatu Lahtela