I ran into a unexpected problem when trying to pass build variable value as argument when calling external tool on CLI; the IDE throws an error saying that the variable is undefined. Well, it is defined, for sure, but for some reason, it is not accessible.
What I did:
- I define a build variable (say, numeric_parameter) for every project where it is needed, with distinct values (project->properties->C/C++ Build->Build Variables)
- in External Tools Configuration, there would be a tool (mytool.exe) with an argument of ${numeric_parameter} Then, every time I run this tool, the correct ${numeric_parameter} value would be provided, according to the current active project.
What actually happens: I defined the build variable for some projects, created a common tool configuration, added ${numeric_parameter} as argument. When trying to run the tool, it fails with "reference to undefined variable numeric_parameter" error.
Is there a way to feed a tool with custom, project-specific variable?