mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
even more changes
Signed-off-by: Paulchen-Panther <Paulchen--Panter@gmx.net>
This commit is contained in:
42
dependencies/CMakeLists.txt
vendored
42
dependencies/CMakeLists.txt
vendored
@@ -9,6 +9,48 @@ if(ENABLE_WS281XPWM)
|
||||
external/rpi_ws281x/rpihw.c)
|
||||
endif()
|
||||
|
||||
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()
|
||||
|
||||
set(USE_SYSTEM_PROTO_LIBS ${DEFAULT_USE_SYSTEM_PROTO_LIBS} CACHE BOOL "use protobuf library from system")
|
||||
|
||||
if (USE_SYSTEM_PROTO_LIBS)
|
||||
|
Reference in New Issue
Block a user