Skip to content

Commit

Permalink
cmake: make any pip install error to be fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Jul 24, 2023
1 parent 8f6587b commit 3381d85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmake/python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function(search_python_module)
OUTPUT_VARIABLE MODULE_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
)
endif()
if(${_RESULT} STREQUAL "0")
message(STATUS "Found python module: \"${MODULE_NAME}\" (found version \"${MODULE_VERSION}\")")
Expand All @@ -90,7 +90,8 @@ function(search_python_module)
execute_process(
COMMAND ${Python3_EXECUTABLE} -m pip install --user ${MODULE_PACKAGE}
OUTPUT_STRIP_TRAILING_WHITESPACE
)
COMMAND_ERROR_IS_FATAL ANY
)
else()
message(FATAL_ERROR "Can't find python module: \"${MODULE_NAME}\", please install it using your system package manager.")
endif()
Expand Down

0 comments on commit 3381d85

Please sign in to comment.