[CMake] Weird behaviour with CPackComponent and NSIS

Mathias Gaunard mathias.gaunard at ens-lyon.org
Tue Aug 9 18:11:28 EDT 2011


I've recently upgraded to CMake 2.8.5 to try out the new 
CPack/CPackComponent separation, which allows me to include 
CPackComponent to get the various cpack component macros, but only 
include CPack later.

I end up with very strange things happening, which I haven't been able 
to debug.

What I did, is that instead of including CPack at the beginning of my 
project, I included CPackComponent instead, and included CPack at the end.
I want to be able to do this so that I can use 
CPACK_NSIS_EXTRA_INSTALL_COMMANDS, among others.


For some unknown reason, some of my components end up flagged as 
downloadable, and when I run cpack it then fails because I don't have 
the NSIS plugin to support this.

If I unset the CPACK_COMPONENT_MYCOMPONENT_DOWNLOADABLE, then it doesn't 
happen, but the files from that component do not get installed.

This is especially strange because it only affects some components but 
not others.
I have a fairly complicated CMake project with a lot of add_subdirectory 
and recursive functions that include files, so I wonder if it doesn't 
get confused by the scoping somehow.

Are there any known problems with the new CPackComponent approach?


More information about the CMake mailing list