[CMake] Collecting libraries for NSIS installer

Richard Shaw hobbes1069 at gmail.com
Wed Aug 20 16:32:00 EDT 2014


Ok, that being the case I tried it out. There's two things I'm doing
differently than the only example[1] I found:

1. Using install(CODE...) instead of install(SCRIPT...), shouldn't work any
differently, right?
2. The example is from 2009 and uses:

GET_TARGET_PROPERTY(MY_BINARY_LOCATION my_binary LOCATION)

Which I get a policy warning about.

I tried using $<TARGET_FILE:freedv> inside of "get_but apparently I'm not
getting how that's supposed to be used.

Here's the whole code block:
if(WIN32)
install(CODE "
INCLUDE(GetPrerequisites)
GET_PREREQUISITES($<TARGET_FILE:freedv> DEPENDENCIES 1 1 \"\" \"\")
message(\"Checking for dependencies in $<TARGET_FILE:fredv>\")
message(\"Dependencies: ${DEPENDENCIES}\")
FOREACH(DEPENDENCY ${DEPENDENCIES})
   GET_FILENAME_COMPONENT(DEPENDENCY_NAME \"${DEPENDENCY}\" NAME)
   GET_FILENAME_COMPONENT(DEPENDENCY_ACTUAL \"${DEPENDENCY}\" REALPATH)
   message(\"DEPENDENCY_NAME: ${DEPENDENCY_NAME}\")
   message(\"DEPENDENCY_ACTUAL: ${DEPENDENCY_ACTUAL}\")
   FILE(INSTALL
 DESTINATION bin
 TYPE EXECUTABLE
 RENAME \"${DEPENDENCY_NAME}\"
 FILES \"${DEPENDENCY_ACTUAL}\"
 )
ENDFOREACH()
")
endif(WIN32)
--- end ---

Ideas?

Thanks,
Richard

[1] http://www.cmake.org/pipermail/cmake/2009-June/029975.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140820/e8c31034/attachment.html>


More information about the CMake mailing list