Skip to content

Detect if nrfjprog is a recognised command #66

@gudnimg

Description

@gudnimg

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions