Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
# SPDX-FileNotice: Part of the AddonManager.

# The Addon Manager requires the defusedxml package at runtime to safely parse addon metadata. Unlike
# the optional Python packages that individual addons depend on, defusedxml is a hard dependency of the
# Addon Manager itself, so verify that it is importable at configure time rather than deferring the
# failure to the user's first launch.
IF (Python3_EXECUTABLE)
execute_process(
COMMAND "${Python3_EXECUTABLE}" "-c" "import defusedxml"
RESULT_VARIABLE ADDONMANAGER_DEFUSEDXML_MISSING
OUTPUT_QUIET
ERROR_QUIET
)
IF (ADDONMANAGER_DEFUSEDXML_MISSING)
MESSAGE(FATAL_ERROR
"The Addon Manager requires the Python package 'defusedxml', which was not found for "
"${Python3_EXECUTABLE}. Install it (for example, 'pip install defusedxml') and reconfigure.")
ELSE ()
MESSAGE(STATUS "Found required Addon Manager dependency: defusedxml")
ENDIF ()
ELSE ()
MESSAGE(WARNING
"Python3_EXECUTABLE is not set, so the Addon Manager cannot verify that its required "
"'defusedxml' dependency is installed.")
ENDIF ()

IF (BUILD_GUI)
add_subdirectory(Widgets)
ENDIF (BUILD_GUI)
Expand Down
Loading