MantisBT - CMake
View Issue Details
0012504CMakeCMakepublic2011-10-08 06:392012-05-09 15:26
Niels Dekker 
Brad King 
normalminoralways
closedfixed 
Windows
CMake 2.8.6 
CMake 2.8.7CMake 2.8.7 
0012504: Fix CMAKE_VERBOSE_MAKEFILE for Visual Studio 10 vcxproj files
Switching on CMAKE_VERBOSE_MAKEFILE does not have any effect, when generating Visual Studio 10 vcxproj files. I tested both CMake 2.8.6 and the git/master branch version. If I understand correctly, CMake ignores this variable for VS10, in order to avoid a Visual C++ compiler warning, "D9035: option 'nologo-' has been deprecated". Such a compiler warning occurs when the VS10 attribute SuppressStartupBanner is set to "FALSE". However, the warning does not occur when SuppressStartupBanner is set to "" (empty string)!

The following XML should be added to vcxproj files, between the <ClCompile> and </ClCompile> tag, when CMAKE_VERBOSE_MAKEFILE is on:
  <SuppressStartupBanner></SuppressStartupBanner>

I would suggest the following fix, in cmVisualStudioGeneratorOptions::SetVerboseMakefile (cmVisualStudioGeneratorOptions.cxx):

Replace:

  if(verbose &&
     this->Version != 10 &&
     this->FlagMap.find("SuppressStartupBanner") == this->FlagMap.end())
    {
    this->FlagMap["SuppressStartupBanner"] = "FALSE";
    }

By:

  if(verbose &&
     this->FlagMap.find("SuppressStartupBanner") == this->FlagMap.end())
    {
    this->FlagMap["SuppressStartupBanner"] = this->Version < 10 ? "FALSE" : "";
    }
Place the following CMakeLists.txt in a directory that contains "sourcefile.cpp", and generate, using Visual Studio 10 as generator.
------------------------------------------------------------------
project(TestVerboseMakefile)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "No /nologo please" FORCE)
add_executable(TestVerboseMakefile sourcefile.cpp)
------------------------------------------------------------------
Open the generated Visual Studio Solution File ("TestVerboseMakefile.sln") in Visual Studio 10. Within VS10, open the TestVerboseMakefile Property Pages, select Configuration Properties, C/C++. Check the field for Suppress Startup Banner. It should not say "Yes (/nologo)", but it should not say "No (/nologo-)" either. Instead, it should just be empty!
Ulzii Luvsanbat (Windows C++ Team) suggested me to make the field for "Supress Startup Banner" empty, in order to get verbose compilations without warnings about 'nologo-':
https://connect.microsoft.com/VisualStudio/feedback/details/680839 [^]
No tags attached.
patch Fix-CMAKE_VERBOSE_MAKEFILE-for-Visual-Studio-10-vcxproj-files.patch (1,384) 2011-10-11 16:57
https://public.kitware.com/Bug/file/4082/Fix-CMAKE_VERBOSE_MAKEFILE-for-Visual-Studio-10-vcxproj-files.patch
Issue History
2011-10-08 06:39Niels DekkerNew Issue
2011-10-08 07:17Niels DekkerNote Added: 0027560
2011-10-11 16:57Niels DekkerFile Added: 0012504-Fix-CMAKE_VERBOSE_MAKEFILE-for-Visual-Studio-10-vcxproj-files.patch
2011-10-11 17:47Brad KingAssigned To => Brad King
2011-10-11 17:47Brad KingStatusnew => assigned
2011-10-11 17:47Brad KingNote Added: 0027565
2011-10-11 17:49Brad KingNote Added: 0027566
2011-10-11 17:49Brad KingStatusassigned => resolved
2011-10-11 17:49Brad KingResolutionopen => fixed
2011-12-16 17:20David ColeFixed in Version => CMake 2.8.7
2011-12-16 17:20David ColeTarget Version => CMake 2.8.7
2012-05-09 15:26David ColeNote Added: 0029444
2012-05-09 15:26David ColeStatusresolved => closed

Notes
(0027560)
Niels Dekker   
2011-10-08 07:17   
CMake mailing list thread on this issue: "[CMake] Shouldn't CMAKE_VERBOSE_MAKEFILE add <SuppressStartupBanner>false</...> to VS 2010 vcxproj files?"
(0027565)
Brad King   
2011-10-11 17:47   
http://www.cmake.org/pipermail/cmake/2011-October/046665.html [^]
(0027566)
Brad King   
2011-10-11 17:49   
Applied, thanks:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=25116a3c [^]
(0029444)
David Cole   
2012-05-09 15:26   
Closing resolved issues that have not been updated in more than 4 months.