Creating a custom make-based setup for a project
-
wrote on 27 Jul 2022, 15:20 last edited by 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?
-
wrote on 29 Jul 2022, 09:04 last edited by
OK. I found a solution for that.
I put thesource
andmake
commands in a bash script and only added that script as a custom process step. It is now working. Thanks for the suggestions. -
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?
@mahmoodn Did you try to put the path to the script itself incot "Command" field?
-
wrote on 27 Jul 2022, 18:38 last edited by
-
wrote on 28 Jul 2022, 04:42 last edited by
@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 scriptsetup_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.
-
@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...
-
wrote on 28 Jul 2022, 09:09 last edited by
@jsulm
OK that helped. Please see the picture.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?
-
wrote on 28 Jul 2022, 11:48 last edited by
It might easier to just convert your project to use CMake.
-
wrote on 28 Jul 2022, 12:44 last edited by
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.
-
wrote on 29 Jul 2022, 09:04 last edited by
OK. I found a solution for that.
I put thesource
andmake
commands in a bash script and only added that script as a custom process step. It is now working. Thanks for the suggestions.
1/11