View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008767CMakeCPackpublic2009-03-19 11:282016-05-02 08:30
ReporterDerek Bruening 
Assigned ToDomen Vrankar 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in VersionCMake 3.4 
Summary0008767: CPack tar generators ignore empty directories
DescriptionI want to include an empty directory in my tarball, but the CPack tar generators (mainly I was using TGZ) refuse to add it: they just ignore it.

I tried adding it to CPACK_INSTALLED_DIRECTORIES.

I ended up having to put a dummy file inside the directory in order to get it included.
TagsNo tags attached.
Attached Filesgz file icon CPackWithEmptyDir-0.1.1-Source.tar.gz [^] (548 bytes) 2012-01-04 08:56

 Relationships
related to 0013009closedRaffi Enficiaud CPack DEB generator ignores top-level directories which do not contain a file 

  Notes
(0028156)
Eric NOULARD (developer)
2012-01-04 08:57

Same problem popped up again on the list:
http://www.cmake.org/pipermail/cmake/2012-January/048371.html [^]

This has been unanswered in the past too:
http://www.cmake.org/pipermail/cmake/2008-November/025435.html [^]

Just uploaded a project which exhibit the issue.
(0028157)
Eric NOULARD (developer)
2012-01-04 09:05

The problem seems to be with all Archive generators:
STGZ TBZ2 TGZ TZ ZIP


It's even worse with ZIP which core dump (CMake 2.8.7) with the attached example.
This last error seems to be gone with the newly imported libarchive
currently in next.
(0028187)
Fraser Hutchison (reporter)
2012-01-04 23:48

This appears to be easily fixed by removing "gl.RecurseOn();" from Source\CPack\cmCPackGenerator.cxx (currently line 1002) http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/CPack/cmCPackGenerator.cxx;h=083279fdda70420ae9f6021d5ddc033841499ba7;hb=refs/heads/next#l1002 [^])

The problem seems to boil down to the different behaviour between GLOB and GLOB_RECURSE where the former includes directories in the set of results and the latter doesn't.

I only tested this on Windows 7, but all Archive generators correctly add an empty directory to the install path using the command:

install(DIRECTORY DESTINATION GlobRecurseStrikesAgain)

There may be a very minor backwards compatibility issue if globbing recursion is switched off in cmCPackGenerator however. The command:

install(DIRECTORY "${LOCALDIRNAME}" DESTINATION include)

currently ignores empty subdirectories located within ${LOCALDIRNAME}, but would install them also if the above change is made.
(0028188)
Fraser Hutchison (reporter)
2012-01-05 00:10

OK - not as straightforward as I first thought!

Apparently the globbing recursion is necessary to correctly create the uninstaller (for non-Archive generators). With recursion off, the uninstaller leaves behind any non-empty folders.

I guess rather than removing "gl.RecurseOn();" it needs wrapped in an "if non-Archive" condition.
(0039559)
Domen Vrankar (developer)
2015-10-10 03:54

Fixed with commit:
https://cmake.org/gitweb?p=cmake.git;a=commit;h=9298f56 [^]
(0040969)
Robert Maynard (manager)
2016-05-02 08:30

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

 Issue History
Date Modified Username Field Change
2009-03-19 11:28 Derek Bruening New Issue
2009-03-22 22:01 Bill Hoffman Status new => assigned
2009-03-22 22:01 Bill Hoffman Assigned To => Bill Hoffman
2012-01-04 08:56 Eric NOULARD File Added: CPackWithEmptyDir-0.1.1-Source.tar.gz
2012-01-04 08:57 Eric NOULARD Note Added: 0028156
2012-01-04 09:05 Eric NOULARD Note Added: 0028157
2012-01-04 23:48 Fraser Hutchison Note Added: 0028187
2012-01-05 00:10 Fraser Hutchison Note Added: 0028188
2012-03-02 07:13 Eric NOULARD Relationship added related to 0013009
2015-10-10 03:54 Domen Vrankar Note Added: 0039559
2015-10-10 03:54 Domen Vrankar Status assigned => resolved
2015-10-10 03:54 Domen Vrankar Fixed in Version => CMake 3.4
2015-10-10 03:54 Domen Vrankar Resolution open => fixed
2015-10-10 03:54 Domen Vrankar Assigned To Bill Hoffman => Domen Vrankar
2016-05-02 08:30 Robert Maynard Note Added: 0040969
2016-05-02 08:30 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team