A lot of includes notification appears in building with "NMake Makefiles" generator and VS2019 in Japanese locale

When I try to build C applications with “NMake Makefiles” generator and VS2019 in Japanese locale, a lot of includes notification appears on the command prompt screen and so I tend to miss important messages.
Here is a reproducer:

type CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.12)
project(hello_world)
add_executable(app main.c)

type main.c:
 #include <stdio.h>
 int main() {
    printf("Hello World");
    return 0;
 }

The output:
C:\Users\t34ma\Documents\Work\VS2019-include-notices\hello_world\cmbuild>cmake -G "NMake Makefiles" ..
-- The C compiler identification is MSVC 19.29.30136.0
-- The CXX compiler identification is MSVC 19.29.30136.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/t34ma/Documents/Work/VS2019-include-notices/hello_world/cmbuild

C:\Users\t34ma\Documents\Work\VS2019-include-notices\hello_world\cmbuild>nmake

Microsoft(R) Program Maintenance Utility Version 14.29.30136.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[ 50%] Building C object CMakeFiles/app.dir/main.c.obj
main.c
・<・ インクルード ファイル:  C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\stdio.h
・<・ インクルード ファイル:    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vcruntime.h
・<・ インクルード ファイル:     C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\sal.h
・<・ インクルード ファイル:      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\concurrencysal.h
・<・ インクルード ファイル:     C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vadefs.h
・<・ インクルード ファイル:   C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_wstdio.h
・<・ インクルード ファイル:    C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_stdio_config.h
[100%] Linking C executable app.exe
[100%] Built target app

As far as I investigated:

  1. The building process itself is successfully done.
  2. English version of VS2019 outputs no includes notification - it works fine.
  3. When using /showIncludes option, the Japanese message is “メモ: インクルード ファイル:”.
  4. I installed Visual Studio Community 16.11.4. Yesterday, I tried to update to latest one - 16.11.5. But the problem still exists.

So, in the interface between CMake and VS2019(CL.exe in Japanese locale), something is wrong and garbage character might be induced.
Is this CMake problem or should I ask VS2019 people?

Regards,
Tetsuya Mishima

I suspect a bad detection of the ShowIncludes prefix.

What is the content of variable CMAKE_CXX_CL_SHOWINCLUDES_PREFIX?

Hi marc.chevrier, thank you for your quick reply.

OK, I added the last line to the CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.12)
project(hello_world)
add_executable(app main.c)
message(${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX})

Then, I got:

cmake -G "NMake Makefiles" ..
-- The C compiler identification is MSVC 19.29.30136.0
...(skipped)
-- Detecting CXX compile features
-- Detecting CXX compile features - done
メモ: インクルード ファイル:
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/t34ma/Documents/Work/VS2019-include-notices/hello_world/cmbuild

So, it’s properly detected:

The number of includes notifications are varied every execution.
So I guess it’s an erroneous behavior of CMake/VS2019.

Regards, Tetsuya Mishima

This is clearly a CMake bug in the filtering stage of compiler output.

Can you create an issue for this and include your description of the problem?

Thank you.

Thank you for your advice.
I will create an issue and report the problem there later.
Regards,
Tetsuya Mishima