Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
6375c8ca
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6375c8ca
编写于
11月 28, 2017
作者:
Y
Yu Yang
提交者:
GitHub
11月 28, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix MacOS compile (#5978)
* Fix MacOS compile * Update GRPC * Unset PROTOBUF_EXEC
上级
985e4ab6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
9 deletion
+27
-9
cmake/external/grpc.cmake
cmake/external/grpc.cmake
+10
-2
cmake/external/protobuf.cmake
cmake/external/protobuf.cmake
+17
-7
未找到文件。
cmake/external/grpc.cmake
浏览文件 @
6375c8ca
...
...
@@ -23,6 +23,11 @@ SET(GRPC_SOURCES_DIR ${THIRD_PARTY_PATH}/grpc)
SET
(
GRPC_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/grpc
)
SET
(
GRPC_INCLUDE_DIR
"
${
GRPC_INSTALL_DIR
}
/include/"
CACHE PATH
"grpc include directory."
FORCE
)
SET
(
GRPC_CPP_PLUGIN
"
${
GRPC_INSTALL_DIR
}
/bin/grpc_cpp_plugin"
CACHE FILEPATH
"GRPC_CPP_PLUGIN"
FORCE
)
IF
(
APPLE
)
SET
(
BUILD_CMD make -n | sed
"s/-Werror//g"
| sh
)
ELSE
()
SET
(
BUILD_CMD make
)
ENDIF
()
ExternalProject_Add
(
extern_grpc
...
...
@@ -33,7 +38,11 @@ ExternalProject_Add(
UPDATE_COMMAND
""
CONFIGURE_COMMAND
""
BUILD_IN_SOURCE 1
BUILD_COMMAND make
# NOTE(yuyang18):
# Disable -Werror, otherwise the compile will fail in MacOS.
# It seems that we cannot configure that by make command.
# Just dry run make command and remove `-Werror`, then use a shell to run make commands
BUILD_COMMAND
${
BUILD_CMD
}
INSTALL_COMMAND make prefix=
${
GRPC_INSTALL_DIR
}
install
)
...
...
@@ -55,4 +64,3 @@ SET_PROPERTY(TARGET grpc_unsecure PROPERTY IMPORTED_LOCATION
include_directories
(
${
GRPC_INCLUDE_DIR
}
)
ADD_DEPENDENCIES
(
grpc++_unsecure extern_grpc
)
cmake/external/protobuf.cmake
浏览文件 @
6375c8ca
...
...
@@ -15,7 +15,18 @@
INCLUDE
(
ExternalProject
)
# Always invoke `FIND_PACKAGE(Protobuf)` for importing function protobuf_generate_cpp
FIND_PACKAGE
(
Protobuf QUIET
)
SET
(
PROTOBUF_FOUND
"OFF"
)
macro
(
UNSET_VAR VAR_NAME
)
UNSET
(
${
VAR_NAME
}
CACHE
)
UNSET
(
${
VAR_NAME
}
)
endmacro
()
UNSET_VAR
(
PROTOBUF_INCLUDE_DIR
)
UNSET_VAR
(
PROTOBUF_FOUND
)
UNSET_VAR
(
PROTOBUF_PROTOC_EXECUTABLE
)
UNSET_VAR
(
PROTOBUF_PROTOC_LIBRARY
)
UNSET_VAR
(
PROTOBUF_LITE_LIBRARY
)
UNSET_VAR
(
PROTOBUF_LIBRARY
)
UNSET_VAR
(
PROTOBUF_INCLUDE_DIR
)
UNSET_VAR
(
Protobuf_PROTOC_EXECUTABLE
)
if
(
NOT COMMAND protobuf_generate_python
)
# before cmake 3.4, protobuf_genrerate_python is not defined.
function
(
protobuf_generate_python SRCS
)
...
...
@@ -110,7 +121,6 @@ macro(PROMPT_PROTOBUF_LIB)
# FIND_Protobuf.cmake uses `Protobuf_PROTOC_EXECUTABLE`.
# make `protobuf_generate_cpp` happy.
SET
(
Protobuf_PROTOC_EXECUTABLE
${
PROTOBUF_PROTOC_EXECUTABLE
}
)
FOREACH
(
dep
${
protobuf_DEPS
}
)
ADD_DEPENDENCIES
(
protobuf
${
dep
}
)
ADD_DEPENDENCIES
(
protobuf_lite
${
dep
}
)
...
...
@@ -128,11 +138,11 @@ endmacro()
set
(
PROTOBUF_ROOT
""
CACHE PATH
"Folder contains protobuf"
)
if
(
NOT
"
${
PROTOBUF_ROOT
}
"
STREQUAL
""
)
find_path
(
PROTOBUF_INCLUDE_DIR google/protobuf/message.h PATHS
${
PROTOBUF_ROOT
}
/include
)
find_library
(
PROTOBUF_LIBRARY protobuf PATHS
${
PROTOBUF_ROOT
}
/lib
)
find_library
(
PROTOBUF_LITE_LIBRARY protobuf-lite PATHS
${
PROTOBUF_ROOT
}
/lib
)
find_library
(
PROTOBUF_PROTOC_LIBRARY protoc PATHS
${
PROTOBUF_ROOT
}
/lib
)
find_program
(
PROTOBUF_PROTOC_EXECUTABLE protoc PATHS
${
PROTOBUF_ROOT
}
/bin
)
find_path
(
PROTOBUF_INCLUDE_DIR google/protobuf/message.h PATHS
${
PROTOBUF_ROOT
}
/include
NO_DEFAULT_PATH
)
find_library
(
PROTOBUF_LIBRARY protobuf PATHS
${
PROTOBUF_ROOT
}
/lib
NO_DEFAULT_PATH
)
find_library
(
PROTOBUF_LITE_LIBRARY protobuf-lite PATHS
${
PROTOBUF_ROOT
}
/lib
NO_DEFAULT_PATH
)
find_library
(
PROTOBUF_PROTOC_LIBRARY protoc PATHS
${
PROTOBUF_ROOT
}
/lib
NO_DEFAULT_PATH
)
find_program
(
PROTOBUF_PROTOC_EXECUTABLE protoc PATHS
${
PROTOBUF_ROOT
}
/bin
NO_DEFAULT_PATH
)
if
(
PROTOBUF_INCLUDE_DIR AND PROTOBUF_LIBRARY AND PROTOBUF_LITE_LIBRARY AND PROTOBUF_PROTOC_LIBRARY AND PROTOBUF_PROTOC_EXECUTABLE
)
message
(
STATUS
"Using custom protobuf library in
${
PROTOBUF_ROOT
}
."
)
SET_PROTOBUF_VERSION
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录