View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013761CMakeCMakepublic2012-11-30 05:122015-01-05 08:39
ReporterStefan Eilemann 
Assigned ToBrad King 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformAllOSOS Version
Product VersionCMake 3.0 
Target VersionCMake 3.1Fixed in VersionCMake 3.1 
Summary0013761: Add QUIET option to install() command
DescriptionInstalling 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.
TagsNo tags attached.
Attached Filespatch file icon 0001-Implement-install-.-QUIET-.-13761.patch [^] (15,174 bytes) 2014-04-02 15:49 [Show Content]
patch file icon 0001-Implement-install-.-QUIET-.-13761.v2.patch [^] (16,937 bytes) 2014-04-02 15:59 [Show Content]
patch file icon 0001-Implement-install-.-QUIET-.-13761.v3.patch [^] (16,937 bytes) 2014-04-07 04:38 [Show Content]
diff file icon cmFileCommand.diff [^] (2,039 bytes) 2014-06-16 10:32 [Show Content]
diff file icon cmFileCommand-global_property.diff [^] (3,311 bytes) 2014-06-17 11:31 [Show Content]
diff file icon file_install_option_quite.diff [^] (19,703 bytes) 2014-06-19 14:00 [Show Content]
diff file icon file_install_option_quiet2.diff [^] (21,179 bytes) 2014-06-19 16:16 [Show Content]

 Relationships
has duplicate 0013785closedDavid Cole INSTALL command does not support a QUIET/SILENT option 
has duplicate 0014757closed Reduce output of install step 

  Notes
(0033735)
Daniel Nachbaur (reporter)
2013-08-19 11:40

+1
(0035627)
Stefan Eilemann (reporter)
2014-04-02 15:49
edited on: 2014-04-02 15:49

See attached patch for implementation.

(0035628)
Stefan Eilemann (reporter)
2014-04-02 15:59

v2 with updated documentation
(0035644)
Stefan Eilemann (reporter)
2014-04-07 04:39

v3 rebased against current master (4023bd7b115fb9df6836dacea55e8cb3b1218c9c)
(0035660)
Emmanuel Blot (reporter)
2014-04-09 09:33

Patch v3 works like a charm. Thanks a lot!
(0035796)
Emmanuel Blot (reporter)
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 (reporter)
2014-05-15 08:05

Nor 3.0-rc5

Maybe someone to add to the CC: list?
(0036203)
d3x0r (reporter)
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 (reporter)
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 (manager)
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 (manager)
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 (reporter)
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 (manager)
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 (reporter)
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 (manager)
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 (reporter)
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 (manager)
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 (reporter)
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 (manager)
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 (manager)
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 (manager)
2015-01-05 08:39

Closing resolved issues that have not been updated in more than 4 months

 Issue History
Date Modified Username Field Change
2012-11-30 05:12 Stefan Eilemann New Issue
2012-12-12 07:50 David Cole Relationship added has duplicate 0013785
2013-08-19 11:40 Daniel Nachbaur Note Added: 0033735
2014-04-02 15:49 Stefan Eilemann File Added: 0001-Implement-install-.-QUIET-.-13761.patch
2014-04-02 15:49 Stefan Eilemann Note Added: 0035627
2014-04-02 15:49 Stefan Eilemann Note Edited: 0035627
2014-04-02 15:59 Stefan Eilemann File Added: 0001-Implement-install-.-QUIET-.-13761.v2.patch
2014-04-02 15:59 Stefan Eilemann Note Added: 0035628
2014-04-07 04:38 Stefan Eilemann File Added: 0001-Implement-install-.-QUIET-.-13761.v3.patch
2014-04-07 04:39 Stefan Eilemann Note Added: 0035644
2014-04-09 09:33 Emmanuel Blot Note Added: 0035660
2014-04-27 16:58 Emmanuel Blot Note Added: 0035796
2014-05-15 08:05 Emmanuel Blot Note Added: 0035883
2014-06-16 10:32 d3x0r File Added: cmFileCommand.diff
2014-06-16 10:34 d3x0r Note Added: 0036203
2014-06-16 10:38 d3x0r Note Edited: 0036203
2014-06-16 13:21 d3x0r Note Added: 0036205
2014-06-16 15:07 Brad King Relationship added has duplicate 0014757
2014-06-16 15:09 Brad King Product Version CMake 2.8.10.2 => CMake 3.0
2014-06-16 15:09 Brad King Target Version => CMake 3.1
2014-06-16 15:10 Brad King Note Added: 0036207
2014-06-16 15:17 Brad King Note Added: 0036208
2014-06-17 11:31 d3x0r File Added: cmFileCommand-global_property.diff
2014-06-17 11:34 d3x0r Note Added: 0036214
2014-06-19 11:27 Brad King Note Added: 0036224
2014-06-19 12:14 d3x0r Note Added: 0036226
2014-06-19 12:18 d3x0r Note Edited: 0036226
2014-06-19 12:35 Brad King Note Added: 0036227
2014-06-19 14:00 d3x0r File Added: file_install_option_quite.diff
2014-06-19 14:03 d3x0r Note Added: 0036228
2014-06-19 14:52 Brad King Note Added: 0036229
2014-06-19 16:16 d3x0r File Added: file_install_option_quiet2.diff
2014-06-19 16:19 d3x0r Note Added: 0036231
2014-06-19 16:25 d3x0r Note Edited: 0036231
2014-06-19 16:28 d3x0r Note Edited: 0036231
2014-06-24 14:00 Brad King Note Added: 0036244
2014-06-24 14:01 Brad King Assigned To => Brad King
2014-06-24 14:01 Brad King Status new => assigned
2014-08-04 09:37 Brad King Note Added: 0036542
2014-08-04 09:37 Brad King Status assigned => resolved
2014-08-04 09:37 Brad King Resolution open => fixed
2014-08-04 09:37 Brad King Fixed in Version => CMake 3.1
2015-01-05 08:39 Robert Maynard Note Added: 0037606
2015-01-05 08:39 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team