MODULE library usage requirements
In this example:
$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(Issue20448 C)
add_library(plugin MODULE plugin.c)
target_link_libraries(plugin PUBLIC m)
install(TARGETS plugin EXPORT foo LIBRARY DESTINATION lib)
install(EXPORT foo DESTINATION lib/cmake/foo)
$ cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/root
$ make install
$ grep -A 4 add_library.*plugin root/lib/cmake/foo/foo.cmake
add_library(plugin MODULE IMPORTED)
set_target_properties(plugin PROPERTIES
INTERFACE_LINK_LIBRARIES "m"
)
we export "public" usage requirements of a MODULE library even though we do not allow linking to them.