[CMake] How to install a shared library on a windows system
Torri, Stephen CIV NSWCDD, W15
stephen.torri at navy.mil
Fri Jun 11 13:14:02 EDT 2010
> From: cmake-bounces at cmake.org on behalf of Ryan Pavlik
> Sent: Fri 6/11/2010 12:34 PM
> To: cmake at cmake.org
> 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
More information about the CMake
mailing list