Skip to content

How to set(SHIELD "<shield>") in app CMakeLists.txt only for a specific board? #67742

Answered by cdwilson
cdwilson asked this question in Q&A
Discussion options

You must be logged in to vote

This works correctly:

cmake_minimum_required(VERSION 3.20.0)

if((BOARD STREQUAL nrf9160dk_nrf9160) OR (BOARD STREQUAL nrf9160dk_nrf9160_ns))
  set(SHIELD "arduino_uno_click")
endif()

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

...

(At this point, I don't understand why the first thing I tried doesn't work. If anyone knows, I'd appreciate the explanation!)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cdwilson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant