QMake: Automatically compiling all files in a directory

QMake: Automatically compiling all files in a directory

Asked on January 10, 2019 in Qt.
Add Comment


  • 2 Answer(s)

    Compiling all files in directory:

    The qmake -project  directory will create a project file and includes all the .cpp and .h files in that directory. And to add a pre-compile step that calls qmake -project, to pass the   files.

    qmake -project -o MyFiles.pro && sed '1,/^# Input/d' MyFiles.pro > MyFiles.pri && rm MyFiles.pro
    
    
    Answered on January 10, 2019.
    Add Comment

    The initialized answer is:

    SOURCES += *.cpp
    HEADERS += *.h
    

    The   pro file.  have to get the re-run qmake  to create a  new files.

    Answered on January 10, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.