Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect if nrfjprog is a recognised command #66

Open
gudnimg opened this issue Feb 2, 2021 · 0 comments
Open

Detect if nrfjprog is a recognised command #66

gudnimg opened this issue Feb 2, 2021 · 0 comments

Comments

@gudnimg
Copy link

gudnimg commented Feb 2, 2021

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant