46,196 questions
Configure CMake Projects to pass current file as an argument for debugging and launch
slymz
6
Reputation points
I have a CMake project that happens to have a few Google Test executable targets. For debugging and building it would be a wonderful feat to be able to pass the current file name as an argument, like so:
{
"name": "CurrentFile",
"args": [
"--gtest_filter=${fileBaseName}.*" // <-- I made the variable name up
],
"project": "CMakeLists.txt",
"projectTarget": "cxx.exe",
"type": "default",
}
Is there such a variable? (side-note, I set test suite name as the file name to simply this automation)
Are there other documented (or yet to be documented) ways to accomplish this?
Thanks
PS: The question exemplifies Google Test. But of course, passing an argument derived from context is the most important question here. It would be useful for other non-google-test targets.
Community Center | Not monitored
Sign in to answer