diff --git a/src/rp2_common/pico_btstack/CMakeLists.txt b/src/rp2_common/pico_btstack/CMakeLists.txt index 6ead74ddc..9cf6f28ef 100644 --- a/src/rp2_common/pico_btstack/CMakeLists.txt +++ b/src/rp2_common/pico_btstack/CMakeLists.txt @@ -232,21 +232,22 @@ if (EXISTS ${PICO_BTSTACK_PATH}/${BTSTACK_TEST_PATH}) # Make a GATT header file from a BTstack GATT file # Pass the target library name library type and path to the GATT input file + # To add additional directories to the gatt #import path, add them to the end of the argument list. function(pico_btstack_make_gatt_header TARGET_LIB TARGET_TYPE GATT_FILE) find_package (Python3 REQUIRED COMPONENTS Interpreter) get_filename_component(GATT_NAME "${GATT_FILE}" NAME_WE) get_filename_component(GATT_PATH "${GATT_FILE}" PATH) - set(GATT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") - set(GATT_HEADER "${GATT_BINARY_DIR}/${GATT_NAME}.h") set(TARGET_GATT "${TARGET_LIB}_gatt_header") - + set(GATT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated/${TARGET_GATT}") + set(GATT_HEADER "${GATT_BINARY_DIR}/${GATT_NAME}.h") + list(TRANSFORM ARGN PREPEND "-I") add_custom_target(${TARGET_GATT} DEPENDS ${GATT_HEADER}) add_custom_command( OUTPUT ${GATT_HEADER} DEPENDS ${GATT_FILE} WORKING_DIRECTORY ${GATT_PATH} COMMAND ${CMAKE_COMMAND} -E make_directory ${GATT_BINARY_DIR} && - ${Python3_EXECUTABLE} ${PICO_SDK_PATH}/lib/btstack/tool/compile_gatt.py ${GATT_FILE} ${GATT_HEADER} + ${Python3_EXECUTABLE} ${PICO_SDK_PATH}/lib/btstack/tool/compile_gatt.py ${GATT_FILE} ${GATT_HEADER} ${ARGN} VERBATIM) add_dependencies(${TARGET_LIB} ${TARGET_GATT}