2016-06-03 16:46:45 +02:00
|
|
|
add_subdirectory(build/hidapi)
|
|
|
|
add_subdirectory(build/tinkerforge)
|
|
|
|
|
|
|
|
if(ENABLE_WS281XPWM)
|
|
|
|
add_library(ws281x
|
|
|
|
external/rpi_ws281x/mailbox.c external/rpi_ws281x/ws2811.c
|
|
|
|
external/rpi_ws281x/pwm.c external/rpi_ws281x/dma.c
|
2017-05-23 18:14:27 +02:00
|
|
|
external/rpi_ws281x/pcm.c
|
2016-06-03 16:46:45 +02:00
|
|
|
external/rpi_ws281x/rpihw.c)
|
2016-06-13 08:11:57 +02:00
|
|
|
endif()
|
2016-06-03 16:46:45 +02:00
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
set(USE_SYSTEM_FLATBUFFERS_LIBS ${DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS} CACHE BOOL "use flatbuffers library from system")
|
|
|
|
|
|
|
|
if (USE_SYSTEM_FLATBUFFERS_LIBS)
|
|
|
|
find_package(flatbuffers REQUIRED)
|
|
|
|
include_directories(${FLATBUFFERS_INCLUDE_DIRS})
|
|
|
|
else ()
|
|
|
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared flatbuffers library")
|
|
|
|
set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "Build Flatbuffers with tests")
|
|
|
|
add_subdirectory(external/flatbuffers)
|
|
|
|
|
|
|
|
if(CMAKE_CROSSCOMPILING)
|
|
|
|
# when crosscompiling import the flatc executable targets from a file generated by a native build
|
|
|
|
option(IMPORT_FLATC "flatc export file (flatc_export.cmake) from a native build" "IMPORT_FLATC-FILE_NOT_FOUND")
|
|
|
|
include(${IMPORT_FLATC})
|
|
|
|
else()
|
|
|
|
# export the flatc compiler so it can be used when cross compiling
|
|
|
|
export(TARGETS flatc FILE "${CMAKE_BINARY_DIR}/flatc_export.cmake")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# define the include for the flatbuffers library at the parent scope
|
|
|
|
set(FLATBUFFERS_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/external/flatbuffers/include")
|
|
|
|
set(FLATBUFFERS_INCLUDE_DIRS ${FLATBUFFERS_INCLUDE_DIRS} PARENT_SCOPE)
|
|
|
|
|
|
|
|
# define the flatc executable at the parent scope
|
|
|
|
get_property(FLATBUFFERS_FLATC_EXECUTABLE TARGET flatc PROPERTY LOCATION)
|
|
|
|
set(FLATBUFFERS_FLATC_EXECUTABLE ${FLATBUFFERS_FLATC_EXECUTABLE} PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS "Using flatbuffers compiler: " ${FLATBUFFERS_FLATC_EXECUTABLE})
|
|
|
|
|
|
|
|
|
|
|
|
function(compile_flattbuffer_schema SRC_FBS OUTPUT_DIR)
|
|
|
|
string(REGEX REPLACE "\\.fbs$" "_generated.h" GEN_HEADER ${SRC_FBS})
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${GEN_HEADER}
|
|
|
|
COMMAND "${FLATBUFFERS_FLATC_EXECUTABLE}" -c --no-includes --gen-mutable
|
|
|
|
--gen-object-api
|
|
|
|
-o "${OUTPUT_DIR}"
|
|
|
|
"${SRC_FBS}"
|
|
|
|
DEPENDS flatc)
|
|
|
|
endfunction()
|