<div dir="ltr"><div><div><div><div><div><div>Hi Eric, <br><br></div>This can be solved using a launcher. <br><br></div>When adding tests, you could use the following syntax:<br><br></div>  add_test(<br>    NAME NameOfTest<br>

    COMMAND ${TheProject_LAUNCH_COMMAND} $<TARGET_FILE:NameOfTarget><br></div><div>    --arg1 ...<br></div><div>    )<br></div><div><br><br></div><div>where<br><br>   TheProject_LAUNCH_COMMAND  is a variable pointing to a launcher<br>

   <br></div><div><br></div>There are few options for the launcher, you could:<br><br>  (1) configure a .bat or .sh script as it is done in TubeTK. See [1]<br><br></div>or <br><br></div>  (2) use a dedicated "launcher" program as done in Slicer. For example the CTKAppLauncher. See [2][3] and [4]<br>

<br>        More details: <a href="http://www.commontk.org/index.php/Tools:_Application_launcher">http://www.commontk.org/index.php/Tools:_Application_launcher</a><br><div><div><br><br></div><div>Hth<br></div><div>Jc<br>
</div>
<div><br>[1] <a href="https://github.com/TubeTK/TubeTK/blob/2157c3318aab85ae929a6ee6dce9d3ea2f8eeae7/CMakeLists.txt#L595">https://github.com/TubeTK/TubeTK/blob/2157c3318aab85ae929a6ee6dce9d3ea2f8eeae7/CMakeLists.txt#L595</a><br>

[2] <a href="https://github.com/Slicer/Slicer/blob/3c4dc4490488e545c354472521f634a786f121c6/Applications/SlicerApp/CMakeLists.txt#L264">https://github.com/Slicer/Slicer/blob/3c4dc4490488e545c354472521f634a786f121c6/Applications/SlicerApp/CMakeLists.txt#L264</a><br>

[3]  <a href="https://github.com/Slicer/Slicer/blob/3c4dc4490488e545c354472521f634a786f121c6/CMakeLists.txt#L717">https://github.com/Slicer/Slicer/blob/3c4dc4490488e545c354472521f634a786f121c6/CMakeLists.txt#L717</a><br>
[4] <a href="https://github.com/Slicer/Slicer/blob/3c4dc4490488e545c354472521f634a786f121c6/Applications/SlicerApp/Testing/Cpp/CMakeLists.txt#L68">https://github.com/Slicer/Slicer/blob/3c4dc4490488e545c354472521f634a786f121c6/Applications/SlicerApp/Testing/Cpp/CMakeLists.txt#L68</a><br>

<div><div><br></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 23, 2014 at 10:48 PM, Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Eric,<br>
   For my project I ran into the same problems (<a href="http://www.github.com/dream3d/DREAM3D" target="_blank">http://www.github.com/dream3d/DREAM3D</a>) and I chose to solve the issues by having CMake setup custom build rules to copy the DLLs into the appropriate Debug or Release directory for what I am building. I do this because simply adding the directories to the global PATH is a "bad" idea if you have multiple versions of a particular 3rd party framework, i.e., 32 bit and 64 bit Qt or different versions of Qt. In the same "Copy Code" I also setup install rules for those libraries, again, based on the type of build being performed.<br>


<br>
 For packaging CMake has functions available to copy the required MS runtime libraries into the final package scheme for you. I use the following CMake file to setup my packaging. <a href="https://github.com/dream3d/DREAM3D/blob/m_develop/Resources/CPack/PackageProject.cmake" target="_blank">https://github.com/dream3d/DREAM3D/blob/m_develop/Resources/CPack/PackageProject.cmake</a><br>


<br>
For my project all this seems to be working quite well as we don't have any issues with our releases. YMMV.<br>
<br>
Cheers<br>
--<br>
Mike Jackson<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On May 23, 2014, at 7:23 PM, Eric Wing <<a href="mailto:ewmailing@gmail.com">ewmailing@gmail.com</a>> wrote:<br>
<br>
> My project has lots of 3rd party .dlls. I can build my project just<br>
> fine with CMake/Visual Studio. But when I try to debug/run within<br>
> Visual Studio, it fails because my 3rd party .dlls are not in the same<br>
> directory as where VS generated the .exe.<br>
><br>
> I know I can manually copy all my .dlls and put them in the generated<br>
> directory, but I was hoping there was a more automatic way to do this,<br>
> especially since the directory changes when you switch from<br>
> debug/release/etc.<br>
><br>
><br>
> On a similar note, what do you do for packaging/installing? In<br>
> addition to including the 3rd party dlls, what do you do to include<br>
> Microsoft required dll's like msvcr*.dll and msvcp*.dll?<br>
><br>
> Thanks,<br>
> Eric<br>
> --<br>
> Beginning iPhone Games Development<br>
> <a href="http://playcontrol.net/iphonegamebook/" target="_blank">http://playcontrol.net/iphonegamebook/</a><br>
> --<br>
><br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
><br>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
><br>
> CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>+1 919 869 8849<br>
</div>