Currently the code does not check whether or not nrfjprog is actually included in PATH. One way to check if to see if nrfjprog.exe is found using find_program()
There's also no gurantee that if a user defines a path for NRF5_NRFJPROG that it is a valid path.
if(NOT NRF5_NRFJPROG)
# Check if nrfjprog command is recognised
find_program(NRFJPROG "nrfjprog")
if(NRFJPROG)
set(NRF5_NRFJPROG "nrfjprog" CACHE FILEPATH "" FORCE)
message(STATUS "Using nrfjprog utility available from PATH: ${NRF5_NRFJPROG}")
else()
message(FATAL_ERROR "Could no find nrfjprog utlity from PATH")
endif()
else()
message(STATUS "Using nrfjprog utility: ${NRF5_NRFJPROG}")
endif()
Currently the code does not check whether or not
nrfjprogis actually included in PATH. One way to check if to see ifnrfjprog.exeis found usingfind_program()There's also no gurantee that if a user defines a path for
NRF5_NRFJPROGthat it is a valid path.