[CMake] Windows debugger command project settings

Ryan Pavlik rpavlik at iastate.edu
Fri Aug 20 16:48:30 EDT 2010


  You might consider using my CreateLaunchers cmake module that will set 
up the debugger for you to add whatever directories you like to the PATH 
(on windows) so that it can find the dynamic libraries.  I haven't tried 
it in the case that the libraries are built in the same project - you'd 
probably have to do a little work to figure out where they were going to 
land to be able to pass that path - but it works great for successfully 
finding third-party libraries.  (In a pinch, you could build the install 
target, then run the regular one, having put the install location of the 
libraries into your RUNTIME_LIBRARY_DIRS)

Example usage:

list(APPEND RUNTIME_LIBRARY_DIRS ${VRJUGGLER22_RUNTIME_LIBRARY_DIRS})
add_executable(roxbury ${SOURCES}
target_link_libraries(roxbury ${EXTRA_LIBS})
create_default_target_launcher(roxbury
     FORWARD_ARGS
     RUNTIME_LIBRARY_DIRS
     ${RUNTIME_LIBRARY_DIRS}
     ENVIRONMENT
     ${VRJUGGLER22_ENVIRONMENT})

The module can be found, among other places,  in one of my projects on 
Github: 
http://github.com/rpavlik/wiimote-head-tracker-gui/tree/master/cmake/

It also creates cmd/sh files for running out of the build tree, with the 
same setup.  Takes a lot of the pain out of using third-party dlls.

Hope this helps!

Ryan

On 8/20/10 2:10 PM, Knox, Kent wrote:
>
> My current codebase produces an executable with several dynamically 
> linked libraries.  I can't step through the code under the debugger 
> until I've built the 'install' project, which copies all the binaries 
> into the same output directory; they then can find each other.  Of 
> course, at this point I need to change the debugger command path to 
> point to the 'install' directory to find my executable in its new home.
>
> Is there a way to configure cmake and visual studio projects such that 
> they know to debug the applications built in the install directory?
>
> Kent
>
>
> _______________________________________________
> 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


-- 
Ryan Pavlik
Human-Computer Interaction Graduate Student
Virtual Reality Applications Center
Iowa State University

http://academic.cleardefinition.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100820/b3c36af8/attachment.htm>


More information about the CMake mailing list