[RESOLVED] INSTALLS add "strip" command to makefile

  • My pro file looks like this:


    qtconf.files = $${PWD}/qt.conf
    qtconf.path = $${OUT_PWD}/

    start.files = $${PWD}/start.sh
    start.path = $${OUT_PWD}/

    INSTALLS += qtconf start

    and it adds two targets to my makefile:

    @install_qtconf: first FORCE
    @test -d $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/ || mkdir -p $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/
    -$(INSTALL_FILE) /home/tim/Programmieren/quptime/quptime/qt.conf $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/

    uninstall_qtconf: FORCE
    -$(DEL_FILE) -r $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/qt.conf
    -$(DEL_DIR) $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/

    install_start: first FORCE
    @test -d $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/ || mkdir -p $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/
    -$(INSTALL_PROGRAM) /home/tim/Programmieren/quptime/quptime/start.sh $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/
    -strip $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/start.sh

    uninstall_start: FORCE
    -$(DEL_FILE) -r $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/start.sh
    -$(DEL_DIR) $(INSTALL_ROOT)/home/tim/Programmieren/quptime/build-quptime-Desktop-Release/@

    My problem is the "strip" command at the end of the "install_start" target. "start.sh" is a shell script to start the application but the "strip" commands produces an error because the fileformat is unknown. How can I remove "strip"? When I change the permissions of "start.sh" to be not executable "strip" is not added but the file should be executable.

  • I could find how to disable to call a strip on an executable file.
    But here is a possible workaround

    Make start.sh non-executable and add an ".extra" item to your start object.
    According "qmake doc on Installing Files":http://qt-project.org/doc/qt-5/qmake-advanced-usage.html#installing-files
    it should execute extra commands on your target.
    start.files = $${PWD}/start.sh
    start.path = $${OUT_PWD}/
    unix:start.extra = chmod 755 start.sh

  • Yeah, that should work. Thank you!

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.