Search code examples
c++qtqmake

Qmake Qt: Move Header file to build folder


I'm new to Qt, with a C# background.

I am creating Dym Libs for a few projects. I want to have the Header files moved to the build folder during compile OR know how to include the Header file in the lib.

Any suggestions on how to make my lib a full package without having to copy/paste the header files, or the best approach for distribution would be great.

Cheers


Solution

  • Use the INSTALLS qmake variable

    public_headers.path = include
    public_headers.files = include/*.h
    
    INSTALLS += public_headers
    

    Then you can call make install (with a proper prefix, see e.g. this question), which should result in the headers being installed alongside the binaries.