From 4671e778452986e7c33ab431e77ade5f5da0b82a Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 19 Feb 2026 08:55:17 -0500 Subject: [PATCH] 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 --- Modules/GenerateExportHeader.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake index 5467651baf..618240ee7f 100644 --- a/Modules/GenerateExportHeader.cmake +++ b/Modules/GenerateExportHeader.cmake @@ -258,12 +258,10 @@ library's other public headers: FILES example.h FILE_SET generated_headers TYPE HEADERS - BASE_DIRS $ + 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