0

I have a Qt application that needs a specific folder and some files. This folder is now located inside the project folder. Is there any way to make this folder be "generated" when I use the make command to create the Standalone version of the program.

I was thinking about changing something in my .pro file but could not figure out any solution that way.

The folder contains some .lua code that I need to make the software work properly if the user select some functionalities.

demonplus
  • 5,613
  • 12
  • 49
  • 68
user3009456
  • 15
  • 1
  • 4

3 Answers3

0

Possible solution(see http://doc.qt.io/qt-5/qmake-advanced-usage.html):

TEMPLATE = app
TARGET = 
DEPENDPATH += .
INCLUDEPATH += .

# Input
SOURCES += main.cpp

lua_dir.target = .makedir
lua_dir.commands = test -d lua_dir || mkdir lua_dir

QMAKE_EXTRA_TARGETS += lua_dir
PRE_TARGETDEPS += .makedir

You should replace lua_dir.commands = test -d lua_dir || mkdir lua_dir with appropriate to you command, I use bash command intepreter here.

fghj
  • 8,898
  • 4
  • 28
  • 56
0

One solution that copy these resources to destination folder the binary installed via qmake. Please refer to the link enter link description here

Some answers are out-of-date but inspire enough.

Community
  • 1
  • 1
Dean Song
  • 341
  • 1
  • 10
0
  1. you can change DESTDIR qmake variable to compile binary file straight to specified directory.
  2. you can use INSTALLS:

    someTarget.path = $$OUT_PWD/MyFolder
    someTarget.files = $$PWD/SomeDirToCopy/*
    INSTALLS += someTarget
    

    this will copy all files from ProjectDirectory/SomeDirToCopy folder to BuildDirecory/MyFolder after you run make install in build directory.

Andrei R.
  • 2,374
  • 1
  • 13
  • 27