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. Creating a custom make-based setup for a project
Forum Updated to NodeBB v4.3 + New Features

Creating a custom make-based setup for a project

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 4 Posters 575 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.
  • M Offline
    M Offline
    mahmoodn
    wrote on last edited by mahmoodn
    #1

    Hi
    I have installed Qt creator on my Ubuntu 20.04 machine and would like to import and build a C++ project. Normally, on the terminal, I run the following commands:

    $ cd project
    $ source ./simulator/setup.sh
    ... some outputs
    $ make -C ./simulator
    

    I tried to define those commands in the project setting as can be seen below. However, the source command is said to be invalid. Also, when I clock on build, nothing happens.

    Any idea how to fix that?

    75fdba37-3f67-4d23-955e-7361f5013cd9-image.png

    jsulmJ 1 Reply Last reply
    0
    • M Offline
      M Offline
      mahmoodn
      wrote on last edited by
      #11

      OK. I found a solution for that.
      I put the source and make commands in a bash script and only added that script as a custom process step. It is now working. Thanks for the suggestions.

      1 Reply Last reply
      0
      • M mahmoodn

        Hi
        I have installed Qt creator on my Ubuntu 20.04 machine and would like to import and build a C++ project. Normally, on the terminal, I run the following commands:

        $ cd project
        $ source ./simulator/setup.sh
        ... some outputs
        $ make -C ./simulator
        

        I tried to define those commands in the project setting as can be seen below. However, the source command is said to be invalid. Also, when I clock on build, nothing happens.

        Any idea how to fix that?

        75fdba37-3f67-4d23-955e-7361f5013cd9-image.png

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

        @mahmoodn Did you try to put the path to the script itself incot "Command" field?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mahmoodn
          wrote on last edited by
          #3

          You mea like this? Doesn't work either.

          cf52634a-549d-4820-88fb-ea78641d85fe-image.png

          C jsulmJ 2 Replies Last reply
          0
          • M Offline
            M Offline
            mchinand
            wrote on last edited by
            #4

            What does setup.sh actually do? Is it just setting environment variables?

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mahmoodn
              wrote on last edited by
              #5

              Yes. The script is here. Please note that the git clone part in the script is not done because I did that once in the terminal. So, the remaining source commands only adjust the variables for later "make" command.

              1 Reply Last reply
              0
              • M mahmoodn

                You mea like this? Doesn't work either.

                cf52634a-549d-4820-88fb-ea78641d85fe-image.png

                C Offline
                C Offline
                ChrisW67
                wrote on last edited by
                #6

                @mahmoodn source is a shell built-in not an executable the majority of cases; this is the likely origin of this version of the problem. Since the shell script setup_environment.sh has a she-bang (#!) line just make sure it is executable and call it directly.

                That said, I would be surprised if environment variables set and exported by that script will be available in later steps. The steps are likely to be executed in independent environments. Might be wrong.

                1 Reply Last reply
                1
                • M mahmoodn

                  You mea like this? Doesn't work either.

                  cf52634a-549d-4820-88fb-ea78641d85fe-image.png

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

                  @mahmoodn said in Creating a custom make-based setup for a project:

                  You mea like this?

                  No, that is not what I mean. Put only the path to the script...

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mahmoodn
                    wrote on last edited by
                    #8

                    @jsulm
                    OK that helped. Please see the picture.

                    25d0fe7b-b5b3-4461-859d-d68cb7b7b3bb-image.png

                    I was wondering why git command is not recognized. Prior to that I saw that nvcc is also not recognized. So, I manually added that path in the variables. Is there any way to invoke user environment variables to the project instead of manually specifying them?

                    2ec22c90-abe8-4d69-93ed-9f87f1ca5bff-image.png

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mchinand
                      wrote on last edited by
                      #9

                      It might easier to just convert your project to use CMake.

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        mahmoodn
                        wrote on last edited by
                        #10

                        I am not sure because that is a big project and I don't know every detail of that. I appreciate if a Make based solution exists for that.

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          mahmoodn
                          wrote on last edited by
                          #11

                          OK. I found a solution for that.
                          I put the source and make commands in a bash script and only added that script as a custom process step. It is now working. Thanks for the suggestions.

                          1 Reply Last reply
                          0

                          • Login

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