can i specify a pre_build step in my .pro file?
-
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?
-
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!!
-
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.
-
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 ) -
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
-
-
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)