c++ - Managing a project with header-only libs in Qt -


Now I'm creating a project that uses a templated, hence the header-only, library, and two apps is.

My folder organization is as follows:

  base / lib base / app1 base / app2   

what I am doing now It is that I have base / lib / lib.pri that looks like this:

  HEADERS + = ../lib/someHeader.h  < / Pre> 

and I include it in the base / app1 / app1piro and base / app2 / ap2pero .

However, in Qt Creator, it looks somewhat ugly, for two reasons:

  • The path in the .pri file depends on it Does it from where it is included. For example, if I had another app, then for some reason I wanted to work in the folder anotherbase / app3 / .
  • It looks at the project tree:

    (I think I need to read the codes after a list to beautiful-print)

      app1 - & gt; App1.pro - & gt; Header - & gt; Source files - & gt; Lib / - - Lib.pri - & gt; Header - & gt; SomeHeader.hAp2 - & gt; Ap 2.pro - & gt; Header - & gt; Source files - & gt; Lib / - - Lib.pri - & gt; Header - & gt; SomeHeader.h   

    So I have twice the library files in the tree view

    Is there any way to optimize it? I have to:

      app1 - & gt; App1.pro - & gt; Header - & gt; Source Files Ep 2 - & gt; Ap 2.pro - & gt; Header - & gt; Source files lib - & gt; Lib.pri - & gt; Headers   

    in the tree view, however if I put .pro on lib and make it my project, then When I want to compile everything, it will complain that there is nothing to compile and create an error for Lib ...

    Thanks!

    In your .pri file, you have to delete all paths to $ $ PWD . This variable is currently the full path to the presess file - that is, the file you include.

    Note that PWD has different meanings from _PRO_FILE_PWD _ , even if they sometimes return the same value.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -