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. How to add a folder to my project?
Forum Updated to NodeBB v4.3 + New Features

How to add a folder to my project?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 562 Views 2 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.
  • S Offline
    S Offline
    sudharsan10
    wrote on last edited by sudharsan10
    #1

    Hello all,
    I have a project "MachineSimulation". I have copied a folder called "Linux" into my project folder. "Linux" is a sample folder with subfolders and several files inside it which was provided by the developer and I just need to add the folder to my project and test it.
    I tried SUBDIRS in my project .pro file but I don't see the folder added to my project. Also I got an error saying "No .pro file found in Linux folder".

    Can anyone help me out please?
    I have attached images of "MachineSimulation" project folder and "Linux" folder which has to be included https://postimg.cc/gallery/jbgYmxs

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

      Hi,

      What exactly do you want to do with these files ?
      Build them independently as an application/library ?
      Integrate them in your own project ?

      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
      • S Offline
        S Offline
        sudharsan10
        wrote on last edited by
        #3

        @SGaist Hey, Thanks for your reply. I would like to integrate them in my project. But, building them as a library also sounds good. Can you tell me how to do them both ways please :)

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

          For project integration, don not use SUBDIRS but create a .pri file that you include in your .pro file and in which you add the files required and link to the required libraries as well.

          For the SUDBDIRS part, create a lib project as you would any other, add the required files, link to the required library.

          You'll likely have to take inspiration from the Makefile to see what is required to build whatever is in that folder.

          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
          • S Offline
            S Offline
            sudharsan10
            wrote on last edited by sudharsan10
            #5

            @SGaist hey, Can you please elaborate a little more on 'adding the files and linking to required libraries'?
            Now I have created a .pri file and I have included it in my .pro file.
            Do I have to add the files from the folder to my project and to the .pri file?

            P:S: This link says to add a subfolder and add files in it and include them in .pri file. Is this what you mean? https://programmersought.com/article/50724387458/

            jsulmJ 1 Reply Last reply
            0
            • S sudharsan10

              @SGaist hey, Can you please elaborate a little more on 'adding the files and linking to required libraries'?
              Now I have created a .pri file and I have included it in my .pro file.
              Do I have to add the files from the folder to my project and to the .pri file?

              P:S: This link says to add a subfolder and add files in it and include them in .pri file. Is this what you mean? https://programmersought.com/article/50724387458/

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @sudharsan10 said in How to add a folder to my project?:

              Do I have to add the files from the folder to my project and to the .pri file?

              As stated you need to add them to the pri file, there is no point in adding it to both. To add source code files see SOURCES and HEADERS variables in qmake documentation. Libs: https://doc.qt.io/qt-5/qmake-variable-reference.html#libs

              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