You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
539 B

enable_language(C)
add_library(foo SHARED foo.c)
install(TARGETS foo EXPORT foo)
install(EXPORT foo DESTINATION lib/cmake/foo)
install(FILES foo-config.cmake.in RENAME foo-config.cmake DESTINATION lib/cmake/foo)
add_library(bar SHARED bar.c)
target_link_libraries(bar PRIVATE foo)
# 'foo' only appears in IMPORTED_LINK_DEPENDENT_LIBRARIES, and so is not enforced on import.
install(TARGETS bar EXPORT bar)
install(EXPORT bar DESTINATION lib/cmake/bar)
install(FILES bar-config.cmake.in RENAME bar-config.cmake DESTINATION lib/cmake/bar)