fprime/cmake/required.cmake
M Starch 74dd80e2b7
Add FPRIME_CMAKE_QUIET option (#4276)
* Add FPRIME_CMAKE_QUIET option

* Remove makefile deadcode

* Attempt CI debug

Add debugging message for FPRIME_SUB_BUILD_JOBS variable.

* Fix argument passing for sub-build jobs

* Update cmake/sub-build/sub-build.cmake

* Update cmake/sub-build/sub-build.cmake

---------

Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
2025-10-08 16:30:36 -07:00

37 lines
1.7 KiB
CMake

####
# required.cmake:
#
# Required tools for the fprime CMake system. This system pre-checks all the tools needed to generate and build through
# cmake. These items are strictly required and will fail if not found, which will prevent confusing errors further
# within the build process.
####
include_guard()
include(autocoder/fpp)
include(utilities)
find_program(PYTHON NAMES python3 python)
find_program(FPUTIL NAMES fprime-util)
locate_fpp_tools()
set(FPRIME__INTERNAL_FRAGMENT "pip install -r \"${FPRIME_FRAMEWORK_PATH}/requirements.txt\"")
set(FPRIME__INTERNAL_TO_INSTALL_MESSAGE "Install with:\n '${FPRIME__INTERNAL_FRAGMENT}'")
set(FPRIME__INTERNAL_TO_REINSTALL "Reinstall with:\n '${FPRIME__INTERNAL_FRAGMENT} -U --force-reinstall'")
# Check python was found
if (NOT FPUTIL)
message(FATAL_ERROR " fprime-util was not found. ${FPRIME__INTERNAL_TO_INSTALL_MESSAGE}")
elseif (NOT PYTHON)
message(FATAL_ERROR " python3 was not found. Please see: https://www.python.org/downloads/")
elseif (DEFINED FPP_ERROR_MESSAGE)
message(FATAL_ERROR " ${FPP_ERROR_MESSAGE}")
elseif (DEFINED FPP_REINSTALL_ERROR_MESSAGE)
message(FATAL_ERROR " ${FPP_REINSTALL_ERROR_MESSAGE}. ${FPRIME__INTERNAL_TO_REINSTALL}")
elseif(NOT FPP_FOUND)
message(FATAL_ERROR " fpp tools not found. ${FPRIME__INTERNAL_TO_INSTALL_MESSAGE}")
endif()
fprime_cmake_status("[python3] python3 found at: ${PYTHON}")
fprime_cmake_status("[fpp-tools] fpp-depend found at: ${FPP_DEPEND}")
fprime_cmake_status("[fpp-tools] fpp-to-cpp found at: ${FPP_TO_CPP}")
fprime_cmake_status("[fpp-tools] fpp-to-dict found at: ${FPP_TO_DICT}")
fprime_cmake_status("[fpp-tools] fpp-locate-defs found at: ${FPP_LOCATE_DEFS}")