Solved Qt Creator - External Tools : Obtain the value of a variable in .pro file
-
Hello,
I am writing a tool to work with Qt Creator. I would like to register it as an external tools. And it need two arguments to run: 1) Current editing file 2) The value of QML_IMPORT_PATH defined in pro/pri files. But I can't find a way to pass QML_IMPORT_PATH to external tools. Any suggestion for this problem?
Thanks for any advise.
-
Finally I can not find a direct way to pass QML_IMPORT_PATH via External Tools interface. Instead, I write the value to a file and tell my tools where to find the files.
write_file(qmlimport.path, QML_IMPORT_PATH)
Then setup external tool:
Executable : The path to the executable Arguments: %{CurrentDocument:FilePath} %{CurrentProject:Path}/qmlimport.path
Reference: https://github.com/benlau/sparkqml