I have an application that is installed in /opt (this is the way it is done here). It is fine to have all the files and folders belonging to root apart from the logs directory that must be writable by anyone.
To create the logs directory I do
INSTALL(CODE "FILE(MAKE_DIRECTORY \${ENV}\${CMAKE_INSTALL_PREFIX}/logs)")
How can I then chmod the directory ?