[CMake] using cmake to install dlls into windows/system32

David Cole david.cole at kitware.com
Fri Dec 18 11:07:04 EST 2009


On Fri, Dec 18, 2009 at 3:09 AM, Eric Noulard <eric.noulard at gmail.com>wrote:

> 2009/12/18 James Zipperer <james.zipperer at modsystems.com>:
> > After  a lot of trial and error and some rtfm work, I figured out a way
> to
> > do it.  The UpgradeDLL macro I mentioned below appears to be out of date
> and
> > the preferred method is now InstallLib.  It appears to handle DLL
> versioning
> > and usage counting.  Note: I could be wrong, I’ve been at this problem
> for
> > about a day now.
> >
> >
> >
> > Here’s the hack solution I came up with:
> >
> >
> >
> > 1. Modify NSIS.template.in to include Library.nsh:
>
> I would say that if you have a specific behavior which is not configurable
> with the CMake provided NSIS.template.in
> you'll better craft your own NSIS.template.in
> which may contain as much specificities as you need.
>
> I mean not only adding "include Library.nsh" but whatever
> other NSIS installer code you need.
>
> Then after that if the "install driver DLL" thing is of general
> interest may be you can report a bug and propose a generic
> modification of the mainstream NSIS.template.in  provided with cmake.
>


See my note attached to this bug for a way to use your own override of the
NSIS.template.in file. (So you can do it on a per-project basis rather than
modifying the main one in the CMake installation...)

http://public.kitware.com/Bug/view.php?id=9148

Note copy/pasted here to save you the hunting time:

Make your own copy of the NSIS.template.in file
Put it in a directory named "${CMAKE_CURRENT_SOURCE_DIR}/CMake"
Make edits to your own NSIS.template.in file as needed
Put this in your CMakeLists.txt file:
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake"
${CMAKE_MODULE_PATH})

Voila.

CPack will now use your NSIS.template.in file instead of the built-in one.


HTH,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091218/cd57ed72/attachment-0001.htm>


More information about the CMake mailing list