[CMake] custom nsis template- "Install targets" not working

Lloyd lloydkl.tech at gmail.com
Thu Mar 27 05:07:07 EDT 2014


Solved the problem.

Further verification revealed that, when I build "PACKAGE", it generates a
"install_manifest.txt" file in my build directory. It contains absolute
paths to copy of install files I mentioned using "install targets" command.
This temporary directory and its files are also created when we build the
"PACKAGE" target.

What caused all these problem is, I misread the "INSTDIR" in SetOutPath
command and "INST_DIR" in File command as the *same*

  SetOutPath "$INSTDIR"

  File /r "${INST_DIR}\*.*"

tracing the INST_DIR value revealed that, it is defined in the template
as !define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@"


Thanks a lot,
  Lloyd




On Thu, Mar 27, 2014 at 2:05 PM, Lloyd <lloydkl.tech at gmail.com> wrote:

>
>
>> I am no NSIS expert so I can't imagine why 'File /r "${INST_DIR}\*.*"'
>> could possibly do ???
>>
>
>
> About the file command the NSIS documentation says this:
>     Adds file(s) to be extracted to the current output path ($OUTDIR).
>     If the /r switch is used, files and directories are added recursively.
>
> That is, the File command copies the files (all files as it is *.*)
> specified in the path ${INST_DIR}\*.* recursively to the current set output
> directory of the NSIS. The value of the INST_DIR variable is the directory
> which the user has selected at install time.
>
>
>
>
>>
>> So I guess that if your template does not contain such command you
>> either need it
>>
>
> I tried adding @CPACK_NSIS_FULL_INSTALL@, and it generated File /r
> "${INST_DIR}\*.*" but this causes NSIS an error. Now I am in the assumption
> that CMake copies all the files hierarchically to some temp directory and
> from that location it does the copy (this is only a wild guess).
>
>
>
>> (and should use CPACK_NSIS_FULL_INSTALL in your template) or replace
>> it with something more appropriate to you case.
>>
>>
>
> What I don't understand is, what happens to the "install targets" commands
> in the CMake file on windows platform
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140327/e14ddeeb/attachment.html>


More information about the CMake mailing list