Skip to content

Commit ca8093f

Browse files
committed
Add condition
1 parent d9bbc7f commit ca8093f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,13 @@ install(FILES
279279

280280
# Install target
281281
set(SPARROW_IPC_EXPORTED_TARGETS sparrow-ipc)
282-
get_target_property(is_imported flatbuffers IMPORTED)
283-
if(NOT is_imported)
284-
# This means `flatbuffers` was fetched using FetchContent
285-
# We need to export `flatbuffers` target explicitly
286-
list(APPEND SPARROW_IPC_EXPORTED_TARGETS flatbuffers)
282+
if (TARGET flatbuffers)
283+
get_target_property(is_imported flatbuffers IMPORTED)
284+
if(NOT is_imported)
285+
# This means `flatbuffers` was fetched using FetchContent
286+
# We need to export `flatbuffers` target explicitly
287+
list(APPEND SPARROW_IPC_EXPORTED_TARGETS flatbuffers)
288+
endif()
287289
endif()
288290

289291
install(TARGETS ${SPARROW_IPC_EXPORTED_TARGETS}

0 commit comments

Comments
 (0)