From dce6d7b3e954ac46196136465f75a9848137c8e2 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 13 Jun 2022 17:09:48 +0200 Subject: [PATCH] port: add missing BTSTACK_ROOT --- port/libusb/CMakeLists.txt | 1 + port/posix-h4-zephyr/CMakeLists.txt | 2 ++ port/posix-h4/CMakeLists.txt | 3 ++- port/windows-h4-da14585/CMakeLists.txt | 8 +++++--- port/windows-h4-zephyr/CMakeLists.txt | 2 ++ port/windows-winusb/CMakeLists.txt | 2 ++ 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/port/libusb/CMakeLists.txt b/port/libusb/CMakeLists.txt index 4b87b4e23..eada67bcb 100644 --- a/port/libusb/CMakeLists.txt +++ b/port/libusb/CMakeLists.txt @@ -5,6 +5,7 @@ SET(CMAKE_EXPORT_COMPILE_COMMANDS ON) project(BTstack-libusb) +SET(BTSTACK_ROOT ${CMAKE_SOURCE_DIR}/../..) # pkgconfig find_package(PkgConfig REQUIRED) diff --git a/port/posix-h4-zephyr/CMakeLists.txt b/port/posix-h4-zephyr/CMakeLists.txt index ef506a95f..9edaf0df4 100644 --- a/port/posix-h4-zephyr/CMakeLists.txt +++ b/port/posix-h4-zephyr/CMakeLists.txt @@ -5,6 +5,8 @@ SET(CMAKE_EXPORT_COMPILE_COMMANDS ON) project(BTstack-posix-h4-zephyr) +SET(BTSTACK_ROOT ${CMAKE_SOURCE_DIR}/../..) + # pkgconfig find_package(PkgConfig REQUIRED) diff --git a/port/posix-h4/CMakeLists.txt b/port/posix-h4/CMakeLists.txt index 4b14ef920..dd6b8b715 100644 --- a/port/posix-h4/CMakeLists.txt +++ b/port/posix-h4/CMakeLists.txt @@ -172,7 +172,8 @@ foreach(EXAMPLE ${EXAMPLES}) # add GATT DB creation if ( "${EXAMPLES_GATT_FILES}" MATCHES ${EXAMPLE} ) message("example ${EXAMPLE} -- with GATT DB") - add_custom_command( + message("${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h <- ${Python_EXECUTABLE} ${BTSTACK_ROOT}/tool/compile_gatt.py ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h") + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt COMMAND ${Python_EXECUTABLE} diff --git a/port/windows-h4-da14585/CMakeLists.txt b/port/windows-h4-da14585/CMakeLists.txt index 650696db5..2a373ce31 100644 --- a/port/windows-h4-da14585/CMakeLists.txt +++ b/port/windows-h4-da14585/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required (VERSION 3.5) project(BTstack-windows-h4-da14585) +SET(BTSTACK_ROOT ${CMAKE_SOURCE_DIR}/../..) + # extra compiler warnings if ("${CMAKE_C_COMPILER_ID}" MATCHES ".*Clang.*") # using Clang @@ -82,9 +84,9 @@ foreach(EXAMPLE ${EXAMPLES}) message("example ${EXAMPLE} -- with GATT DB") add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h - DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt - COMMAND ${Python_EXECUTABLE} - ARGS ${BTSTACK_ROOT}/tool/compile_gatt.py ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h + DEPENDS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt + COMMAND ${CMAKE_SOURCE_DIR}/../../tool/compile_gatt.py + ARGS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h ) list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h) else() diff --git a/port/windows-h4-zephyr/CMakeLists.txt b/port/windows-h4-zephyr/CMakeLists.txt index d50276059..79e7f0fa2 100644 --- a/port/windows-h4-zephyr/CMakeLists.txt +++ b/port/windows-h4-zephyr/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required (VERSION 3.5) project(BTstack-windows-h4-zephyr) +SET(BTSTACK_ROOT ${CMAKE_SOURCE_DIR}/../..) + # extra compiler warnings if ("${CMAKE_C_COMPILER_ID}" MATCHES ".*Clang.*") # using Clang diff --git a/port/windows-winusb/CMakeLists.txt b/port/windows-winusb/CMakeLists.txt index 3d2514dbf..3c3e2896e 100644 --- a/port/windows-winusb/CMakeLists.txt +++ b/port/windows-winusb/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required (VERSION 3.5) project(BTstack-windows-winusb) +SET(BTSTACK_ROOT ${CMAKE_SOURCE_DIR}/../..) + # extra compiler warnings if ("${CMAKE_C_COMPILER_ID}" MATCHES ".*Clang.*") # using Clang