> From: [email protected] on behalf of Ryan Pavlik
> Sent: Fri 6/11/2010 12:34 PM
> To: [email protected]
> Subject: Re: [CMake] How to install a shared library on a windows system
> 
> 
> Stephen,
> 
> The catch is that windows searches for the DLL at runtime in specific
> locations: http://msdn.microsoft.com/en-us/library/7d83bc18%28VS.80%29.aspx

I see that it searches the directories listed in the PATH variable. How can you 
tell CPACK to just always install itself to the PATH variable instead of asking?
 
> This is why, when you do an install(TARGETS some-shared-lib    you need
> both the RUNTIME DESTINATION (for the dll) and the ARCHIVE DESTINATION
> (for the import library).  Generally, to avoid headaches, just put the
> DLL in the same directory as the .exe.  I tend to set things up like
> this, if I had an executable and a shared library (which is needed by
> the exe, but also might be compiled against so we should install the
> import lib and headers if requested):
> 
> install(TARGETS MyEXETarget
>      RUNTIME DESTINATION bin COMPONENT runtime)
> 
> install(TARGETS MySharedLibTarget
>      EXPORT mysoftware-sdk
>      RUNTIME DESTINATION bin COMPONENT runtime
>      ARCHIVE DESTINATION lib COMPONENT devel
>      PUBLIC_HEADER DESTINATION include COMPONENT devel)

Thanks for the examples. 
 
Stephen
_______________________________________________
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

Reply via email to