Copying files to build directory on Mac OS...



  • Hello,

    I am trying to copy some files to the build directory on a Mac platform without success.

    On a Microsoft Windows platform the below code works fine but the section marked for Mac does not run.

    What gives?

    Thank you:

    @
    #-------------------------------------------------

    Project created by QtCreator 2015-01-21T16:01:26

    #-------------------------------------------------

    QT += core gui xml network

    CONFIG += c++11

    include(XLSX/qtxlsx.pri)

    INCLUDEPATH += $$PWD/RapidXML

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = CoolApp
    TEMPLATE = app

    win32:RC_ICONS += Icons/CoolApp.ico

    VERSION += 1.0.2.0
    QMAKE_TARGET_COMPANY = "Cool Company, Incorporated"
    QMAKE_TARGET_DESCRIPTION = "Coolest Software Ever."
    QMAKE_TARGET_COPYRIGHT = "Copyright 2015 Cool Company, Incorporated. All rights reserved."
    QMAKE_TARGET_PRODUCT = "Cool Application"

    SOURCES += main.cpp
    qtprimaryapplicationwindow.cpp
    qtchoosecsvfiles.cpp
    qtviewconvertedfiles.cpp
    qtaboutapplicationdialog.cpp
    qtprocessingoptionsandoutput.cpp
    qtdeletablelistwidget.cpp
    qtprocessingoptionswidget.cpp
    qtapplicationsettings.cpp
    qtprocesscsvfiles.cpp
    qtapplicationupdate.cpp
    qtupdatedialog.cpp
    qtutilityfunctions.cpp
    qtprocessingoutput.cpp

    HEADERS += qtprimaryapplicationwindow.h
    qtchoosecsvfiles.h
    qtviewconvertedfiles.h
    qtaboutapplicationdialog.h
    qtprocessingoptionsandoutput.h
    qtdeletablelistwidget.h
    qtprocessingoptionswidget.h
    qtapplicationsettings.h
    qtprocesscsvfiles.h
    qtapplicationupdate.h
    qtupdatedialog.h
    qtutilityfunctions.h
    qtprocessingoutput.h

    FORMS += qtprimaryapplicationwindow.ui
    qtviewconvertedfiles.ui
    qtaboutapplicationdialog.ui
    qtprocessingoptionsandoutput.ui

    macx {

        LogoFiles.path = $$OUT_PWD/Logos
        LogoFiles.files = Logos/*
    
        IconFiles.path = $$OUT_PWD/Icons
        IconFiles.files = Icons/*
    
        LicenseFiles.path = $$OUT_PWD/License
        LicenseFiles.files = License/*
    
        ConfigurationFiles.path = $$OUT_PWD/Configuration
        ConfigurationFiles.files = Configuration/*
    

    }

    !contains(QMAKE_TARGET.arch, x86_64):{

    CONFIG(debug, debug|release) {
    
        LogoFiles.path = $$OUT_PWD/debug/Logos
        LogoFiles.files = Logos/*
    
        IconFiles.path = $$OUT_PWD/debug/Icons
        IconFiles.files = Icons/*
    
        LicenseFiles.path = $$OUT_PWD/debug/License
        LicenseFiles.files = License/*
    
        ConfigurationFiles.path = $$OUT_PWD/debug/Configuration
        ConfigurationFiles.files = Configuration/*
    
    } else {
    
        LogoFiles.path = $$OUT_PWD/release/Logos
        LogoFiles.files = Logos/*
    
        IconFiles.path = $$OUT_PWD/release/Icons
        IconFiles.files = Icons/*
    
        LicenseFiles.path = $$OUT_PWD/release/License
        LicenseFiles.files = License/*
    
        ConfigurationFiles.path = $$OUT_PWD/release/Configuration
        ConfigurationFiles.files = Configuration/*
    
    }
    

    }

    contains(QMAKE_TARGET.arch, x86_64) {

    CONFIG(debug, debug|release) {
    
        LogoFiles.path = $$OUT_PWD/debug/Logos
        LogoFiles.files = Logos/*
    
        IconFiles.path = $$OUT_PWD/debug/Icons
        IconFiles.files = Icons/*
    
        LicenseFiles.path = $$OUT_PWD/debug/License
        LicenseFiles.files = License/*
    
        ConfigurationFiles.path = $$OUT_PWD/debug/Configuration
        ConfigurationFiles.files = Configuration/*
    
    } else {
    
        LogoFiles.path = $$OUT_PWD/release/Logos
        LogoFiles.files = Logos/*
    
        IconFiles.path = $$OUT_PWD/release/Icons
        IconFiles.files = Icons/*
    
        LicenseFiles.path = $$OUT_PWD/release/License
        LicenseFiles.files = License/*
    
        ConfigurationFiles.path = $$OUT_PWD/release/Configuration
        ConfigurationFiles.files = Configuration/*
    
    }
    

    }

    INSTALLS += IconFiles LogoFiles LicenseFiles ConfigurationFiles
    @


  • Lifetime Qt Champion

    Hi,

    Unless I'm mistaken, the value you are setting in your macx scope will be overwritten by the ones from contains(QMAKE_TARGET.arch, x86_64)



  • Hmmm, OK, I'll try specifying macx scope last.



  • So here is what I have now.

    As you can see, I created a Windows scope and a Max scope; the files still don't get copied over.

    The files and folders most certainly exist as on Windows the items get copied over without issues.

    Anything else I can try?

    @#-------------------------------------------------

    Project created by QtCreator 2015-01-21T16:01:26

    #-------------------------------------------------

    QT += core gui xml network

    CONFIG += c++11

    include(XLSX/qtxlsx.pri)

    INCLUDEPATH += $$PWD/RapidXML

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = CoolApp
    TEMPLATE = app

    win32:RC_ICONS += Icons/CoolApp.ico

    VERSION += 1.0.2.0
    QMAKE_TARGET_COMPANY = "Cool Company, Incorporated"
    QMAKE_TARGET_DESCRIPTION = "Coolest Software Ever."
    QMAKE_TARGET_COPYRIGHT = "Copyright 2015 Cool Company, Incorporated. All rights reserved."
    QMAKE_TARGET_PRODUCT = "Cool Application"

    SOURCES += main.cpp
    qtprimaryapplicationwindow.cpp
    qtchoosecsvfiles.cpp
    qtviewconvertedfiles.cpp
    qtaboutapplicationdialog.cpp
    qtprocessingoptionsandoutput.cpp
    qtdeletablelistwidget.cpp
    qtprocessingoptionswidget.cpp
    qtapplicationsettings.cpp
    qtprocesscsvfiles.cpp
    qtapplicationupdate.cpp
    qtupdatedialog.cpp
    qtutilityfunctions.cpp
    qtprocessingoutput.cpp

    HEADERS += qtprimaryapplicationwindow.h
    qtchoosecsvfiles.h
    qtviewconvertedfiles.h
    qtaboutapplicationdialog.h
    qtprocessingoptionsandoutput.h
    qtdeletablelistwidget.h
    qtprocessingoptionswidget.h
    qtapplicationsettings.h
    qtprocesscsvfiles.h
    qtapplicationupdate.h
    qtupdatedialog.h
    qtutilityfunctions.h
    qtprocessingoutput.h

    FORMS += qtprimaryapplicationwindow.ui
    qtviewconvertedfiles.ui
    qtaboutapplicationdialog.ui
    qtprocessingoptionsandoutput.ui

    win32 {

    !contains(QMAKE_TARGET.arch, x86_64):{

    CONFIG(debug, debug|release) {

    LogoFiles.path = $$OUT_PWD/debug/Logos
    LogoFiles.files = Logos/*

    IconFiles.path = $$OUT_PWD/debug/Icons
    IconFiles.files = Icons/*

    LicenseFiles.path = $$OUT_PWD/debug/License
    LicenseFiles.files = License/*

    ConfigurationFiles.path = $$OUT_PWD/debug/Configuration
    ConfigurationFiles.files = Configuration/*

    } else {

    LogoFiles.path = $$OUT_PWD/release/Logos
    LogoFiles.files = Logos/*

    IconFiles.path = $$OUT_PWD/release/Icons
    IconFiles.files = Icons/*

    LicenseFiles.path = $$OUT_PWD/release/License
    LicenseFiles.files = License/*

    ConfigurationFiles.path = $$OUT_PWD/release/Configuration
    ConfigurationFiles.files = Configuration/*

    }

    }

    contains(QMAKE_TARGET.arch, x86_64) {

    CONFIG(debug, debug|release) {

    LogoFiles.path = $$OUT_PWD/debug/Logos
    LogoFiles.files = Logos/*

    IconFiles.path = $$OUT_PWD/debug/Icons
    IconFiles.files = Icons/*

    LicenseFiles.path = $$OUT_PWD/debug/License
    LicenseFiles.files = License/*

    ConfigurationFiles.path = $$OUT_PWD/debug/Configuration
    ConfigurationFiles.files = Configuration/*

    } else {

    LogoFiles.path = $$OUT_PWD/release/Logos
    LogoFiles.files = Logos/*

    IconFiles.path = $$OUT_PWD/release/Icons
    IconFiles.files = Icons/*

    LicenseFiles.path = $$OUT_PWD/release/License
    LicenseFiles.files = License/*

    ConfigurationFiles.path = $$OUT_PWD/release/Configuration
    ConfigurationFiles.files = Configuration/*

    }

    }
    }

    macx {

        LogoFiles.path = $$OUT_PWD/Logos
        LogoFiles.files = Logos/*
    
        IconFiles.path = $$OUT_PWD/Icons
        IconFiles.files = Icons/*
    
        LicenseFiles.path = $$OUT_PWD/License
        LicenseFiles.files = License/*
    
        ConfigurationFiles.path = $$OUT_PWD/Configuration
        ConfigurationFiles.files = Configuration/*
    

    }

    INSTALLS += IconFiles LogoFiles LicenseFiles ConfigurationFiles
    @



  • You can try to use a python script.

    I think thats much easier and your pro file isn't blown up with deploying stuff.

    @QMAKE_POST_LINK += python $$PWD/osx_deploy.py@

    Where osx_deploy.py is your python script.

    You can even pass arguments to your pyhton script.

    @QMAKE_POST_LINK += python $$PWD/osx_deploy.py $$ARGUMENT@



  • OK, I finally figured this out.

    The above code works, no need for the python script which would add unnecessary complexity to the project.

    You just need to add the "INSTALLS" build step and then everything works.

    Makes sense since I am using the "INSTALLS" variable.


Log in to reply
 

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