Skip to content

Commit eec5a9d

Browse files
committed
build(cmake): provide Heffte::Heffte alias via FetchContent
Create alias target when building HeFFTe from source so targets linking to Heffte::Heffte resolve in non-installed builds (e.g., clang-tidy job). - Compatible with upstream exported targets - Unblocks clang-tidy configure step
1 parent cd2c89a commit eec5a9d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmake/FindHeffte.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,11 @@ FetchContent_MakeAvailable(heffte)
6565

6666
# Set Heffte_FOUND to indicate success
6767
set(Heffte_FOUND TRUE)
68+
69+
# Provide alias target for consumers linking to Heffte::Heffte
70+
# when HeFFTe is brought in via FetchContent and not installed yet.
71+
if (NOT TARGET Heffte::Heffte)
72+
if (TARGET heffte)
73+
add_library(Heffte::Heffte ALIAS heffte)
74+
endif()
75+
endif()

0 commit comments

Comments
 (0)