1

I have a Qt console app with the following .pro file:

QT -= gui

CONFIG += c++11 console
CONFIG -= app_bundle

# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
        main.cpp

DISTFILES += \
    data.txt

data_files.path = $$OUT_PWD
data_files.files = data.txt
INSTALLS += \
        data_files

As you can see from my .pro file there are two files in project folder: main.cpp and data.txt

I want to copy data.txt from my source folder to build output folder and I know there is INSTALLS for my problem.

What's wrong with my .pro?

scopchanov
  • 7,966
  • 10
  • 40
  • 68
takayoshi
  • 2,789
  • 5
  • 36
  • 56
  • your .pro works correctly for me, have you run `make install`? – eyllanesc Sep 25 '18 at 05:47
  • 1
    http://doc.qt.io/qt-5/qmake-variable-reference.html#distfiles: _This feature is supported by UnixMake specs only._ – scopchanov Sep 25 '18 at 05:50
  • @eyllanesc I use QtCreator under Windows (MinGW toolset). Do you know how to call make install from QtCreator IDE, not from cmd? – takayoshi Sep 25 '18 at 17:07
  • I use another command to copy files from my project to the build folder (the build folder is not the installation folder that's why its code fails), you can check it in my answer https://stackoverflow.com/questions/44234204/qt-5-8-and-pdf-js-error/44235970#44235970, just change `COPY_CONFIG = 3rdParty CV.pdf` to `COPY_CONFIG = data.txt` – eyllanesc Sep 25 '18 at 17:13

0 Answers0