mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Add the ability to generate CPS package information when install(EXPORT) is used. This relies on additional information to be passed to CMake, and is intended as a way of getting CPS out of existing projects without needing to make changes to the projects' CMakeLists.txt. (Particularly, this feature is intended for package distributors, not project authors.)
7 lines
225 B
CMake
7 lines
225 B
CMake
unset(CMAKE_EXPERIMENTAL_MAPPED_PACKAGE_INFO)
|
|
set(CMAKE_INSTALL_EXPORTS_AS_PACKAGE_INFO foo:)
|
|
|
|
add_library(foo INTERFACE)
|
|
install(TARGETS foo EXPORT foo DESTINATION .)
|
|
install(EXPORT foo FILE foo-targets.cmake DESTINATION .)
|