can i specify a pre_build step in my .pro file?
-
wrote on 10 Aug 2017, 23:24 last edited by
i don't understand what you're getting at by asking this question?
to be clear, i'm asking "can this be done?"
the answer is "yes" or "no", right?
-
wrote on 10 Aug 2017, 23:30 last edited by
i am just asking you what tool you prefer to use or have used that can do what you want. I am just thinking that you are finding the Qt Creator pro file combination laking in that respect Hence your question to the forum.
This is after all an open forum and any one can ask any kind of question they like. I thought I might learn from your experience of better tools for doing the kind of things you are describing.
Excuse me for wasting your time!!
-
wrote on 10 Aug 2017, 23:48 last edited by
i had been using xcode, which already does the particular thing that i need (always does post-build steps regardless of whether a re-link is necessary), and MSDEV (which did not, causing me to need to delete the exe, by hand, every time)
also i do not know that Qt Creator is lacking this feature, since no definitive answer has been given
i did not intend to ruffle your feathers.
-
wrote on 10 Aug 2017, 23:57 last edited by
Thank you for your explanation. I hope someone on the forum will be able to help you with you question.
good luck. -
Hi
We use $$system to run scripts that does some tasks.doc sample:
UNAME = $$system(uname -s)
contains( UNAME, [lL]inux ):message( This looks like Linux ($$UNAME) to me ) -
wrote on 11 Aug 2017, 15:04 last edited by
but when does that get run? any time the .pro is parsed? mine gets parsed THREE times when i "run qmake", and does NOT get parsed before running
-
wrote on 11 Aug 2017, 21:33 last edited by JKSH 8 Dec 2017, 00:40
Have a look by
[EDIT: Irrelevant link removed --JKSH]
code ...
before the big build Framework start... is a submodule dir that compile bevore all... only question from pro e pri file and comand....or CMakeFile.txt... can do all in build order...
-
wrote on 11 Aug 2017, 22:20 last edited by
i'm not looking for a hack, i'm looking for official support.
i'm guessing at this point the answer is "no" -
I have not tested myself, but see https://wiki.qt.io/Undocumented_QMake:
"And finally an example on how to call a batch file called "PreBuildEvent.bat" each time you compile your code (tested in VisualStudio, based on qt-creator-enterprise-src-3.1.0\share\qtcreator\static.pro):"
PRE_BUILD_FILE = ../Applications/PreBuildEvents.bat # must use a variable as input PHONY_DEPS = . PreBuildEvent.input = PHONY_DEPS # use non-existing file here to execute every time PreBuildEvent.output = phony.txt # the system call to the batch file PreBuildEvent.commands = call $$PRE_BUILD_FILE # some name that displays during execution PreBuildEvent.name = running Pre-Build steps... # "no_link" tells qmake we don’t need to add the output to the object files for linking, and "no_clean" means there is no clean step for them. # "target_predeps" tells qmake that the output of this needs to exist before we can do the rest of our compilation. PreBuildEvent.CONFIG += no_link no_clean target_predeps # Add the compiler to the list of 'extra compilers'. QMAKE_EXTRA_COMPILERS += PreBuildEvent
-
(Of course that is no official solution, but most likely will work nicely)
19/19