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

Eric Noulard eric.noulard at gmail.com
Fri Apr 29 03:41:31 EDT 2011


2011/4/29 Alan Garny <alan.garny at dpag.ox.ac.uk>:
>> Would try to open the cmake_install.cmake file corresponding to the
> offending
>> install(file ...) You should find something like:
>>
>> FILE(INSTALL <yourfile> DESTINATION <thedest>
>>         FILE_PERMISSIONS <perms>)
>
> 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.

> I might have a go at it tomorrow, though I am no CMake/CPack expert (I just
> learned enough about them to do what I needed to do), so we shall see.

Fair enough, I do the same for many tools.
The basics you should know in this case is:
    CMake/CPack/CTest comes with the "CMake scripting language"

CMakeLists.txt are written using this language.
CMake when used for configuring your sources (while processing one or
several CMakeLists.txt)
generates some CMake scripts (cmake_install.cmake is an example) which
will be used during the build (or install).

One can write CMake scripts which are not CMakeLists.txt using the
CMake script language,
this may be useful if you want to write "portable scripts". You may do
such thing with other
scripting language (Perl, Python, Ruby...) however since CMake is
already mandatory for
building your software then using CMake scripts lessen the need for
other dependencies.

The CMake script language contains keywords named "CMake commands" which
can be used. The "FILE" command is one of them.

You can get usage instruction of each CMake command from the documentation:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html
or from the command line:
cmake --help-command <command-name>

That said some command like FILE, may have "undocumented" syntax which are used
"internally" by CMake, e.g. in generated cmake_install.cmake scripts.

Now you know a little more about that.
Do what you can we will try to help you.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list