mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Add (partial) file set export to CPS. For now, only headers ("includes")
are supported, as that is the only overlap with the specification.
(Source file sets are not supported by CPS at this time, and the hope is
that C++ modules will never be supported, as that information should
already be available via the `cpp_module_metadata` information.) CPS
also supports "embeds", but CMake doesn't (yet).
This also introduces our first official use of CPS extensions, used to
record the CMake file set name.
47 lines
742 B
CMake
47 lines
742 B
CMake
add_library(foo INTERFACE)
|
|
|
|
target_sources(foo
|
|
INTERFACE
|
|
FILE_SET no_genex
|
|
TYPE HEADERS
|
|
BASE_DIRS foo
|
|
FILES
|
|
foo/header1.h
|
|
foo/header2.h
|
|
|
|
INTERFACE
|
|
FILE_SET no_genex_dup
|
|
TYPE HEADERS
|
|
BASE_DIRS foo
|
|
FILES
|
|
foo/header1.h
|
|
foo/header2.h
|
|
|
|
INTERFACE
|
|
FILE_SET genex
|
|
TYPE HEADERS
|
|
|
|
INTERFACE
|
|
FILE_SET genex_dup
|
|
TYPE HEADERS
|
|
)
|
|
|
|
install(
|
|
TARGETS foo
|
|
EXPORT foo
|
|
DESTINATION .
|
|
|
|
FILE_SET no_genex
|
|
DESTINATION no_genex
|
|
|
|
FILE_SET no_genex_dup
|
|
DESTINATION no_genex
|
|
|
|
FILE_SET genex
|
|
DESTINATION $<$<CONFIG:FAKE_CONFIG>:FAKE_DEST>genex
|
|
|
|
FILE_SET genex_dup
|
|
DESTINATION $<$<CONFIG:FAKE_CONFIG>:FAKE_DEST>genex
|
|
)
|
|
install(PACKAGE_INFO foo DESTINATION cps EXPORT foo)
|