mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 23:30:35 -06:00
Add an `IMPORTED_LIBNAME[_<CONFIG>]` target property to specify a library name to be placed on the link line in place of an interface library since it has no library file of its own. Restrict use of the property to imported `INTERFACE` libraries. This will be particularly useful for find modules that need to provide imported libraries from system SDKs where the full path to the library file is not known. Now such find modules will be able to provide an imported interface library and set `IMPORTED_LIBNAME` to refer to the SDK library by name. Issue: #15267
7 lines
392 B
CMake
7 lines
392 B
CMake
add_library(MyTarget INTERFACE IMPORTED)
|
|
set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME -flag)
|
|
set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME item1 item2)
|
|
set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME /path/to/item1)
|
|
set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME \\path\\to\\item1)
|
|
set_property(TARGET MyTarget PROPERTY IMPORTED_LIBNAME c:\\path\\to\\item1)
|