MantisBT - CMake
View Issue Details
0015437CMakeCMakepublic2015-03-08 05:512015-11-02 09:13
zalewa 
Brad King 
normalmajoralways
closedfixed 
PCWindows7
 
CMake 3.3CMake 3.3 
0015437: CMake 3.0 produces no console output when `cmake.exe --build .` is used.
I have a Visual Studio 2008 project configured. When I use cmake 2.8.12 and go in to the project's directory and run `cmake --build .` command I get the output from the compiler (errors, progress, summary, and so on). When I do the same with CMake 3.2.0-rc2 the project gets compiled but there's no output at all.
1. Install CMake 3.2.0-rc2
2. Run cmd.exe
3. cd into a directory where a Visual Studio 2008 solution is configured.
4. Run `cmake --build .`.
No tags attached.
Issue History
2015-03-08 05:51zalewaNew Issue
2015-03-09 09:01Brad KingNote Added: 0038182
2015-03-09 13:58zalewaNote Added: 0038191
2015-03-09 13:58zalewaNote Edited: 0038191bug_revision_view_page.php?bugnote_id=38191#r1725
2015-03-09 13:58zalewaNote Edited: 0038191bug_revision_view_page.php?bugnote_id=38191#r1726
2015-03-09 14:06Brad KingNote Added: 0038192
2015-03-09 14:08Brad KingNote Added: 0038193
2015-03-09 14:13zalewaNote Added: 0038194
2015-03-09 14:17Brad KingNote Added: 0038195
2015-03-09 14:21zalewaNote Added: 0038196
2015-03-10 08:51Brad KingNote Added: 0038198
2015-03-10 08:51Brad KingAssigned To => Brad King
2015-03-10 08:51Brad KingStatusnew => assigned
2015-03-10 08:51Brad KingTarget Version => CMake 3.3
2015-03-10 08:51Brad KingSummaryCMake 3.2.0-rc2 produces no console output when `cmake.exe --build .` is used. => CMake 3.0 produces no console output when `cmake.exe --build .` is used.
2015-03-10 08:52Brad KingNote Added: 0038199
2015-03-10 08:52Brad KingStatusassigned => resolved
2015-03-10 08:52Brad KingResolutionopen => fixed
2015-03-10 08:52Brad KingFixed in Version => CMake 3.3
2015-11-02 09:13Robert MaynardNote Added: 0039727
2015-11-02 09:13Robert MaynardStatusresolved => closed

Notes
(0038182)
Brad King   
2015-03-09 09:01   
Is the build tree produced from scratch with 3.2.0 or is it left from 2.8.12? Does the CMakeCache.txt file contain an entry for CMAKE_MAKE_PROGRAM?

See documentation of that variable here:

 http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_MAKE_PROGRAM.html [^]

and the change in default behavior as of 3.0:

http://www.cmake.org/cmake/help/v3.2/release/3.0.html [^]
"When using Visual Studio generators, CMake and CTest no longer require CMAKE_MAKE_PROGRAM to be located up front. Selection of the proper msbuild or devenv tool is now performed as late as possible when the solution (.sln) file is available so it can depend on project content."
(0038191)
zalewa   
2015-03-09 13:58   
> Is the build tree produced from scratch with 3.2.0 or is it left from 2.8.12?

Yes. It's built from scratch.

> Does the CMakeCache.txt file contain an entry for CMAKE_MAKE_PROGRAM?

No. I checked CMakeCache.txt from CMake 2.8 and it pointed to "D:/Programy/Microsoft Visual Studio 9.0/Common7/IDE/VCExpress.exe". I copypasted that into 3.2-rc2, but no avail.

The problem isn't that CMake fails to run the build tool. The build tool is run just fine and the compilation runs and the program gets compiled just fine. The only problem is that there's no output. It's as if cmake.exe's output was redirected to Windows' equivalent of /dev/null.

(0038192)
Brad King   
2015-03-09 14:06   
Re 0015437:0038191: CMake >= 3.0 detect and run the build tool under the hood, and also just shares the pipes directly instead of buffering the output as <= 2.8.12 did.

I cannot reproduce this. I see all the build output.

For debugging, please add the line

  message(STATUS "CMAKE_VS_DEVENV_COMMAND=[${CMAKE_VS_DEVENV_COMMAND}]")

to your CMake code. What does that print?
(0038193)
Brad King   
2015-03-09 14:08   
Re 0015437:0038192: And for completeness:

 message(STATUS "CMAKE_MAKE_PROGRAM=[${CMAKE_MAKE_PROGRAM}]")
(0038194)
zalewa   
2015-03-09 14:13   
CMAKE_VS_DEVENV_COMMAND=[D:/Programy/Microsoft Visual Studio 9.0/Common7/IDE/VCExpress.exe]
CMAKE_MAKE_PROGRAM=[D:/Programy/Microsoft Visual Studio 9.0/Common7/IDE/VCExpress.exe]

The project I'm working on is open-source. Would it help if I provided a link to it?
(0038195)
Brad King   
2015-03-09 14:17   
Re 0015437:0038194: That is the expected output, thanks.

I doubt this is specific to the project you're building, but certainly a link wouldn't hurt.
(0038196)
zalewa   
2015-03-09 14:21   
I also doubt that, but anything is possible.

https://bitbucket.org/Blzut3/doomseeker [^]

For completness: the output is present when I compile the project from Visual Studio's UI, of course.
(0038198)
Brad King   
2015-03-10 08:51   
I've reproduced this specifically with Visual Studio Express using VCExpress.exe as the build tool. It does not happen with devenv.com from the professional versions. It looks like VCExpress.exe itself has no output when used from an interactive console. The only way to convince it to produce output is to set an environment variable (vsconsoleoutput=1), which "cmake --build" already does, and also to have the output go somewhere other than the console.

When CMake 3.0 switched to directly sharing the console pipes with the build tool (primarily to get msbuild color output to work) it broke a workaround we had for VCExpress accidentally.
(0038199)
Brad King   
2015-03-10 08:52   
I've committed a fix that restores the workaround:

 cmake: Teach --build to get VCExpress output
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=94887cb6 [^]
(0039727)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.