PDA

View Full Version : How can we create .pc file automatically?



learning_qt
30th September 2009, 13:48
Hello,

I hope to create a *.pc file for my package. Is there a tool or command to create with QT?

Thanks!

NoRulez
30th September 2009, 14:49
Which file type is *.pc? Or did you mean *.rc?

Best Regards
NoRulez

wysota
30th September 2009, 18:31
I hope to create a *.pc file for my package. Is there a tool or command to create with QT?

Qt won't create pkg-config files for you.

learning_qt
1st October 2009, 08:34
Ok, Thanks!

Then do you know how to create from debian package?

gustavosbarreto
8th October 2009, 23:04
Qt won't create pkg-config files for you.

Wrong.

Try this:


TEMPLATE = lib
CONFIG += create_pc

HEADERS = thing.h
SOURCES = thing.cpp

headers.path = /usr/include/yourlib
headers.files = thing.h

target.path = /usr/lib

QMAKE_PKGCONFIG_NAME = yourlibname
QMAKE_PKGCONFIG_DESCRIPTION = yourlib description
QMAKE_PKGCONFIG_LIBDIR = $$target.path
QMAKE_PKGCONFIG_INCDIR = $$headers.path
QMAKE_PKGCONFIG_DESTDIR = pkgconfig

gustavosbarreto
8th October 2009, 23:08
Wrong.

Try this:


TEMPLATE = lib
CONFIG += create_pc

HEADERS = thing.h
SOURCES = thing.cpp

headers.path = /usr/include/yourlib
headers.files = thing.h

target.path = /usr/lib

QMAKE_PKGCONFIG_NAME = yourlibname
QMAKE_PKGCONFIG_DESCRIPTION = yourlib description
QMAKE_PKGCONFIG_LIBDIR = $$target.path
QMAKE_PKGCONFIG_INCDIR = $$headers.path
QMAKE_PKGCONFIG_DESTDIR = pkgconfig


Sorry. I forgot it:



TARGET = yourlibname
INSTALLS += target headers

rsadhu
9th December 2010, 06:19
TEMPLATE = lib
INSTALLS += target headers
TARGET =
DEPENDPATH += .
INCLUDEPATH += . \
/usr/include/myIncludes

LIBS += -lmylibs


# Input
HEADERS += *.h
SOURCES += *.cpp


CONFIG += create_pc

headers.path = /usr/include/spUtility
headers.files = spUtility.h

target.path = /usr/lib

QMAKE_PKGCONFIG_NAME = spUtility
QMAKE_PKGCONFIG_DESCRIPTION = spUtility is the utility lib for wrt service providers
QMAKE_PKGCONFIG_LIBDIR = $$target.path
QMAKE_PKGCONFIG_INCDIR = $$headers.path
QMAKE_PKGCONFIG_DESTDIR = pkgconfig


my .pro file looks like above , but in my current directory , i can see pkgconfig foder empty and i get an error while doing make install like this :

install -m 644 -p "pkgconfig//utilities.pc" "/usr/lib/pkgconfig/utilities.pc"
install: cannot stat `pkgconfig//utilities.pc': No such file or directory
make: [install_target] Error 1 (ignored)
install -m 644 -p /home/rakesh/trunk/wrt/serviceproviders/utilities/spUtility.h /usr/include/spUtility/