mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-18 05:42:49 +00:00
port: use find_package(python) in cmake builds
This commit is contained in:
parent
09fffc1651
commit
02bddf72de
@ -46,7 +46,8 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
|||||||
# using Visual Studio C++
|
# using Visual Studio C++
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# to find generated .h from .gatt files
|
# to generate .h from .gatt files
|
||||||
|
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
||||||
@ -191,9 +192,9 @@ foreach(EXAMPLE_FILE ${EXAMPLES_C})
|
|||||||
message("example ${EXAMPLE} -- with GATT DB")
|
message("example ${EXAMPLE} -- with GATT DB")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt
|
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/../../tool/compile_gatt.py
|
COMMAND ${Python_EXECUTABLE}
|
||||||
ARGS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
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 SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
|
||||||
else()
|
else()
|
||||||
|
@ -36,7 +36,8 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
|||||||
# using Visual Studio C++
|
# using Visual Studio C++
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# to find generated .h from .gatt files
|
# to generate .h from .gatt files
|
||||||
|
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
||||||
@ -104,9 +105,9 @@ foreach(EXAMPLE ${EXAMPLES})
|
|||||||
message("example ${EXAMPLE} -- with GATT DB")
|
message("example ${EXAMPLE} -- with GATT DB")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt
|
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/../../tool/compile_gatt.py
|
COMMAND ${Python_EXECUTABLE}
|
||||||
ARGS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
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 SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
|
||||||
else()
|
else()
|
||||||
|
@ -17,7 +17,8 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
|||||||
# using Visual Studio C++
|
# using Visual Studio C++
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# to find generated .h from .gatt files
|
# to generate .h from .gatt files
|
||||||
|
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
||||||
@ -174,8 +175,8 @@ foreach(EXAMPLE ${EXAMPLES})
|
|||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||||
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
|
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
|
||||||
COMMAND ${BTSTACK_ROOT}/tool/compile_gatt.py
|
COMMAND ${Python_EXECUTABLE}
|
||||||
ARGS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
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 SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
|
||||||
else()
|
else()
|
||||||
|
@ -15,7 +15,8 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
|||||||
# using Visual Studio C++
|
# using Visual Studio C++
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# to find generated .h from .gatt files
|
# to generate .h from .gatt files
|
||||||
|
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
||||||
@ -81,9 +82,9 @@ foreach(EXAMPLE ${EXAMPLES})
|
|||||||
message("example ${EXAMPLE} -- with GATT DB")
|
message("example ${EXAMPLE} -- with GATT DB")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt
|
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/../../tool/compile_gatt.py
|
COMMAND ${Python_EXECUTABLE}
|
||||||
ARGS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
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 SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
|
||||||
else()
|
else()
|
||||||
|
@ -15,7 +15,8 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
|||||||
# using Visual Studio C++
|
# using Visual Studio C++
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# to find generated .h from .gatt files
|
# to generate .h from .gatt files
|
||||||
|
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
||||||
@ -81,9 +82,9 @@ foreach(EXAMPLE ${EXAMPLES})
|
|||||||
message("example ${EXAMPLE} -- with GATT DB")
|
message("example ${EXAMPLE} -- with GATT DB")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt
|
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/../../tool/compile_gatt.py
|
COMMAND ${Python_EXECUTABLE}
|
||||||
ARGS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
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 SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
|
||||||
else()
|
else()
|
||||||
|
@ -17,7 +17,8 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
|||||||
# using Visual Studio C++
|
# using Visual Studio C++
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# to find generated .h from .gatt files
|
# to generate .h from .gatt files
|
||||||
|
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
||||||
@ -175,7 +176,7 @@ foreach(EXAMPLE ${EXAMPLES})
|
|||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||||
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
|
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
|
||||||
COMMAND python3
|
COMMAND ${Python_EXECUTABLE}
|
||||||
ARGS ${BTSTACK_ROOT}/tool/compile_gatt.py ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
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 SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
|
||||||
|
@ -15,7 +15,8 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
|||||||
# using Visual Studio C++
|
# using Visual Studio C++
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# to find generated .h from .gatt files
|
# to generate .h from .gatt files
|
||||||
|
find_package (Python REQUIRED COMPONENTS Interpreter)
|
||||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
# local dir for btstack_config.h after build dir to avoid using .h from Makefile
|
||||||
@ -92,9 +93,9 @@ foreach(EXAMPLE ${EXAMPLES})
|
|||||||
message("example ${EXAMPLE} -- with GATT DB")
|
message("example ${EXAMPLE} -- with GATT DB")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt
|
DEPENDS ${BTSTACK_ROOT}/example/${EXAMPLE}.gatt
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/../../tool/compile_gatt.py
|
COMMAND ${Python_EXECUTABLE}
|
||||||
ARGS ${CMAKE_SOURCE_DIR}/../../example/${EXAMPLE}.gatt ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h
|
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 SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXAMPLE}.h)
|
||||||
else()
|
else()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user