mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 04:40:56 -06:00
Refactoring in commit8c65b7042e(cmExportFileGenerator: Simplify collection of targets missing from export set, 2022-04-11, v3.24.0-rc1~281^2) accidentally dropped the behavior change from commit0ad2a1c181(Export: Never treat private link libraries as public package dependencies., 2013-09-24, v3.0.0-rc1~559^2). Restore the behavior and add a test. Fixes: #23838
14 lines
539 B
CMake
14 lines
539 B
CMake
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)
|