-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[infra] Introduce FlatBuffers 23.5.26 cmake (#12617)
This commit introduces FlatBuffers 23.5.26 cmake package config. This commit includes FlatBuffers 2.0 cmake versioning to prepare migration. ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
- Loading branch information
Showing
11 changed files
with
98 additions
and
5 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
infra/cmake/packages/FlatBuffersSource-23.5.26/FlatBuffersSourceConfig.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
function(_FlatBuffersSource_import) | ||
if(NOT DOWNLOAD_FLATBUFFERS) | ||
set(FlatBuffersSource_FOUND FALSE PARENT_SCOPE) | ||
return() | ||
endif(NOT DOWNLOAD_FLATBUFFERS) | ||
|
||
nnas_include(ExternalSourceTools) | ||
nnas_include(OptionTools) | ||
|
||
envoption(EXTERNAL_DOWNLOAD_SERVER "https://github.com") | ||
envoption(FLATBUFFERS_23_5_26_URL ${EXTERNAL_DOWNLOAD_SERVER}/google/flatbuffers/archive/v23.5.26.tar.gz) | ||
ExternalSource_Download(FLATBUFFERS | ||
DIRNAME FLATBUFFERS-23.5.26 | ||
CHECKSUM MD5=2ef00eaaa86ab5e9ad5eafe09c2e7b60 | ||
URL ${FLATBUFFERS_23_5_26_URL} | ||
) | ||
|
||
set(FlatBuffersSource_DIR ${FLATBUFFERS_SOURCE_DIR} PARENT_SCOPE) | ||
set(FlatBuffersSource_FOUND TRUE PARENT_SCOPE) | ||
endfunction(_FlatBuffersSource_import) | ||
|
||
_FlatBuffersSource_import() |
10 changes: 10 additions & 0 deletions
10
infra/cmake/packages/FlatBuffersSource-23.5.26/FlatBuffersSourceConfigVersion.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set(PACKAGE_VERSION "23.5.26") | ||
set(PACKAGE_VERSION_EXACT FALSE) | ||
set(PACKAGE_VERSION_COMPATIBLE FALSE) | ||
set(PACKAGE_VERSION_UNSUITABLE TRUE) | ||
|
||
if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) | ||
set(PACKAGE_VERSION_EXACT TRUE) | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
set(PACKAGE_VERSION_UNSUITABLE FALSE) | ||
endif(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
infra/nnfw/cmake/packages/FlatBuffers-2.0/FlatBuffersConfigVersion.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set(PACKAGE_VERSION "2.0") | ||
set(PACKAGE_VERSION_EXACT FALSE) | ||
set(PACKAGE_VERSION_COMPATIBLE FALSE) | ||
set(PACKAGE_VERSION_UNSUITABLE TRUE) | ||
|
||
if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) | ||
set(PACKAGE_VERSION_EXACT TRUE) | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
set(PACKAGE_VERSION_UNSUITABLE FALSE) | ||
endif(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) |
41 changes: 41 additions & 0 deletions
41
infra/nnfw/cmake/packages/FlatBuffers-23.5.26/FlatBuffersConfig.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
function(_FlatBuffers_import) | ||
|
||
find_package(Flatbuffers QUIET) | ||
if(Flatbuffers_FOUND) | ||
set(FlatBuffers_FOUND TRUE PARENT_SCOPE) | ||
return() | ||
endif(Flatbuffers_FOUND) | ||
|
||
nnas_find_package(FlatBuffersSource EXACT 23.5.26 QUIET) | ||
|
||
if(NOT FlatBuffersSource_FOUND) | ||
set(FlatBuffers_FOUND FALSE PARENT_SCOPE) | ||
return() | ||
endif(NOT FlatBuffersSource_FOUND) | ||
|
||
# From FlatBuffers's CMakeLists.txt | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/annotated_binary_text_gen.cpp") | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/bfbs_gen_lua.cpp") | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/bfbs_gen_nim.cpp") | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/binary_annotator.cpp") | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/code_generators.cpp") | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/flatc.cpp") | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_fbs.cpp") | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/idl_gen_text.cpp") | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/idl_parser.cpp") | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/reflection.cpp") | ||
list(APPEND FlatBuffers_Library_SRCS "${FlatBuffersSource_DIR}/src/util.cpp") | ||
|
||
if(NOT TARGET flatbuffers::flatbuffers-23.5.26) | ||
add_library(flatbuffers-23.5.26 ${FlatBuffers_Library_SRCS}) | ||
target_include_directories(flatbuffers-23.5.26 PUBLIC "${FlatBuffersSource_DIR}/include") | ||
set_property(TARGET flatbuffers-23.5.26 PROPERTY POSITION_INDEPENDENT_CODE ON) | ||
target_compile_options(flatbuffers-23.5.26 PUBLIC $<$<CONFIG:Debug>:-Wno-sign-compare>) | ||
|
||
add_library(flatbuffers::flatbuffers-23.5.26 ALIAS flatbuffers-23.5.26) | ||
endif(NOT TARGET flatbuffers::flatbuffers-23.5.26) | ||
|
||
set(FlatBuffers_FOUND TRUE PARENT_SCOPE) | ||
endfunction(_FlatBuffers_import) | ||
|
||
_FlatBuffers_import() |
10 changes: 10 additions & 0 deletions
10
infra/nnfw/cmake/packages/FlatBuffers-23.5.26/FlatBuffersConfigVersion.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set(PACKAGE_VERSION "23.5.26") | ||
set(PACKAGE_VERSION_EXACT FALSE) | ||
set(PACKAGE_VERSION_COMPATIBLE FALSE) | ||
set(PACKAGE_VERSION_UNSUITABLE TRUE) | ||
|
||
if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) | ||
set(PACKAGE_VERSION_EXACT TRUE) | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
set(PACKAGE_VERSION_UNSUITABLE FALSE) | ||
endif(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters