diff --git a/tools/cmake/app.cmake b/tools/cmake/app.cmake index 7902112781..500e477a4c 100644 --- a/tools/cmake/app.cmake +++ b/tools/cmake/app.cmake @@ -34,27 +34,27 @@ include(CheckPythonPackage) # Check python packages from requirements.txt file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/requirements.txt PYTHON_REQUIREMENTS) foreach(REQUIREMENT ${PYTHON_REQUIREMENTS}) - # Look for a string from the start of each line that does not contain "<", ">", "=", or " ". - if(REQUIREMENT MATCHES "^([^<>= ]+)") - set(PACKAGE_NAME ${CMAKE_MATCH_1}) - string(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UCASE) # Ucase name needed for CMake variable - string(TOLOWER ${PACKAGE_NAME} PACKAGE_NAME_LCASE) # Lcase name needed for import statement + # Look for a string from the start of each line that does not contain "<", ">", "=", or " ". + if(REQUIREMENT MATCHES "^([^<>= ]+)") + set(PACKAGE_NAME ${CMAKE_MATCH_1}) + string(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UCASE) # Ucase name needed for CMake variable + string(TOLOWER ${PACKAGE_NAME} PACKAGE_NAME_LCASE) # Lcase name needed for import statement - check_python_package(${PACKAGE_NAME_LCASE} HAVE_PYTHON_${PACKAGE_NAME_UCASE}) - if(NOT HAVE_PYTHON_${PACKAGE_NAME_UCASE}) - message(WARNING "Missing Python dependency ${PACKAGE_NAME}") - endif() - else() - message(FATAL_ERROR "Cannot parse line \"${REQUIREMENT}\" in requirements.txt") - endif() + check_python_package(${PACKAGE_NAME_LCASE} HAVE_PYTHON_${PACKAGE_NAME_UCASE}) + if(NOT HAVE_PYTHON_${PACKAGE_NAME_UCASE}) + message(WARNING "Missing Python dependency ${PACKAGE_NAME}") + endif() + else() + message(FATAL_ERROR "Cannot parse line \"${REQUIREMENT}\" in requirements.txt") + endif() endforeach() # Check deps for memap if(Python3_FOUND AND HAVE_PYTHON_INTELHEX AND HAVE_PYTHON_PRETTYTABLE) - set(HAVE_MEMAP_DEPS TRUE) + set(HAVE_MEMAP_DEPS TRUE) else() - set(HAVE_MEMAP_DEPS FALSE) - message(STATUS "Missing Python dependencies (python3, intelhex, prettytable) so the memory map cannot be printed") + set(HAVE_MEMAP_DEPS FALSE) + message(STATUS "Missing Python dependencies (python3, intelhex, prettytable) so the memory map cannot be printed") endif()