[CMake] CMake/CPack 2.8.4 - Windows - Can't package files as read-only?

Alan Garny alan.garny at dpag.ox.ac.uk
Fri Apr 29 05:04:44 EDT 2011


> > This is not quite what I have. Instead, I have something like:
> >
> > FILE(INSTALL DESTINATION <myDestination> TYPE FILE PERMISSIONS
> > OWNER_READ GROUP_READ WORLD_READ FILES <myFile>)
> 
> fine, I was too lazy to check the syntax thoroughly
> 
> Just create a tryPermission.cmake file with something similar you get in
your
> generated cmake_install.cmake
> 
> and then from a command line run:
> 
> cmake -P tryPermission.cmake
> 
> and check the permission of the installed file.

Ok, I have just given it a try and... it's working fine. From there, I
thought I would check the contents of the _CPack_Packages folder which is
created when running my CMakeLists.txt file. That folder contains a win32
folder which itself contains both a ZIP and NSIS folder. Both of these
folders eventually contain my read-only files with... the right permissions
(i.e. read-only). However, these files, when unzipped/installed from the
ZIP/NSIS files, don't have the right permissions (i.e. read-write rather
than read-only), as previously mentioned. So, I get the feeling that the
problem is with the ZIP/NSIS generation. In fact, I have had a quick look at
the project.nsi file which got generated and I couldn't see anything that
sets the permissions for my read-only files (something which should have
been added, I believe -- at least, I had to do it for another project where
I had to create a .nsi file 'by hand').

Alan



More information about the CMake mailing list