-1

The question:

How to read file content into a qmake variable and pass it to the compiler?

Address the issue of reading a text file via qmake.

Instead of reading a text file, I would like to get current folder (the folder where this file is in) name. How do I do that?

Community
  • 1
  • 1
KcFnMi
  • 5,516
  • 10
  • 62
  • 136
  • 1
    I haven't tried it but `absolute_path(".")` sounds promising. [More](http://doc.qt.io/qt-5/qmake-function-reference.html). – R Sahu Aug 16 '16 at 16:11
  • 1
    Everyone means something else by "current folder". What folder exactly do you want? Have you looked in qmake documentation at PWD and PWD_OUT variables? Do these documentation entries not answer your question? – Kuba hasn't forgotten Monica Aug 16 '16 at 19:27

1 Answers1

1

Does $$PWD do what you want?

From the documentation:

The PWD variable specifies the full path leading to the directory containing the current file being parsed. This can be useful to refer to files within the source tree when writing project files to support shadow builds.

Peter K
  • 1,372
  • 8
  • 24