# Install IMPORTED library and its lib file with IMPORTED\_RUNTIME\_ARTIFACTS

**URL:** <https://discourse.cmake.org/t/install-imported-library-and-its-lib-file-with-imported-runtime-artifacts/14050>\
**Category:** Code\
**Tags:** os:windows\
**Created:** [May 6, 2025, 10:12am UTC](https://discourse.cmake.org/t/install-imported-library-and-its-lib-file-with-imported-runtime-artifacts/14050 "2025-05-06T10:12:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xnum](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/x/22d042/32.png) [@Xnum](https://discourse.cmake.org/u/Xnum)\
**Post date:** [May 6, 2025, 10:12am UTC](https://discourse.cmake.org/t/install-imported-library-and-its-lib-file-with-imported-runtime-artifacts/14050/1 "2025-05-06T10:12:55Z")

</div>

Hello everyone!

I’ve got a cmake project where I build my static library, let’s call it “mylib”. This library depends on external .dll and the linking shouldn’t be done in cmake - it is done via LoadLibrary function in code itself, let’s call this .dll “extlib”.

So I need to put this .dll and its .lib file to the specific folder on install step.  
I know, that it can be done via

install(FILES  
$\<TARGET\_FILE:extlib\>  
$\<TARGET\_IMPORT\_FILE:extlib\>  
TYPE BIN  
)

But I was wondering, if it can be done vie install(IMPORTED\_RUNTIME\_ARTIFACTS). I was trying to do that, but as far as I can see, this command installs only .dll itself and not an .lib file with imports.

Is there any way to make it work or maybe here exists a good alternative way?
