mirror of
https://github.com/Kitware/CMake.git
synced 2026-07-02 12:47:48 +00:00
GenerateExportHeader: Fix FILE_SET example BASE_DIRS
In commit 12ec3270c4 (GenerateExportHeader: Extend documentation,
2025-05-06, v4.1.0-rc1~214^2) we added a `BASE_DIRS` example value using
a generator expression that cannot be correctly consumed after export.
Update the example to use `CMAKE_CURRENT_BINARY_DIR`, which is where
`generate_export_header` places the header anyway. Also drop the
explicit `target_include_directories`, as it is not needed when
using a file set for the header.
Closes: #27620
This commit is contained in:
@@ -258,12 +258,10 @@ library's other public headers:
|
||||
FILES example.h
|
||||
FILE_SET generated_headers
|
||||
TYPE HEADERS
|
||||
BASE_DIRS $<TARGET_PROPERTY:example,BINARY_DIR>
|
||||
BASE_DIRS ${CMAKE_CURRENT_BINARY_DIR}
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/example_export.h
|
||||
)
|
||||
|
||||
target_include_directories(example PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
install(
|
||||
TARGETS example
|
||||
FILE_SET HEADERS
|
||||
|
||||
Reference in New Issue
Block a user