Quantcast

Adding external DLLs to installer created with CPack

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Adding external DLLs to installer created with CPack

Robert Matusewicz
I use CPack and NSIS to create graphic installer for Windows. And
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.

Cheers
Robert


--
My public key can be found at https://keyserver2.pgp.com
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Adding external DLLs to installer created with CPack

Tyler Roscoe
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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Adding external DLLs to installer created with CPack

Eric Noulard
2009/7/13 Tyler Roscoe <[hidden email]>:

> 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.

May be they don't want to install those at all?
If they want I think they should be place in the same folder
as the applications that are using them and not in a "special" folder
don't you think ?

>> So, is there any way to check where those dlls are?

When do you want to check?
   1) When building your software?
   2) When installing it in order to avoid duplicate install?

>> 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.

Agreed.


> 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.

This would solve the 1) case.
The 2) case may be out of the CMake/CPack scope, but more
to installer scope.

Let me add that including third party libraries in install is fine as long as
you do not try to overwrite already installed libraries of the same kind.

I would give you two small ideas:

   1) make the third party lib install optional in your NSIS installer
       may be using CPack component support for NSIS:
       http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack

   2) When they are installed
        better install your third party lib along with your own software
        this way you may avoid to overwrite already installed lib.

   3) Checking if the required libs are already there during install
        may be the ultimate solution, but this may be difficult to do.

--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Loading...