Home > database >  qmake INSTALLS for a file not existing yet
qmake INSTALLS for a file not existing yet

Time:09-23

Suppose I have a test.pro file with content as followings

unix {
    inspro.path = /tmp
    inspro.files  = test.pro
}
!isEmpty(inspro.path) INSTALLS  = inspro

unix {
    insdoc.path = /tmp
    insdoc.files  = test.txt
}
!isEmpty(insdoc.path) INSTALLS  = insdoc

Running qmake test.pro results in a Makefile. The file, test.pro, exists already, and the created Makefile contains install_inspro and uninstall_inspro for the file test.pro:

install_inspro: first FORCE
        @test -d $(INSTALL_ROOT)/tmp || mkdir -p $(INSTALL_ROOT)/tmp
        $(QINSTALL) /home/jianz/test/pro/test.pro $(INSTALL_ROOT)/tmp/test.pro

uninstall_inspro: FORCE
        -$(DEL_FILE) -r $(INSTALL_ROOT)/tmp/test.pro
        -$(DEL_DIR) $(INSTALL_ROOT)/tmp/ 

However, corresponding install_insdoc and install_insdoc are created if and only if the file test.txt exists.

In the case that the file test.txt is created as part of QMAKE_POST_LINK, is there a way to force qmake to create install_insdoc and uninstall_insdoc?

CodePudding user response:

I think there's a custom install target CONFIG directive to help with this. Add:

    insdoc.CONFIG  = no_check_exist

Documented at https://doc.qt.io/qt-5/qmake-variable-reference.html#installs
More details and caveats at https://wiki.qt.io/Undocumented_QMake#Custom_install_config
Related Q/A: qmake copy files created while building

  • Related