Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qmake creating a .pc file.
QtWS25 Last Chance

Qmake creating a .pc file.

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 3 Posters 5.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kmdent
    wrote on 26 Jul 2011, 22:14 last edited by
    #1

    Does anyone know if qmake can create a .pc file? I found someone that said it could here: http://www.qtcentre.org/threads/24422-How-can-we-create-.pc-file-automatically. But I have tried it and got the same results as the person having the issue at the bottom of the thread. I was wondering if someone knew anything about this.

    the .pro file is:

    @TEMPLATE = lib
    TARGET = proc_Model
    QT += declarative dbus
    CONFIG += qt plugin dbus create_pc
    DESTDIR = /usr/lib/

    OBJECTS_DIR = .obj
    MOC_DIR = .moc

    TARGET = $$qtLibraryTarget($$TARGET)

    INCLUDEPATH += ../common

    Input

    SOURCES += ../common/proc_struct.cpp
    listitem.cpp
    listmodel.cpp
    process.cpp
    proc_if.cpp

    HEADERS += ../common/proc_struct.h
    listitem.h
    listmodel.h
    process.h
    proc_if.h

    headers.path= /usr/include/proc_Model
    headers.files = ../common/proc_struct.h
    listitem.h
    listmodel.h
    process.h
    proc_if.h

    target.path = /usr/lib

    QMAKE_PKGCONFIG_NAME = proc_Model
    QMAKE_PKGCONFIG_DESCRIPTION = Model that emits process info
    QMAKE_PKGCONFIG_LIBDIR = $$target.path
    QMAKE_PKGCONFIG_INCDIR = $$target.path
    QMAKE_PKGCONFIG_DESTDIR = pkgconfig

    INSTALLS+=headers target
    @

    When I "make install" I get:

    @install -m 755 -p "/usr/lib/libproc_Model.so" "/usr/lib/libproc_Model.so"
    install: /usr/lib/libproc_Model.so' and /usr/lib/libproc_Model.so' are the same file
    make: [install_target] Error 1 (ignored)
    strip --strip-unneeded "/usr/lib/libproc_Model.so"
    install -m 644 -p "/usr/lib/pkgconfig/proc_Model.pc" "/usr/lib/pkgconfig/proc_Model.pc"
    install: cannot stat `/usr/lib/pkgconfig/proc_Model.pc': No such file or directory
    make: [install_target] Error 1 (ignored)@

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexisdm
      wrote on 30 Jul 2011, 01:08 last edited by
      #2

      I think DESTDIR is for the relative destination directory within the build directory, not the final installation directory (that would be target.path). And that's why you are getting the "are the same file" error.
      So you should probably remove that DESTDIR line.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kmdent
        wrote on 3 Aug 2011, 18:33 last edited by
        #3

        Thanks. That fixed the qmake issue, but it is still not generating the pkgconfig file. Any other ideas?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alexisdm
          wrote on 3 Aug 2011, 19:49 last edited by
          #4

          You have to add:
          @CONFIG += create_prl no_install_prl@

          It also creates a .prl file in the build dir, and would install it in $$target.path without the no_install_prl option.
          And searching through qmake source code I found that if you need to create libtool files (.la files that seem to have the same purpose as .pc files), you can add create_libtool to CONFIG, and it needs create_prl too.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            Larswad
            wrote on 3 Jul 2017, 11:15 last edited by
            #5

            Just awakening this old thread to add a note: To get the actual pc file, add create_pc as well to the CONFIG (needs the create_prl statement as well).
            It will install the .pc file in the SYSROOT/usr/lib/pkgconfig folder upon make install.

            For those with an SDK built using The Yocto Project or alike, I use the following command to install into the correct SDK target sysroot after having sourced the SDK environment script:

            sudo INSTALL_ROOT=$SDKTARGETSYSROOT make install
            
            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved