[CMake] CPack + NSIS: Are empty components omitted?
Johannes Stallkamp
johannes.stallkamp at rub.de
Wed Feb 25 05:55:13 EST 2009
Hello,
I have another problem with CPack and NSIS package generator:
I currently create a CMake component for each sub-project/component of
my software.
The sub-project CMakeLists.txt use cpack_add_component(...) to define
display name, description and especially dependencies.
Now, appA might depend on static library libB. Since libB is static, I
do not need to install a shared library (DLL in my case) in order to be
able to run appA.
_However_, static libB might in turn be dependent on other shared
libraries (e.g. libC and libD) (which are defined in their own components).
So, in fact, I would have
INSTALL( TARGETS appA RUNTIME DESTINATION bin COMPONENT appA )
cpack_add_component( appA DEPENDS libB )
INSTALL( FILES DESTINATION bin COMPONENT libB )
(^^^dummy command to generate CMake component with name "libB" )
cpack_add_component( libB DEPENDS libC libD )
However, NSIS stumbles over the component name libB:
warning: unknown variable/constant "{libB}" detected, ignoring
(macro:Select_appA_depends:41)
SectionGetFlags: ${libB}->$0
IntOp: $0=$0|1
warning: unknown variable/constant "{libB}" detected, ignoring
(macro:Select_appA_depends:43)
SectionSetFlags: ${libB}->$0
Usage: IntOp $(user_var: result) val1 OP [val2]
OP=(+ - * / % | & ^ ~ ! || && << >>)
Error in macro Select_appA_depends on macroline 44
Error in macro MaybeSelectionChanged on macroline 14
Error in macro SectionList on macroline 3
The directory libB is created in the NSIS sub-directory, but of course
it's empty. It seems that CPack omits that component when generating the
NSIS input file as for component libB there are no entries like:
Var appA_selected
Var appA_was_installed
Section "-DrawStack" DrawStack
[...]
SectionEnd
Any help is appreciated
Johannes
More information about the CMake
mailing list