[CMake] Copying DLLs to output directory
Bill Somerville
bill at classdesign.com
Sat Nov 1 10:07:56 EDT 2014
On 01/11/2014 14:02, Michael Jackson wrote:
Hi Michael,
> I agree that if the FindQt4 would enumerate the DLLs that would be great and simply get ride a bunch of this home-brew code that I have to write for each library. Getting the Plugins would also be a great help also since I have to grab a few of those. the FindQt5 module does this I think.
A standard Qt installation is hard coded to use the plugins in the
installation tree. If you have no qt.conf file override the default
behaviour works just fine for debugging and testing without moving the
plugins at all.
>
>
> Cheers
> Mike Jackson
Regards
Bill.
>
> On Nov 1, 2014, at 5:07 AM, Hendrik Sattler <post at hendrik-sattler.de> wrote:
>
>>
>> Am 31. Oktober 2014 20:51:55 MEZ, schrieb Bill Somerville <bill at classdesign.com>:
>>> On 31/10/2014 19:42, Michael Jackson wrote:
>>>> Never said it was pretty, but here is the code I use for Qt4 based
>>> projects. I think I had to revamp a lot of this for Qt5. I call it like
>>> so:
>>>> CMP_COPY_QT4_RUNTIME_LIBRARIES( "QtCore;QtGui;QtNetwork")
>>> This seems an awful lot of messing around when qt-project.org already
>>> dump all the debug and release libraries into the installation bin
>>> directory so all you need is to ensure that the installation bin
>>> directory is on your PATH when you run or debug executables, just like
>>> you have to to build using the tools like moc, qmake, dumpcpp, qrc,
>>> etc..
>>>
>>> IMHO put he Qt bin directory on PATH for debugging and use BundleUtils
>>> FixupBundle to make deployable kits. No need to do any manual or
>>> scripted copying of libraries at all.
>> But you have to be very careful when creating this PATH. Order is important or you will likely catch the wrong Qt release libraries. After all, even CMake ships Qt dlls in its installation directory. And other tools that are user during build might also do.
>>
>> Additionally, CMake is not able to set this up automatically in VS.
>>
>> Also, when the Qt dlls can be found so easily, why doesn't FindQt4 do it?
>>
>> HS
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
More information about the CMake
mailing list