Results 1 to 7 of 7

Thread: How can we create .pc file automatically?

  1. #1
    Join Date
    Sep 2008
    Posts
    93
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default How can we create .pc file automatically?

    Hello,

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

    Thanks!

  2. #2
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: How can we create .pc file automatically?

    Which file type is *.pc? Or did you mean *.rc?

    Best Regards
    NoRulez

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How can we create .pc file automatically?

    Quote Originally Posted by learning_qt View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Sep 2008
    Posts
    93
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default Re: How can we create .pc file automatically?

    Ok, Thanks!

    Then do you know how to create from debian package?

  5. #5
    Join Date
    Jul 2007
    Posts
    6
    Thanks
    2

    Default Re: How can we create .pc file automatically?

    Quote Originally Posted by wysota View Post
    Qt won't create pkg-config files for you.
    Wrong.

    Try this:
    Qt Code:
    1. TEMPLATE = lib
    2. CONFIG += create_pc
    3.  
    4. HEADERS = thing.h
    5. SOURCES = thing.cpp
    6.  
    7. headers.path = /usr/include/yourlib
    8. headers.files = thing.h
    9.  
    10. target.path = /usr/lib
    11.  
    12. QMAKE_PKGCONFIG_NAME = yourlibname
    13. QMAKE_PKGCONFIG_DESCRIPTION = yourlib description
    14. QMAKE_PKGCONFIG_LIBDIR = $$target.path
    15. QMAKE_PKGCONFIG_INCDIR = $$headers.path
    16. QMAKE_PKGCONFIG_DESTDIR = pkgconfig
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jul 2007
    Posts
    6
    Thanks
    2

    Default Re: How can we create .pc file automatically?

    Quote Originally Posted by gustavosbarreto View Post
    Wrong.

    Try this:
    Qt Code:
    1. TEMPLATE = lib
    2. CONFIG += create_pc
    3.  
    4. HEADERS = thing.h
    5. SOURCES = thing.cpp
    6.  
    7. headers.path = /usr/include/yourlib
    8. headers.files = thing.h
    9.  
    10. target.path = /usr/lib
    11.  
    12. QMAKE_PKGCONFIG_NAME = yourlibname
    13. QMAKE_PKGCONFIG_DESCRIPTION = yourlib description
    14. QMAKE_PKGCONFIG_LIBDIR = $$target.path
    15. QMAKE_PKGCONFIG_INCDIR = $$headers.path
    16. QMAKE_PKGCONFIG_DESTDIR = pkgconfig
    To copy to clipboard, switch view to plain text mode 
    Sorry. I forgot it:

    Qt Code:
    1. TARGET = yourlibname
    2. INSTALLS += target headers
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: How can we create .pc file automatically?

    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/

Similar Threads

  1. Replies: 5
    Last Post: 27th May 2009, 12:49
  2. Can't create folder if file with same name exists
    By Barry79 in forum Qt Programming
    Replies: 1
    Last Post: 6th May 2009, 16:33
  3. Check for invalid file name in QFileDialog
    By darren in forum Qt Programming
    Replies: 2
    Last Post: 7th November 2008, 14:43
  4. Create a file
    By bfr in forum Qt Programming
    Replies: 2
    Last Post: 29th January 2008, 07:27
  5. create file in another directory
    By raphaelf in forum Qt Programming
    Replies: 3
    Last Post: 16th February 2006, 10:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.