[CMake] Adding external DLLs to installer created with CPack

Tyler Roscoe tyler at cryptio.net
Sun Jul 12 22:42:34 EDT 2009


On Mon, Jul 13, 2009 at 12:03:32AM +0200, Robert Matusewicz wrote:
> everything works great except one thing. I can't fing good way to add
> external DLLs to the installer. in my case I need QtGui4.dll,
> QtOpenGL4.dll and libpng.dll. For now, I placed all those dlls into
> directory that I called DLL and add this install command to
> CMakeLists.txt
> 
> install (FILES "D:/DLL/QtGui4.dll"
>                      "D:/DLL/QtOpenGL4.dll"
>                      "D:/DLL/libpng.dll"
>                      DESTINATION bin)
> 
> But this is obvious that not all developers will want to create this
> folder and place in it all required DLLs. So, is there any way to
> check where those dlls are? I tried to look at CMakeCPack.cmake in
> CMake source but didn't found anything.

This isn't really an issue with CPack, so CMakeCPack.cmake isn't the
right place to dig around.

The FindQt4 module (which I assume you're using since you're building a
Qt app) should have a variable telling you where the libs are. Then you
can just refer to those as
${QT_LIB_DIR_OR_WHATEVER_IT'S_CALLED}/QtGui4.dll, etc. FindPNG should
have a similar facility.

tyler


More information about the CMake mailing list