1 Star 0 Fork 0

ncnnnnn/Tengine-Convert-Tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 3.25 KB
一键复制 编辑 原始数据 按行查看 历史
alcohol 提交于 2020-08-04 21:37 . add MegEngine serializer option
cmake_minimum_required(VERSION 3.6)
# Disable inplace builds to prevent source tree corruption.
IF (" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
MESSAGE (FATAL_ERROR "FATAL: Building inplace are not allowed. You should create a separate directory for Building.")
ENDIF ()
# set cmake_install_prefix path
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory")
endif()
message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
# default budilding type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE release CACHE STRING "Choose the type of build" FORCE)
endif()
# project name
project(tengine-serializer C CXX)
set(CMAKE_CXX_STANDARD 14)
set(CXX_STANDARD_REQUIRED ON)
# building flags
#target_compile_definitions(operator,"--allow-shlib-undefined")
add_definitions(-Wl,-Bsymbolic)
add_definitions(-Wl,-Bsymbolic-functions)
add_definitions(-Wno-unused-command-line-argument)
add_definitions(-funroll-loops)
add_definitions(-Wno-deprecated-register)
add_definitions(-Wno-overloaded-virtual)
add_definitions(-fPIC)
#add_definitions(-g)
add_definitions(-O3)
# paser options
option(BUILD_CAFFE_SERIALIZER "Caffe serializer" ON)
option(BUILD_ONNX_SERIALIZER "ONNX serializer" ON)
option(BUILD_MXNET_SERIALIZER "MXNet serializer" ON)
option(BUILD_DARKNET_SERIALIZER "Darknet serializer" ON)
option(BUILD_TF_SERIALIZER "TensorFlow serializer" ON)
option(BUILD_TFLITE_SERIALIZER "TFLite serializer" ON)
option(BUILD_NCNN_SERIALIZER "NCNN serializer" ON)
option(BUILD_MEGENGINE_SERIALIZER "MegEngine serializer" OFF)
option(BUILD_TENGINE_SERIALIZER "Tengine serializer" ON)
# add all header file folder
include_directories(include)
include_directories(core/include)
include_directories(driver/include)
include_directories(driver/cpu)
include_directories(executor/include)
include_directories(executor/operator/include)
include_directories(operator/include)
include_directories(serializer/include)
include_directories(serializer/include/tengine/v1)
include_directories(serializer/include/tengine/v2)
# add
file(GLOB_RECURSE CORE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/core/lib/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/core/lib/logger/*.cpp")
file(GLOB_RECURSE CPU_DRIVER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/driver/cpu/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/driver/plugin/init.cpp")
file(GLOB_RECURSE COMMON_SRC "${CMAKE_CURRENT_SOURCE_DIR}/executor/engine/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/executor/lib/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/executor/plugin/*.cpp")
file(GLOB_RECURSE OPERATOR_SRC "${CMAKE_CURRENT_SOURCE_DIR}/operator/plugin/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/operator/operator/*.cpp")
file(GLOB_RECURSE SERIALIZER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/serializer/plugin/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/serializer/tengine/*.c" "${CMAKE_CURRENT_SOURCE_DIR}/serializer/tengine/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/serializer/tengine/v1/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/serializer/tengine/v2/*.cpp")
# add exec
add_library(${CMAKE_PROJECT_NAME} STATIC ${CORE_SRC} ${CPU_DRIVER_SRC} ${COMMON_SRC} ${OPERATOR_SRC} ${SERIALIZER_SRC})
# add sub folder
add_subdirectory(tools)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ncnnnnn/Tengine-Convert-Tools.git
git@gitee.com:ncnnnnn/Tengine-Convert-Tools.git
ncnnnnn
Tengine-Convert-Tools
Tengine-Convert-Tools
master

搜索帮助