Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to make any file the target of a pro file?
Forum Updated to NodeBB v4.3 + New Features

How to make any file the target of a pro file?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 3 Posters 1.3k Views 3 Watching
  • 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.
  • Marco NilssonM Offline
    Marco NilssonM Offline
    Marco Nilsson
    wrote on last edited by Marco Nilsson
    #1

    I am invoking autotools (autogen.sh, configure, make) to build a third party library. This works just fine but now I want the path to the built library to become the target of my pro file. That is, I want qmake to treat is as the file produced by the pro file, copy it to the output folder after being built and remove it if I invoke make clean. Is that possible?

    1 Reply Last reply
    0
    • Marco NilssonM Offline
      Marco NilssonM Offline
      Marco Nilsson
      wrote on last edited by Marco Nilsson
      #3

      I ended up doing it manually. Not as elegant as a theoretical PROVIDES = $${OBJECTS_DIR}/src/.libs/libwolfssl.a but it will do for now.

      TEMPLATE = aux
      
      autoreconf.target = $${PATH}/configure
      autoreconf.commands = cd $${PATH} ; autoreconf -fi
      autoreconf.depends =
      
      # Configure
      OPTS = --prefix=$${DESTDIR}
      
      configure.target = $${OBJECTS_DIR}/Makefile
      configure.commands = cd $${OBJECTS_DIR} ; $${PATH}/configure $${OPTS}
      configure.depends = autoreconf
      
      build.target = $${OBJECTS_DIR}/src/.libs/libwolfssl.a
      build.commands = cd $${OBJECTS_DIR} ; make
      build.depends = configure
      
      install.target = $${DESTDIR}/lib/libwolfssl.a
      install.commands = cd $${OBJECTS_DIR} ; make install
      install.depends = build
      
      uninstall.commands = cd $${OBJECTS_DIR} ; make uninstall ; $${QMAKE_DEL_FILE} Makefile
      clean.depends += uninstall
      
      QMAKE_EXTRA_TARGETS += autoreconf configure build install uninstall clean
      PRE_TARGETDEPS += $${DESTDIR}/lib/libwolfssl.a
      
      1 Reply Last reply
      4
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #2

        Not entirely sure if it's possible, but maybe this document will help https://doc.qt.io/qt-5/qmake-advanced-usage.html#installing-files

        (Z(:^

        1 Reply Last reply
        0
        • Marco NilssonM Offline
          Marco NilssonM Offline
          Marco Nilsson
          wrote on last edited by Marco Nilsson
          #3

          I ended up doing it manually. Not as elegant as a theoretical PROVIDES = $${OBJECTS_DIR}/src/.libs/libwolfssl.a but it will do for now.

          TEMPLATE = aux
          
          autoreconf.target = $${PATH}/configure
          autoreconf.commands = cd $${PATH} ; autoreconf -fi
          autoreconf.depends =
          
          # Configure
          OPTS = --prefix=$${DESTDIR}
          
          configure.target = $${OBJECTS_DIR}/Makefile
          configure.commands = cd $${OBJECTS_DIR} ; $${PATH}/configure $${OPTS}
          configure.depends = autoreconf
          
          build.target = $${OBJECTS_DIR}/src/.libs/libwolfssl.a
          build.commands = cd $${OBJECTS_DIR} ; make
          build.depends = configure
          
          install.target = $${DESTDIR}/lib/libwolfssl.a
          install.commands = cd $${OBJECTS_DIR} ; make install
          install.depends = build
          
          uninstall.commands = cd $${OBJECTS_DIR} ; make uninstall ; $${QMAKE_DEL_FILE} Makefile
          clean.depends += uninstall
          
          QMAKE_EXTRA_TARGETS += autoreconf configure build install uninstall clean
          PRE_TARGETDEPS += $${DESTDIR}/lib/libwolfssl.a
          
          1 Reply Last reply
          4
          • Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #4

            @Marco-Nilsson if you consider your issue solved, please don't forget to mark your post as such. Thanks.

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            2

            • Login

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