cmake : shared library : how to get the .lib name instead of .dll name?

耗尽温柔 提交于 2021-01-28 09:20:32

问题


Under Windows, with cmake I generate a shared library and an executable.

The shared lib generate 2 files, a .DLL and a .LIB

I use add_custom_command with $<TARGET_FILE:mylibname>, this output the name of the .DLL file.

But, I need the name of the .LIB file.

How can I do ? Any idea ?


回答1:


Just found how, maybe it will be useful for someone else, so I share.

Simply use TARGET_LINKER_FILE instead of TARGET_FILE !



来源:https://stackoverflow.com/questions/48545720/cmake-shared-library-how-to-get-the-lib-name-instead-of-dll-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!