T4 template files are automatically recognizable by the IDE under C# projects, but I have no clue on how they can be integrated into C++ projects (other than using make file
The commands listed in the other answers are partly incorrect, as the file TextTransform.exe has been moved to a new directory: the devenv root folder, e.g.:
C:\Progra~1\Visual Studio 2017\Enterprise\Common7\IDE
The command should now be updated to the following:
"$(DevEnvDir)TextTransform.exe" -out "$(ProjectDir)xxx.cpp" "$(ProjectDir)xxx.tt"
where xxx is the file name of yout .tt template file