I've solved the problem that way in the past.

What you do is copy the .user file and make the environment setup
driven by configure_file() in CMake. That way at CMake configure time
you can create a .user file for each .VCPROJ that has PATH setup to
point to third party BIN directories as needed. These will work when
you debug.

However, this only benefits visual studio. If I use nmake on Windows
or want to use some other IDE on Windows, these methods won't work but
copying the DLL there will always work. It has added benefits:

1. You can run the executable from the output directory
2. You can zip up the output directory to send adhoc builds to other people.


On Sat, Nov 1, 2014 at 8:54 AM, Michael Jackson
<mike.jack...@bluequartz.net> wrote:
> The thing I could never figure out is how to set the PATH for the Visual 
> Studio Project/Solution. That is what I need. If I only had a single version 
> of Qt on my system it would be very straight forward. Just set the PATH 
> environment variable using the standard windows mechanism for doing that and 
> you are set. Alas, that isn't the case. I have at least 4 different versions 
> of Qt on my system at any one time. So tell me how to, in the CMake file, to 
> tell the Visual Studio generated solution to add 
> C:/Developer/x64/Qt-4.8.6/bin to my PATH and I would gladly rip out all my 
> code. I also need a mechanism to "install" all those DLL's into an 
> redistributable package (which my scripts ensure). Maybe I am just that far 
> behind the times. One of those "if it aint broke don't fix it".
>
> Looking forward to the answer
> Mike Jackson
>
> On Oct 31, 2014, at 3:51 PM, Bill Somerville <b...@classdesign.com> wrote:
>
>> 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.
>>
>> Regards
>> Bill.
>> --
>>
>> 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
>
> --
>
> 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
-- 

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

Reply via email to