MantisBT - CMake
View Issue Details
0013357CMakeCPackpublic2012-06-27 22:322012-11-05 14:33
David Sandberg 
David Cole 
normalminoralways
closedno change required 
WindowsWindows7
CMake 2.8.8 
 
0013357: CPACK macros in own copy of NSIS.template.in are still generated even though they are commented out
The parser of NSIS.template.in generates output for CPACK macros that are commented out (for example @CPACK_NSIS_CREATE_ICONS@). The parser only comments out the first row of the macro's output.

Here's an example:

CMakeLists.txt:
set(CPACK_COMPONENTS_ALL APP1 APP2)

NSIS.template.in (don't want it to install default icons because I need to use arguments in the shortcut collected during installation):
;@CPACK_NSIS_CREATE_ICONS@

This will generate the following output in project.nsi:
; CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\APP1.lnk" "$INSTDIR\bin\APP1.exe"
  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\APP2.lnk" "$INSTDIR\bin\APP2.exe"

CPACK, NSIS
Issue History
2012-06-27 22:32David SandbergNew Issue
2012-06-27 22:33David SandbergTag Attached: CPACK
2012-06-27 22:33David SandbergTag Attached: NSIS
2012-06-27 22:52David ColeNote Added: 0029854
2012-06-27 22:52David ColeAssigned To => David Cole
2012-06-27 22:52David ColeStatusnew => assigned
2012-06-27 22:53David ColeNote Added: 0029855
2012-06-27 22:53David ColeStatusassigned => resolved
2012-06-27 22:53David ColeResolutionopen => no change required
2012-11-05 14:33David ColeNote Added: 0031461
2012-11-05 14:33David ColeStatusresolved => closed

Notes
(0029854)
David Cole   
2012-06-27 22:52   
That's just the way it works...

When the file is "configured", the part of the file that says @CPACK_NSIS_CREATE_ICONS@ is replaced by whatever the value of CPACK_NSIS_CREATE_ICONS is at the time. If it contains newlines, then those are going to be in the result file.

If that's not what you want, then simply remove the @CPACK_NSIS_CREATE_ICONS@ from the .in file rather than commenting it out. Or, put a space in between the "@" and the CPACK_NSIS_CREATE_ICONS to prevent the CMake configuration step from replacing the value.

The NSIS comment has nothing to do with how the file gets configured.
(0029855)
David Cole   
2012-06-27 22:53   
Nothing to fix here. This behavior is as designed/expected.
(0031461)
David Cole   
2012-11-05 14:33   
Closing resolved issues that have not been updated in more than 4 months.