MantisBT - CMake
View Issue Details
0014978CMakeCPackpublic2014-06-17 18:082016-06-10 14:21
Clinton Stimpson 
Domen Vrankar 
normalminoralways
closedfixed 
Linux
CMake 3.0 
CMake 3.4 
0014978: cpack excludes empty directories with archive generators (and others?)
Empty directories are not included in cpack generated archives/installers.
project(archive)

set(CMAKE_INSTALL_BINARY_DIR bin)
set(CPACK_PACKAGE_CONTACT me)
set(CPACK_PACKAGING_INSTALL_PREFIX /opt/me)

install(CODE
  "
  file(MAKE_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINARY_DIR}/userfiles)
  if(WIN32)
    execute_process(COMMAND icacls \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINARY_DIR}/userfiles /grant:r \"Users:(OI)(CI)(F)\")
  else()
    execute_process(COMMAND chmod ugo+rw \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINARY_DIR}/userfiles)
  endif()
  "
)

include(CPack)


=========


Run cmake, then cpack -G TGZ or ZIP. Open the archive, and you will see that the directory is not included.

It is included for RPM, Deb and NSIS.
No tags attached.
related to 0013009closed Raffi Enficiaud CPack DEB generator ignores top-level directories which do not contain a file 
Issue History
2014-06-17 18:08Clinton StimpsonNew Issue
2015-09-14 10:27Clinton StimpsonRelationship addedrelated to 0013009
2015-10-10 03:58Domen VrankarAssigned To => Domen Vrankar
2015-10-10 03:58Domen VrankarStatusnew => assigned
2016-02-09 23:03Clinton StimpsonStatusassigned => resolved
2016-02-09 23:03Clinton StimpsonFixed in Version => CMake 3.4
2016-02-09 23:03Clinton StimpsonResolutionopen => fixed
2016-06-10 14:21Kitware RobotNote Added: 0041260
2016-06-10 14:21Kitware RobotStatusresolved => closed

Notes
(0041260)
Kitware Robot   
2016-06-10 14:21   
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.