Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    Tools
    3
    4
    642
    Loading More Posts
    • 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 Nilsson
      Marco Nilsson last edited by Marco Nilsson

      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 Reply Quote 0
      • Marco Nilsson
        Marco Nilsson last edited by Marco Nilsson

        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 Reply Quote 4
        • sierdzio
          sierdzio Moderators last edited by

          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 Reply Quote 0
          • Marco Nilsson
            Marco Nilsson last edited by Marco Nilsson

            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 Reply Quote 4
            • Pablo J. Rogina
              Pablo J. Rogina last edited by

              @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 Reply Quote 2
              • First post
                Last post