-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Protobuf load/export feature (#193)
- Loading branch information
Showing
22 changed files
with
26 additions
and
793 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,128 +40,3 @@ function(set_default_configuration_release) | |
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE ) | ||
endif() | ||
endfunction(set_default_configuration_release) | ||
|
||
#============================================================================= | ||
# Copyright 2009 Kitware, Inc. | ||
# Copyright 2009-2011 Philip Lowman <[email protected]> | ||
# Copyright 2008 Esben Mose Hansen, Ange Optimization ApS | ||
# | ||
# Distributed under the OSI-approved BSD License (the "License"); | ||
# see accompanying file Copyright.txt for details. | ||
# | ||
# This software is distributed WITHOUT ANY WARRANTY; without even the | ||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the License for more information. | ||
#============================================================================= | ||
# (To distribute this file outside of CMake, substitute the full | ||
# License text for the above reference.) | ||
function(PROTOBUF_GENERATE_CPP SRCS HDRS) | ||
if(NOT ARGN) | ||
message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files") | ||
return() | ||
endif() | ||
|
||
# Create an include path for each file specified | ||
foreach(FIL ${ARGN}) | ||
get_filename_component(ABS_FIL ${FIL} ABSOLUTE) | ||
get_filename_component(ABS_PATH ${ABS_FIL} PATH) | ||
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) | ||
if(${_contains_already} EQUAL -1) | ||
list(APPEND _protobuf_include_path -I ${ABS_PATH}) | ||
endif() | ||
endforeach() | ||
|
||
if(DEFINED Protobuf_IMPORT_DIRS) | ||
foreach(DIR ${Protobuf_IMPORT_DIRS}) | ||
get_filename_component(ABS_PATH ${DIR} ABSOLUTE) | ||
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) | ||
if(${_contains_already} EQUAL -1) | ||
list(APPEND _protobuf_include_path -I ${ABS_PATH}) | ||
endif() | ||
endforeach() | ||
endif() | ||
|
||
set(PROTOC_DEPENDENCY ${Protobuf_PROTOC_EXECUTABLE}) | ||
|
||
set(${SRCS}) | ||
set(${HDRS}) | ||
foreach(FIL ${ARGN}) | ||
get_filename_component(ABS_FIL ${FIL} ABSOLUTE) | ||
get_filename_component(FIL_WE ${FIL} NAME_WE) | ||
|
||
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc") | ||
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h") | ||
|
||
add_custom_command( | ||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc" | ||
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h" | ||
COMMAND ${Protobuf_PROTOC_EXECUTABLE} | ||
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL} | ||
DEPENDS ${ABS_FIL} ${PROTOC_DEPENDENCY} | ||
COMMENT "Running C++ protocol buffer compiler on ${FIL}" | ||
VERBATIM | ||
) | ||
endforeach() | ||
|
||
set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE) | ||
set(${SRCS} ${${SRCS}} PARENT_SCOPE) | ||
set(${HDRS} ${${HDRS}} PARENT_SCOPE) | ||
endfunction() | ||
|
||
function(PROTOBUF_GENERATE_JAVA TARGET_NAME PROTO_FILE) | ||
get_filename_component(ABS_FIL ${PROTO_FILE} ABSOLUTE) | ||
get_filename_component(ABS_PATH ${ABS_FIL} PATH) | ||
get_filename_component(FIL_WE ${PROTO_FILE} NAME_WE) | ||
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) | ||
if(${_contains_already} EQUAL -1) | ||
list(APPEND _protobuf_include_path -I ${ABS_PATH}) | ||
endif() | ||
|
||
if(DEFINED Protobuf_IMPORT_DIRS) | ||
foreach(DIR ${Protobuf_IMPORT_DIRS}) | ||
get_filename_component(ABS_PATH ${DIR} ABSOLUTE) | ||
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) | ||
if(${_contains_already} EQUAL -1) | ||
list(APPEND _protobuf_include_path -I ${ABS_PATH}) | ||
endif() | ||
endforeach() | ||
endif() | ||
|
||
set(PROTOC_DEPENDENCY ${Protobuf_PROTOC_EXECUTABLE}) | ||
|
||
add_custom_target(${TARGET_NAME} ALL | ||
${Protobuf_PROTOC_EXECUTABLE} --java_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL} | ||
DEPENDS ${ABS_FIL} ${PROTOC_DEPENDENCY} | ||
COMMENT "Running Java protocol buffer compiler on ${PROTO_FILE}" | ||
VERBATIM | ||
) | ||
endfunction() | ||
|
||
function(PROTOBUF_GENERATE_PYTHON TARGET_NAME PROTO_FILE) | ||
get_filename_component(ABS_FIL ${PROTO_FILE} ABSOLUTE) | ||
get_filename_component(ABS_PATH ${ABS_FIL} PATH) | ||
get_filename_component(FIL_WE ${PROTO_FILE} NAME_WE) | ||
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) | ||
if(${_contains_already} EQUAL -1) | ||
list(APPEND _protobuf_include_path -I ${ABS_PATH}) | ||
endif() | ||
|
||
if(DEFINED Protobuf_IMPORT_DIRS) | ||
foreach(DIR ${Protobuf_IMPORT_DIRS}) | ||
get_filename_component(ABS_PATH ${DIR} ABSOLUTE) | ||
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already) | ||
if(${_contains_already} EQUAL -1) | ||
list(APPEND _protobuf_include_path -I ${ABS_PATH}) | ||
endif() | ||
endforeach() | ||
endif() | ||
|
||
set(PROTOC_DEPENDENCY ${Protobuf_PROTOC_EXECUTABLE}) | ||
|
||
add_custom_target(${TARGET_NAME} ALL | ||
${Protobuf_PROTOC_EXECUTABLE} --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL} | ||
DEPENDS ${ABS_FIL} ${PROTOC_DEPENDENCY} | ||
COMMENT "Running Python protocol buffer compiler on ${PROTO_FILE}" | ||
VERBATIM | ||
) | ||
endfunction() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,3 @@ This page lists tutorials about Treelite. | |
deploy | ||
deploy_java | ||
builder | ||
protobuf |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.