[CMake] Setting the installation order of a script

David Cole david.cole at kitware.com
Thu Jul 14 08:34:59 EDT 2011


The only way to guarantee that your install SCRIPT and CODE segments
run last is to put them in their own subdirectory, and add it last.

i.e. :
dir3/CMakeLists.txt:
INSTALL (SCRIPT setpermissions.cmake)

CMakeLists.txt:
ADD_SUBDIRECTORY(dir1)
ADD_SUBDIRECTORY(dir2)
# last, so it's install rules run after all other install rules
ADD_SUBDIRECTORY(dir3)


On Thu, Jul 14, 2011 at 4:51 AM, Mathias Tausig
<mathias.tausig at a-cert.at> wrote:
> Hy!
>
> My CMakeLists.txt in the top directory looks like this:
>
> ADD_SUBDIRECTORY(dir1)
> ADD_SUBDIRECTORY(dir2)
> INSTALL (SCRIPT setpermissions.cmake)
>
> setpermissions.cmake changes some file-owner permissions of the stuff
> that has been installed from dir1 and dir2. The problem is: if I execute
> "make install", setpermissions is run previous to the installation from
> the subdirectories.
> Is there some way to make the script from the last line wait, until
> everything else has been installed?
> I am using cmake-2.8.3 under linux.
>
> cheer
> Mathias
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list