Qt: Run a script BEFORE make

后端 未结 1 764
猫巷女王i
猫巷女王i 2021-01-22 15:22

I have a script, runScript.sh, that I would like to have run (to setup some environment variables and such) BEFORE making the application.

Using advice from Running a pr

相关标签:
1条回答
  • 2021-01-22 16:16

    Link you've posted explains that very well.

    extralib.target = extra
    extralib.commands = echo "Building extralib.."; \    # Run your programs here
                    make -w -C ../my_libraries/extralib; \
                    echo "Done building extralib."; \
    
    extralib.depends =
    QMAKE_EXTRA_TARGETS += extralib
    PRE_TARGETDEPS = extra
    

    So, that could just be rewritten as

        extralib.target = extra
        extralib.commands = echo "Setuping the envirovment.."; \
                                export MYVAR="/usr/src/whatever" \
                                export SECONDVAR="/home/user" \
                                ./runScript.sh
    
        extralib.depends =
    
    
    
        QMAKE_EXTRA_TARGETS += extralib
        PRE_TARGETDEPS = extra
    
    0 讨论(0)
提交回复
热议问题