1
0
mirror of https://github.com/bluekitchen/btstack.git synced 2025-03-26 02:37:41 +00:00

port: fix .gatt -> .h conversion in cmake builds

This commit is contained in:
Matthias Ringwald 2022-06-13 18:13:10 +02:00
parent dce6d7b3e9
commit 1e0ee29b56
7 changed files with 27 additions and 30 deletions
port
libusb
posix-h4-zephyr
posix-h4
windows-h4-da14585
windows-h4-zephyr
windows-h4
windows-winusb

@ -181,11 +181,13 @@ set (LWIP_EXAMPLES pan_lwip_http_server)
# create targets
foreach(EXAMPLE_FILE ${EXAMPLES_C})
get_filename_component(EXAMPLE ${EXAMPLE_FILE} NAME_WE)
set (SOURCE_FILES ${EXAMPLE_FILE})
# get c file
set (SOURCES_EXAMPLE ${BTSTACK_ROOT}/example/${EXAMPLE}.c)
# add lwip sources for lwip examples
if ( "${LWIP_EXAMPLES}" MATCHES ${EXAMPLE} )
list(APPEND SOURCE_FILES ${SOURCES_LWIP})
list(APPEND SOURCES_EXAMPLE ${SOURCES_LWIP})
endif()
# add GATT DB creation
@ -197,10 +199,10 @@ foreach(EXAMPLE_FILE ${EXAMPLES_C})
COMMAND ${Python_EXECUTABLE}
ARGS ${BTSTACK_ROOT}/tool/compile_gatt.py ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
)
list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
list(APPEND SOURCES_EXAMPLE ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
else()
message("example ${EXAMPLE}")
endif()
add_executable(${EXAMPLE} ${SOURCE_FILES} )
add_executable(${EXAMPLE} ${SOURCES_EXAMPLE} )
target_link_libraries(${EXAMPLE} btstack)
endforeach(EXAMPLE_FILE)

@ -97,15 +97,14 @@ include(../../example/CMakeLists.txt)
set (EXAMPLES ${EXAMPLES_LE_ONLY} ${EXAMPLES_GENERAL})
# create targets
set (EXAMPLES_C)
foreach(EXAMPLE ${EXAMPLES})
# get c file
file(GLOB EXAMPLE_FILE "../../example/${EXAMPLE}.c")
set (SOURCES_EXAMPLE ${BTSTACK_ROOT}/example/${EXAMPLE}.c)
# add GATT DB creation
if ( "${EXAMPLES_GATT_FILES}" MATCHES ${EXAMPLE} )
message("example ${EXAMPLE} -- with GATT DB")
add_custom_command(
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
COMMAND ${Python_EXECUTABLE}
@ -115,6 +114,6 @@ foreach(EXAMPLE ${EXAMPLES})
else()
message("example ${EXAMPLE}")
endif()
add_executable(${EXAMPLE} ${EXAMPLE_FILE} )
add_executable(${EXAMPLE} ${SOURCES_EXAMPLE})
target_link_libraries(${EXAMPLE} btstack)
endforeach(EXAMPLE)

@ -166,13 +166,11 @@ list(REMOVE_ITEM EXAMPLES "mesh_node_demo")
# create targets
foreach(EXAMPLE ${EXAMPLES})
# get c file
file(GLOB EXAMPLE_FILE "${BTSTACK_ROOT}/example/${EXAMPLE}.c")
set (SOURCE_FILES ${EXAMPLE_FILE})
set (SOURCES_EXAMPLE ${BTSTACK_ROOT}/example/${EXAMPLE}.c)
# add GATT DB creation
if ( "${EXAMPLES_GATT_FILES}" MATCHES ${EXAMPLE} )
message("example ${EXAMPLE} -- with GATT DB")
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
@ -183,6 +181,6 @@ foreach(EXAMPLE ${EXAMPLES})
else()
message("example ${EXAMPLE}")
endif()
add_executable(${EXAMPLE} ${SOURCE_FILES} )
add_executable(${EXAMPLE} ${SOURCES_EXAMPLE})
target_link_libraries(${EXAMPLE} btstack)
endforeach(EXAMPLE)

@ -77,21 +77,21 @@ list(REMOVE_ITEM EXAMPLES "mesh_node_demo")
# create targets
foreach(EXAMPLE ${EXAMPLES})
# get c file
file(GLOB EXAMPLE_FILE "../../example/${EXAMPLE}.c")
set (SOURCES_EXAMPLE ${BTSTACK_ROOT}/example/${EXAMPLE}.c)
# add GATT DB creation
if ( "${EXAMPLES_GATT_FILES}" MATCHES ${EXAMPLE} )
message("example ${EXAMPLE} -- with GATT DB")
add_custom_command(
add_custom_command(
OUTPUT ${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
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
)
list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
else()
message("example ${EXAMPLE}")
endif()
add_executable(${EXAMPLE} ${EXAMPLE_FILE} )
add_executable(${EXAMPLE} ${SOURCES_EXAMPLE})
target_link_libraries(${EXAMPLE} btstack)
endforeach(EXAMPLE)

@ -77,12 +77,12 @@ list(REMOVE_ITEM EXAMPLES "mesh_node_demo")
# create targets
foreach(EXAMPLE ${EXAMPLES})
# get c file
file(GLOB EXAMPLE_FILE "../../example/${EXAMPLE}.c")
set (SOURCES_EXAMPLE ${BTSTACK_ROOT}/example/${EXAMPLE}.c)
# add GATT DB creation
if ( "${EXAMPLES_GATT_FILES}" MATCHES ${EXAMPLE} )
message("example ${EXAMPLE} -- with GATT DB")
add_custom_command(
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
COMMAND ${Python_EXECUTABLE}
@ -92,6 +92,6 @@ foreach(EXAMPLE ${EXAMPLES})
else()
message("example ${EXAMPLE}")
endif()
add_executable(${EXAMPLE} ${EXAMPLE_FILE} )
add_executable(${EXAMPLE} ${SOURCES_EXAMPLE})
target_link_libraries(${EXAMPLE} btstack)
endforeach(EXAMPLE)

@ -167,13 +167,12 @@ list(REMOVE_ITEM EXAMPLES "mesh_node_demo")
# create targets
foreach(EXAMPLE ${EXAMPLES})
# get c file
file(GLOB EXAMPLE_FILE "${BTSTACK_ROOT}/example/${EXAMPLE}.c")
set (SOURCE_FILES ${EXAMPLE_FILE})
set (SOURCES_EXAMPLE ${BTSTACK_ROOT}/example/${EXAMPLE}.c)
# add GATT DB creation
if ( "${EXAMPLES_GATT_FILES}" MATCHES ${EXAMPLE} )
message("example ${EXAMPLE} -- with GATT DB")
add_custom_command(
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
COMMAND ${Python_EXECUTABLE}
@ -183,6 +182,6 @@ foreach(EXAMPLE ${EXAMPLES})
else()
message("example ${EXAMPLE}")
endif()
add_executable(${EXAMPLE} ${SOURCE_FILES} )
add_executable(${EXAMPLE} ${SOURCES_EXAMPLE})
target_link_libraries(${EXAMPLE} btstack)
endforeach(EXAMPLE)

@ -85,15 +85,14 @@ list(REMOVE_DUPLICATES EXAMPLES)
list(REMOVE_ITEM EXAMPLES "mesh_node_demo")
# create targets
set (EXAMPLES_C)
foreach(EXAMPLE ${EXAMPLES})
# get c file
file(GLOB EXAMPLE_FILE "../../example/${EXAMPLE}.c")
set (SOURCES_EXAMPLE ${BTSTACK_ROOT}/example/${EXAMPLE}.c)
# add GATT DB creation
if ( "${EXAMPLES_GATT_FILES}" MATCHES ${EXAMPLE} )
message("example ${EXAMPLE} -- with GATT DB")
add_custom_command(
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
COMMAND ${Python_EXECUTABLE}
@ -103,6 +102,6 @@ foreach(EXAMPLE ${EXAMPLES})
else()
message("example ${EXAMPLE}")
endif()
add_executable(${EXAMPLE} ${EXAMPLE_FILE} )
target_link_libraries(${EXAMPLE} btstack setupapi winusb)
add_executable(${EXAMPLE} ${SOURCES_EXAMPLE})
target_link_libraries(${EXAMPLE} btstack)
endforeach(EXAMPLE)