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. Issue Building Subdirs Project
Qt 6.11 is out! See what's new in the release blog

Issue Building Subdirs Project

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 692 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.
  • A Offline
    A Offline
    agconnell
    wrote on last edited by
    #1

    I have a subdirs project with the following structure

    main
      |__main.pro
      |__app
      |     |__app.pro
      |     |__Qxls
      |           |__qxls.pri      
      |__mylib
      |     |__mylib.pro
      |__mytest
            |__mytest.pro
    

    Everything compiles and runs fine. My issue is if I change some class in the app and compile (ctrl-b) it picks up the changes no problem. However, if I change a class in mylib or mytest ctrl-b does not pick up the changes, I have to do a rebuild which takes a few minutes and is a big waste of time. I reference Qxls from both the mylib and mytest sub projects and I suspect this is the issue, but that's just a guess. What change should I make or how do I resturcture the project to make a simple compile work for the sub projects. If you need to .pro and .pri files I can attach

    J.HilkJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Static or dynamic libraries ?

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

      A 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Static or dynamic libraries ?

        A Offline
        A Offline
        agconnell
        wrote on last edited by
        #3

        @SGaist they are static (CONFIG += staticlib) but willing to change

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

          In that case, you need to use PRE_TARGETDEPS.

          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
          0
          • A agconnell

            I have a subdirs project with the following structure

            main
              |__main.pro
              |__app
              |     |__app.pro
              |     |__Qxls
              |           |__qxls.pri      
              |__mylib
              |     |__mylib.pro
              |__mytest
                    |__mytest.pro
            

            Everything compiles and runs fine. My issue is if I change some class in the app and compile (ctrl-b) it picks up the changes no problem. However, if I change a class in mylib or mytest ctrl-b does not pick up the changes, I have to do a rebuild which takes a few minutes and is a big waste of time. I reference Qxls from both the mylib and mytest sub projects and I suspect this is the issue, but that's just a guess. What change should I make or how do I resturcture the project to make a simple compile work for the sub projects. If you need to .pro and .pri files I can attach

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @agconnell can you show the main pro file, that manages your project?


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              aconnell
              wrote on last edited by aconnell
              #6

              To close the loop on this, I changed the layout of the project and added PRE_TARGETDEPS as noted below. It works as expected now. Thanks!

              main
                |__main.pro
                |__app
                |     |__app.pro   
                |__mylib
                |     |__mylib.pro
                |__mytest
                |     |__mytest.pro
                |__Qxls
              		|__qxls.pro
              
              win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../QXlsx/release/libQXlsx.a
              else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../QXlsx/debug/libQXlsx.a
              else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../QXlsx/release/QXlsx.lib
              else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../QXlsx/debug/QXlsx.lib
              else:unix: PRE_TARGETDEPS += $$OUT_PWD/../QXlsx/libQXlsx.a
              
              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