[CMake] dll artifacts - Runtime or Library Output

Kerstin Keller kerstin.s.keller at gmail.com
Thu Apr 4 07:24:52 EDT 2019


On Windows, a .dll is considered by CMake to be a "RUNTIME" Output artifact
if it was added with the `add_library(my_liib SHARED my_lib.cpp), however
if it was added with the MODULE keyword, it is considered to be a "LIBRARY"
output, as stated in the documentation
https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#runtime-output-artifacts

I just discovered this behavior and it seems quite unintuitive to me.
If I dynamically load a library with LoadLibrary without specying an
absolute path, Windows will still use the default search path logic for
Windows, which means first same directory as the executable loading the
module, e.g. the RUNTIME output directory.
(See also
https://docs.microsoft.com/en-us/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibrarya
)

Can you please elaborate on this?

Thanks, Kerstin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190404/268db477/attachment.html>


More information about the CMake mailing list