Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. qmake .pro file INCLUDEPATH issue

qmake .pro file INCLUDEPATH issue

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 629 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    korai
    wrote on last edited by
    #1

    In the qmake .pro file, I am including QGIS libraries like following:

    QGIS_DIR = /home/unibw/dev/QGIS
    BUILD_DIR = /home/unibw/dev/cpp/QGIS-Debug-Build
    LIBS += -L$${BUILD_DIR}/output/lib -lqgis_app -lqgis_core -lqgis_gui
    
    INCLUDEPATH += $$BUILD_DIR
    INCLUDEPATH += $$BUILD_DIR/src/core
    INCLUDEPATH += $$BUILD_DIR/src/gui
    
    INCLUDEPATH += $$QGIS_DIR
    INCLUDEPATH += $$QGIS_DIR/src/core
    INCLUDEPATH += $$QGIS_DIR/src/core/settings
    INCLUDEPATH += $$QGIS_DIR/src/core/providers
    INCLUDEPATH += $$QGIS_DIR/src/core/geometry
    INCLUDEPATH += $$QGIS_DIR/src/core/proj
    INCLUDEPATH += $$QGIS_DIR/src/core/metadata
    INCLUDEPATH += $$QGIS_DIR/src/core/symbology
    INCLUDEPATH += $$QGIS_DIR/external/nlohmann
    INCLUDEPATH += $$QGIS_DIR/src/core/expression
    INCLUDEPATH += $$QGIS_DIR/src/core/project
    INCLUDEPATH += $$QGIS_DIR/src/core/vector
    INCLUDEPATH += $$QGIS_DIR/src/core/editform
    INCLUDEPATH += $$QGIS_DIR/src/gui
    INCLUDEPATH += $$QGIS_DIR/src/core/labeling
    INCLUDEPATH += $$QGIS_DIR/src/core/raster
    INCLUDEPATH += $$QGIS_DIR/src/core/layertree
    INCLUDEPATH += $$QGIS_DIR/src/core/textrenderer
    

    However, I don't understand why writing only for example

    INCLUDEPATH += $$QGIS_DIR/src/
    INCLUDEPATH += $$QGIS_DIR/external
    

    Or even just writing

    INCLUDEPATH += $$QGIS_DIR
    

    doesn't work? Shouldn't qmake find the libraries automatically? Why do I need to write every single path to every header files explicitly?

    Christian EhrlicherC 1 Reply Last reply
    0
    • K korai

      In the qmake .pro file, I am including QGIS libraries like following:

      QGIS_DIR = /home/unibw/dev/QGIS
      BUILD_DIR = /home/unibw/dev/cpp/QGIS-Debug-Build
      LIBS += -L$${BUILD_DIR}/output/lib -lqgis_app -lqgis_core -lqgis_gui
      
      INCLUDEPATH += $$BUILD_DIR
      INCLUDEPATH += $$BUILD_DIR/src/core
      INCLUDEPATH += $$BUILD_DIR/src/gui
      
      INCLUDEPATH += $$QGIS_DIR
      INCLUDEPATH += $$QGIS_DIR/src/core
      INCLUDEPATH += $$QGIS_DIR/src/core/settings
      INCLUDEPATH += $$QGIS_DIR/src/core/providers
      INCLUDEPATH += $$QGIS_DIR/src/core/geometry
      INCLUDEPATH += $$QGIS_DIR/src/core/proj
      INCLUDEPATH += $$QGIS_DIR/src/core/metadata
      INCLUDEPATH += $$QGIS_DIR/src/core/symbology
      INCLUDEPATH += $$QGIS_DIR/external/nlohmann
      INCLUDEPATH += $$QGIS_DIR/src/core/expression
      INCLUDEPATH += $$QGIS_DIR/src/core/project
      INCLUDEPATH += $$QGIS_DIR/src/core/vector
      INCLUDEPATH += $$QGIS_DIR/src/core/editform
      INCLUDEPATH += $$QGIS_DIR/src/gui
      INCLUDEPATH += $$QGIS_DIR/src/core/labeling
      INCLUDEPATH += $$QGIS_DIR/src/core/raster
      INCLUDEPATH += $$QGIS_DIR/src/core/layertree
      INCLUDEPATH += $$QGIS_DIR/src/core/textrenderer
      

      However, I don't understand why writing only for example

      INCLUDEPATH += $$QGIS_DIR/src/
      INCLUDEPATH += $$QGIS_DIR/external
      

      Or even just writing

      INCLUDEPATH += $$QGIS_DIR
      

      doesn't work? Shouldn't qmake find the libraries automatically? Why do I need to write every single path to every header files explicitly?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @korai said in qmake .pro file INCLUDEPATH issue:

      Shouldn't qmake find the libraries automatically?

      No, and you don't define libraries here but include paths for the compiler.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      K 1 Reply Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        @korai said in qmake .pro file INCLUDEPATH issue:

        Shouldn't qmake find the libraries automatically?

        No, and you don't define libraries here but include paths for the compiler.

        K Offline
        K Offline
        korai
        wrote on last edited by korai
        #3

        @Christian-Ehrlicher thank you for your reply. Is it the correct way to do? I mean, should I write every single path explicitly? I would expect that

        INCLUDEPATH += $$QGIS_DIR/src/core
        

        should work also for other paths beginning with $$QGIS_DIR/src/ for instance:

        INCLUDEPATH += $$QGIS_DIR/src/core/settings
        INCLUDEPATH += $$QGIS_DIR/src/core/providers
        INCLUDEPATH += $$QGIS_DIR/src/core/geometry
        ...
        
        Christian EhrlicherC 1 Reply Last reply
        0
        • K korai

          @Christian-Ehrlicher thank you for your reply. Is it the correct way to do? I mean, should I write every single path explicitly? I would expect that

          INCLUDEPATH += $$QGIS_DIR/src/core
          

          should work also for other paths beginning with $$QGIS_DIR/src/ for instance:

          INCLUDEPATH += $$QGIS_DIR/src/core/settings
          INCLUDEPATH += $$QGIS_DIR/src/core/providers
          INCLUDEPATH += $$QGIS_DIR/src/core/geometry
          ...
          
          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @korai said in qmake .pro file INCLUDEPATH issue:

          should work also for other paths beginning with $$QGIS_DIR/src/ for instance:

          I don't know where the QGIS headers are, you have to add those include dirs where the headers you're using are in.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          K 1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            @korai said in qmake .pro file INCLUDEPATH issue:

            should work also for other paths beginning with $$QGIS_DIR/src/ for instance:

            I don't know where the QGIS headers are, you have to add those include dirs where the headers you're using are in.

            K Offline
            K Offline
            korai
            wrote on last edited by korai
            #5

            @Christian-Ehrlicher

            For example, QGIS header files are ordered as follows:

            -QGIS
                -src
                    -core
                           qgsapplication.h
                           -settings
                                 qgssettings.h
                           -maprenderer
                                 qgsmaprenderertask.h
            

            When I include QGIS/src/core, then it only includes qgsapplication.h, but I would expect that it includes also qgssettings.h and qgsmaprenderertask.h header files, because they are in the subdirectories(settings and maprenderer) of the core directory. Is there a flag or something to include paths recursively?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              No there's not.

              Either you include the subfolder as part of your include statements or you give additional paths to your INCLUDEPATH like you currently do.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved