Dear Devzone,
I can no longer build Nordic's Wifi provisioning (BLE) sample together with custom nanopb code using SDK version 2.7.0. It worked fine in 2.6.1.
Steps to reproduce:
1) Create a new application based on Wifi provisioning (BLE) sample
2) Add the following to your CMakeLists.txt between project() and target_sources:
list(APPEND CMAKE_MODULE_PATH ${ZEPHYR_BASE}/modules/nanopb)
include(nanopb)
zephyr_nanopb_sources(app src/simple.proto)
3) Add `simple.proto` and `simple.options` to your `src` folder (files taken from Zephyr's nanopb sample)
4) The following error appears while building:
CMake Error at C:/ncs/v2.7.0/modules/lib/nanopb/extra/FindNanopb.cmake:406 (add_library):
add_library cannot create target "nanopb" because another target with the
same name already exists. The existing target is a static library created
in source directory
"C:/ncs/v2.7.0/nrf/subsys/bluetooth/services/wifi_prov". See documentation
for policy CMP0002 for more details.
Call Stack (most recent call first):
C:/ncs/v2.7.0/zephyr/modules/nanopb/nanopb.cmake:10 (find_package)
CMakeLists.txt:13 (include)
Could you please tell me how to fix this?
Thanks!