MantisBT - CMake
View Issue Details
0013761CMakeCMakepublic2012-11-30 05:122015-01-05 08:39
Stefan Eilemann 
Brad King 
normalfeaturealways
closedfixed 
All
CMake 3.0 
CMake 3.1CMake 3.1 
0013761: Add QUIET option to install() command
Installing large directories, e.g., the output of a doxygen run, prints one line per file resulting in too much noise in the build output. Add an option to the install() command to not print anything upon make install.
No tags attached.
has duplicate 0013785closed David Cole INSTALL command does not support a QUIET/SILENT option 
has duplicate 0014757closed  Reduce output of install step 
patch 0001-Implement-install-.-QUIET-.-13761.patch (15,174) 2014-04-02 15:49
https://public.kitware.com/Bug/file/5120/0001-Implement-install-.-QUIET-.-13761.patch
patch 0001-Implement-install-.-QUIET-.-13761.v2.patch (16,937) 2014-04-02 15:59
https://public.kitware.com/Bug/file/5121/0001-Implement-install-.-QUIET-.-13761.v2.patch
patch 0001-Implement-install-.-QUIET-.-13761.v3.patch (16,937) 2014-04-07 04:38
https://public.kitware.com/Bug/file/5122/0001-Implement-install-.-QUIET-.-13761.v3.patch
diff cmFileCommand.diff (2,039) 2014-06-16 10:32
https://public.kitware.com/Bug/file/5168/cmFileCommand.diff
diff cmFileCommand-global_property.diff (3,311) 2014-06-17 11:31
https://public.kitware.com/Bug/file/5169/cmFileCommand-global_property.diff
diff file_install_option_quite.diff (19,703) 2014-06-19 14:00
https://public.kitware.com/Bug/file/5170/file_install_option_quite.diff
diff file_install_option_quiet2.diff (21,179) 2014-06-19 16:16
https://public.kitware.com/Bug/file/5171/file_install_option_quiet2.diff
Issue History
2012-11-30 05:12Stefan EilemannNew Issue
2012-12-12 07:50David ColeRelationship addedhas duplicate 0013785
2013-08-19 11:40Daniel NachbaurNote Added: 0033735
2014-04-02 15:49Stefan EilemannFile Added: 0001-Implement-install-.-QUIET-.-13761.patch
2014-04-02 15:49Stefan EilemannNote Added: 0035627
2014-04-02 15:49Stefan EilemannNote Edited: 0035627bug_revision_view_page.php?bugnote_id=35627#r1438
2014-04-02 15:59Stefan EilemannFile Added: 0001-Implement-install-.-QUIET-.-13761.v2.patch
2014-04-02 15:59Stefan EilemannNote Added: 0035628
2014-04-07 04:38Stefan EilemannFile Added: 0001-Implement-install-.-QUIET-.-13761.v3.patch
2014-04-07 04:39Stefan EilemannNote Added: 0035644
2014-04-09 09:33Emmanuel BlotNote Added: 0035660
2014-04-27 16:58Emmanuel BlotNote Added: 0035796
2014-05-15 08:05Emmanuel BlotNote Added: 0035883
2014-06-16 10:32d3x0rFile Added: cmFileCommand.diff
2014-06-16 10:34d3x0rNote Added: 0036203
2014-06-16 10:38d3x0rNote Edited: 0036203bug_revision_view_page.php?bugnote_id=36203#r1491
2014-06-16 13:21d3x0rNote Added: 0036205
2014-06-16 15:07Brad KingRelationship addedhas duplicate 0014757
2014-06-16 15:09Brad KingProduct VersionCMake 2.8.10.2 => CMake 3.0
2014-06-16 15:09Brad KingTarget Version => CMake 3.1
2014-06-16 15:10Brad KingNote Added: 0036207
2014-06-16 15:17Brad KingNote Added: 0036208
2014-06-17 11:31d3x0rFile Added: cmFileCommand-global_property.diff
2014-06-17 11:34d3x0rNote Added: 0036214
2014-06-19 11:27Brad KingNote Added: 0036224
2014-06-19 12:14d3x0rNote Added: 0036226
2014-06-19 12:18d3x0rNote Edited: 0036226bug_revision_view_page.php?bugnote_id=36226#r1496
2014-06-19 12:35Brad KingNote Added: 0036227
2014-06-19 14:00d3x0rFile Added: file_install_option_quite.diff
2014-06-19 14:03d3x0rNote Added: 0036228
2014-06-19 14:52Brad KingNote Added: 0036229
2014-06-19 16:16d3x0rFile Added: file_install_option_quiet2.diff
2014-06-19 16:19d3x0rNote Added: 0036231
2014-06-19 16:25d3x0rNote Edited: 0036231bug_revision_view_page.php?bugnote_id=36231#r1498
2014-06-19 16:28d3x0rNote Edited: 0036231bug_revision_view_page.php?bugnote_id=36231#r1499
2014-06-24 14:00Brad KingNote Added: 0036244
2014-06-24 14:01Brad KingAssigned To => Brad King
2014-06-24 14:01Brad KingStatusnew => assigned
2014-08-04 09:37Brad KingNote Added: 0036542
2014-08-04 09:37Brad KingStatusassigned => resolved
2014-08-04 09:37Brad KingResolutionopen => fixed
2014-08-04 09:37Brad KingFixed in Version => CMake 3.1
2015-01-05 08:39Robert MaynardNote Added: 0037606
2015-01-05 08:39Robert MaynardStatusresolved => closed

Notes
(0033735)
Daniel Nachbaur   
2013-08-19 11:40   
+1
(0035627)
Stefan Eilemann   
2014-04-02 15:49   
See attached patch for implementation.

(0035628)
Stefan Eilemann   
2014-04-02 15:59   
v2 with updated documentation
(0035644)
Stefan Eilemann   
2014-04-07 04:39   
v3 rebased against current master (4023bd7b115fb9df6836dacea55e8cb3b1218c9c)
(0035660)
Emmanuel Blot   
2014-04-09 09:33   
Patch v3 works like a charm. Thanks a lot!
(0035796)
Emmanuel Blot   
2014-04-27 16:58   
Any chance to get this feature included in 3.0 final?
It does not seem it has been merged into 3.0-rc4.
(0035883)
Emmanuel Blot   
2014-05-15 08:05   
Nor 3.0-rc5

Maybe someone to add to the CC: list?
(0036203)
d3x0r   
2014-06-16 10:34   
(edited on: 2014-06-16 10:38)
It would be more useful if there were a global flag set rather than modifying very install command. Patterned after CMAKE_INSTALL_ALWAYS patch adds CMAKE_INSTALL_QUIET flag. This can be set in the environment or in a CMake script.

(sent patch on mailing list, but it was manually edited; this is cleaner... ended up deleting/adding blank lines during tests, so I cleaned those up)

https://public.kitware.com/Bug/file/5168/cmFileCommand.diff [^]


There are 3 locations that 'ReportCopy'... symlink install, directory install and file install.

File install is handled by passing/checking a copy flag and testing quiet flag to omit displaying the status if quiet and not copied.

Directories called ReportCopy with (true) so added a check for file_exists and file_is_directory... (won't end up updating permissions if calling CreateDirectory always updates permissions on the directory)

Symlink should be the same as 'file' since it passes the status whether it did the 'copy' or not; but I have now way to test it.

(0036205)
d3x0r   
2014-06-16 13:21   
Hmm that didn't work quite... it does require being set in environment and

set( ENV{CMAKE_INSTALL_QUIET} ON ) doesn't help

had tried initially to use this->Makefile->IsOn( ... ) but that wasn't working right either...
(0036207)
Brad King   
2014-06-16 15:10   
For reference, the patch thread on the mailing list is here:

 Install quiet option
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/10308 [^]
(0036208)
Brad King   
2014-06-16 15:17   
0014757 suggests dropping the Up-to-date notices to reduce output on re-installation. That could be considered here too.
(0036214)
d3x0r   
2014-06-17 11:34   
Update cmFileCommand patch also updates cmLocalGenerator.cxx and adds help/prop_gbl/QUIET_INSTALL.rst;

cmLocalGenerator tests for the QUIET_INSTALL global property and if it is on, also emits that to cmake_install.cmake so install phase can test it in cmFileCommand.
(0036224)
Brad King   
2014-06-19 11:27   
Re 0013761:0036214: Thanks for working on a patch.

Rather than setting a global property in the cmake_install.cmake script I think the file(INSTALL) command should have a QUIET option to control its output verbosity. (It could also honor a CMAKE_INSTALL_QUIET environment variable for consistency with CMAKE_INSTALL_ALWAYS, but that is separate.) Then the generator can be taught to add the QUIET option to file(INSTALL) calls when activated by something during the main configuration. That could be a QUIET option to the install() command and/or a global setting like an INSTALL_QUIET global property or a CMAKE_INSTALL_QUIET variable.
(0036226)
d3x0r   
2014-06-19 12:14   
(edited on: 2014-06-19 12:18)
I disagree...
but then apparently I'm using the install feature out-of-scope with how it was intended...

For working with visual studio especially it just makes things easier to end up with a proper full package as expected.... and rather than having to modify each and every install command, and then I end up requiring a higher version of CMake just to have quiet installs... otherwise it will end up complaining about 'unknown something-or-other QUIET' with older versions.

so my general flow is to build into .../build/<generator>/<${CMAKE_BUILD_TYPE}_solution>/<project>/ which automatically is configured to install into .../build/<generator>/<${CMAKE_BUILD_TYPE}_output>/<project>/ this works very well, keeps watcom, mingw, visual studio builds consistent and seperate... and under _solution I have a dozen or so projects which depend on installed products from other projects. For deployment, can then just grab the contents of ..._output/* for signing and verification...

each top project can consist of more than a dozen subprojects... which results quickly in a permutation of 100's of modifications to INSTALL() command.

So doing a build_all of all projects results in a VERY long output as a lot of files are installed commonly from other projects. In this case it would be much easier to just copy USE_FOLDERS line and modify for the new property... which becomes dozens of non-impact modifications rather than hundreds of incompatible modifications

set_property(GLOBAL PROPERTY USE_FOLDERS ON )
set_property(GLOBAL PROPERTY QUIET_INSTALL ON )

And using visual studio to do a build on 'INSTALL' cannot use SET( $ENV{CMAKE_INSTALL_QUIET} ON ) because the environment is lost between each subsequent run.

(0036227)
Brad King   
2014-06-19 12:35   
Re 0013761:0036226: There are two separate commands involved: install() and file(INSTALL). The former is the command written by projects in CMake code. The latter is generated into cmake_install.cmake scripts. The latter should have options to program its behavior because its effects are immediate. This is where the QUIET option should be added. Then a global setting in the CMake project code can be used to tell the install code generator to pass the QUIET option to generated calls to file(INSTALL). This will allow more granular configuration in the future.
(0036228)
d3x0r   
2014-06-19 14:03   
I see.
I don't know if this patch violates design philosophy... basically I end up passing cmake* (often referred to as this->Makefile->GetCMakeInstance() ) to cmScriptGenerator.

Then later during FILE( INSTALL ) generation I check the global property QUIET_INSTALL and emit QUIET option in FILE() command.

Removed forward propagation of global property.

Should I forward the cmMakefile instead?
(0036229)
Brad King   
2014-06-19 14:52   
Re 0013761:0036228: The script generators should simply have an option for Quiet mode rather than trying to lookup a setting themselves. The 0001-Implement-install-.-QUIET-.-13761.v3.patch attachment already has much of that done.
(0036231)
d3x0r   
2014-06-19 16:19   
(edited on: 2014-06-19 16:28)
I'm not sure about this modification... should it go ahead and do the create anyway? Or return early?

--------------
+++ cmake-3.0.0/Source/cmFileCommand.cxx Thu Jun 19 13:04:09 2014

@@ -1611,7 +1611,11 @@
                                     MatchProperties const& match_properties)
 {
   // Inform the user about this directory installation.
- this->ReportCopy(destination, TypeDir, true);
+ if( cmSystemTools::FileExists(destination) &&
+ cmSystemTools::FileIsDirectory(destination) )
+ this->ReportCopy(destination, TypeDir, false);
+ else
+ this->ReportCopy(destination, TypeDir, true);

   // Make sure the destination directory exists.
   if(!cmSystemTools::MakeDirectory(destination))

----------
ReportCopy() also adds the file to a 'manifest' which the previous patch would not do if the file was not copied... I think even though it is not reported and isn't really copied it should still be part of the installed manifest?
-----------
worked from last rc3 patch;
fixed a setlasterror which needed a .c_str()
added check for global property "QUIET_INSTALL" as an OR if not specified as an Install() option.
added help document for global property QUIET_INSTALL
Fixed(?) file not being added to manifest if not reported
On installing a directory, if the file exists, use ReportCopy(false) (not copied), otherwise use ReportCopy(true)... go through the motion of creating the directory anyway.

-------
I don't know that all install operations support the check for the global property... since this complicates the check places to many instead of 1 generator.... It does handle 'directory' 'files' 'programs' 'static_library' and 'shared_library'...

(0036244)
Brad King   
2014-06-24 14:00   
Thanks to everyone here for the proposed patches and discussion so far. Based on this I've chosen to implement more general infrastructure that subsumes these use cases.

Draft commits are:

 Help: Add install() command document section headers
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=67815894 [^]

 cmInstallTargetGenerator: Drop default constructor arguments
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0a01962 [^]

 file(INSTALL): Do not pre-create DESTINATION for DIRECTORY
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f701b0b7 [^]

 file(INSTALL): Report existing DIRECTORY as Up-to-date
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=464567a5 [^]

 file(INSTALL): Add undocumented options to control output verbosity
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=abebcd23 [^]

 install: Thread message level setting through internal API
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ec7cf7ea [^]

 install: Add CMAKE_INSTALL_MESSAGE variable
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9568de5 [^]

 install(DIRECTORY): Add MESSAGE_NEVER option to avoid output
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d19b64d6 [^]

Most of the changes are cleanup/refactoring and addition of internal interfaces. The last two commits add the publicly-visible options.

Summary of new features:

 set(CMAKE_INSTALL_MESSAGE LAZY) # no Up-to-date messages on installation
 install(...)

and:

 install(DIRECTORY bigdir ... MESSAGE_NEVER ...) # no message even when really installing
(0036542)
Brad King   
2014-08-04 09:37   
Re 0013761:0036244: These changes are now in master and will be available in the 3.1 release. One may also try them in the nightly binaries:

 http://www.cmake.org/files/dev/?C=M;O=D [^]
(0037606)
Robert Maynard   
2015-01-05 08:39   
Closing resolved issues that have not been updated in more than 4 months