How to tell "Visual Studio 16 2019" generator to generate log file?

Hi, when running msbuild from the command line I can specify a log file using ‘/flp:logfile’ as follows:

msbuild my_sln.sln /p:Configuration=Release /p:Platform="x64" /flp:logfile=my_logfile.log /verbosity:normal

To build that solution in CMake I run:

cmake -G "Visual Studio 16 2019" -A x64 ..\\..
cmake --build . --config Release

Within CMakeLists.txt, how do I specify that the “Visual Studio 16 2019” generator should output a log file (equivalent of /flp:logfile=my_logfile.log)?

You can pass flags to the underlying build tool like this:

cmake --build . --config Release -- /flp:logfile
1 Like

Thank you.