[CMake] What do Visual Studio users do so they can run/debug their programs when using 3rd party .dlls?

J Decker d3ck0r at gmail.com
Mon May 26 12:52:45 EDT 2014


On Mon, May 26, 2014 at 8:04 AM, Klaim - Joël Lamotte <mjklaim at gmail.com>wrote:

> My way of dealing with this problem is similar to other people here:
>
>  1. I have a separate Python post-build script designed to be driven
> through command line.
>      This script read somewhere the list of direct binary dependencies of
> the target[1] and copy them in the
>      output directory. The script also check that the dependency file is
> not already in that place.
>  2. I have CMake scripts that provide project definition macros which does
> the actual work
>      of setting up the projects depending on the kind but it's all
> specific to my project/domain.
>  3. The CMake scripts will add a custom post-build command calling the
> Python post-build script with the correct arguments for the specific target.
>  4. Therefore, after build of any of MY projects of my Visual Studio
> solution, the post build script copy the
>       necessary dependencies in what I call the "install" directory which
> is settup in a way similar to a normal install
>       of the application. This happen after the target is generated into
> it's output directory; so first the project is compiled
>       with it's dependencies, then all these binaries are copied in the
> "install" directory.
>  5. After generating my VS solution using CMake, the first thing I do is
> to change the debug paths of the executables projects
>      so that debugging them will actually run the binaries in the
> "install" direction. This is because I want that directory to be
>      as close as the final directory, so I can catch issues with missing
> dlls immediately (and in practice it helped a lot catch any kind of
> dependencies and configuration issues)
>      It's also easier to generate a test build this way.
>
> Note that:
>
>  - I don't want to polluate the developer's PATH with anything from the
> dependencies, which is one reason why I have so many constraints
>    (that CMake only solve in half)
>  - I want to be able to debug most of my dependencies (for a lot of
> reasons) so I NEED to have their sources (except if I have no choice)
>    and I NEED to have their sources debuggable and visible from the
> debugger.
>  - Why can't I use the install command from CMake? My understanding is
> that it's used to install the application in the system, which is NOT what
> I want to do here.
>
>
Install can be targeted anywhere doesn't have to be 'into the the system'.
 With Install rules it becomes just one minor step more to add packaging to
get an installer for distribution.


> It's one of the reasons I have found CMake frustrating, there is not much
> helping with these kind of contexts.
>
> [1] I didn't find a way to provide the dependencies automatically because
> some dlls are simply not part of the project,
>      So I have a specific file with all the direct binary dependencies
> explicitely listed for each target.
>
> --
>
> 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://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140526/598cb847/attachment.html>


More information about the CMake mailing list