Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QMAKE_POST_LINK fails when more than one exist in .pro file



  • Hi All,
    My scenario is, i need to copy some external third party shared libraries as well as qt dependent libraries into the executable path.

    Here is my .pro file code snippet,

    # to copy shared libraries and third party exe to output dir
    CONFIG( debug, debug|release ) {
    
    #debug
        FILELIST +=  $$PWD/libs/*.dll                       \   # stdfu libraries
                     $$PWD/7z/*.exe                             \   # 7za.exe
                     $$PWD/azure/v140/Win32/Debug/*.dll     \   # azure debug libraries
                    
    
       TARGET_DEST  = $$OUT_PWD/debug
       TARGET_DEST ~= s,/,\\,g # fix slashes
    } else {
    
    #release
        FILELIST +=  $$PWD/libs/*.dll                       \   # stdfu libraries
                     $$PWD/7z/*.exe                             \   # 7za.exe
                     $$PWD/azure/v140/Win32/Release/*.dll     \   # azure debug libraries
                    
        TARGET_DEST  = $$OUT_PWD/release
        TARGET_DEST ~= s,/,\\,g # fix slashes
    }
    
    
    for(file, FILELIST) {
        message($${file})
        TARGET_SRC  = $${file}
        TARGET_SRC  ~= s,/,\\,g # fix slashes
    
        QMAKE_POST_LINK +=$$quote(cmd /c copy /y $${TARGET_SRC} $${TARGET_DEST}$$escape_expand(\n\t))
    }
    
    
    CONFIG( debug, debug|release ) {
        # debug
        QMAKE_POST_LINK += windeployqt --qmldir $$PWD/resources $$OUT_PWD/debug
    } else {
        # release
        QMAKE_POST_LINK += windeployqt --qmldir $$PWD/resources $$OUT_PWD/release
    }
    
    1. In this case only third party libraries are copied successful into output directory.
    2. windeployqt fails to deploy .

    If i comment third party libraries deployment code , then windeployqt deploys sucessfully.

    Can someone please help me understand why QMAKE_POST_LINK fails, if i try do both operation ?


  • Lifetime Qt Champion

    Hi,

    You should check that the variable content is properly separated.


Log in to reply