Skip to content
/ qtbase Public

Commit ce1bf03

Browse files
alcroitoQt Cherry-pick Bot
authored andcommitted
CMake: Fix SBOM configuration error with CMake 3.16
SBOM generation attempts to access the SOURCE_DIR property of interface libraries to derive a file source location. This causes a configure error when using CMake 3.16 which doesn't allow accessing properties not starting with INTERFACE_ on interface libraries. Interface libraries don't have a source dir anyway, so skip extracting the directory for interface libraries to avoid the error. Pick-to: 6.10 6.8 Change-Id: If70da1908dee9aba06da37aff5b0d12633a7623a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 72a47e1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
1 parent 5098aa9 commit ce1bf03

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmake/QtPublicSbomQtEntityHelpers.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,13 @@ function(_qt_internal_sbom_get_qt_entity_repo_source_dir target)
288288
message(FATAL_ERROR "OUT_VAR must be set")
289289
endif()
290290

291+
# Interface libs don't have a source dir. Return early, to avoid errors with CMake 3.16.
292+
get_target_property(target_type "${target}" TYPE)
293+
if(target_type STREQUAL "INTERFACE_LIBRARY")
294+
set(${arg_OUT_VAR} "" PARENT_SCOPE)
295+
return()
296+
endif()
297+
291298
get_target_property(repo_source_dir "${target}" SOURCE_DIR)
292299

293300
# Get the path relative to the PROJECT_SOURCE_DIR

0 commit comments

Comments
 (0)