forked from baidu/braft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[thirdparty] support import brpc lib from cmake
- Loading branch information
Showing
4 changed files
with
54 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
cmake_minimum_required(VERSION 2.8.2) | ||
|
||
project(brpc-download NONE) | ||
|
||
include(ExternalProject) | ||
ExternalProject_Add(brpc | ||
GIT_REPOSITORY https://github.com/apache/brpc.git | ||
GIT_TAG 1.8.0 | ||
SOURCE_DIR "${CMAKE_BINARY_DIR}/_deps/brpc/src" | ||
BINARY_DIR "${CMAKE_BINARY_DIR}/_deps/brpc/build" | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
TEST_COMMAND "" | ||
) | ||
|
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,26 @@ | ||
# Setup brpc | ||
configure_file("${PROJECT_SOURCE_DIR}/cmake/CMakeLists.download_brpc.in" ${PROJECT_BINARY_DIR}/_deps/brpc/CMakeLists.txt) | ||
|
||
|
||
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . | ||
RESULT_VARIABLE result | ||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/_deps/brpc) | ||
|
||
if(result) | ||
message(FATAL_ERROR "CMake step for brpc failed: ${result}") | ||
endif() | ||
|
||
execute_process(COMMAND ${CMAKE_COMMAND} --build . | ||
RESULT_VARIABLE result | ||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/_deps/brpc) | ||
|
||
if(result) | ||
message(FATAL_ERROR "Build step for brpc failed: ${result}") | ||
endif() | ||
|
||
add_subdirectory(${PROJECT_BINARY_DIR}/_deps/brpc/src | ||
${PROJECT_BINARY_DIR}/_deps/brpc/build | ||
EXCLUDE_FROM_ALL) | ||
|
||
set(BRPC_LIB brpc-static) | ||
set(BRPC_INCLUDE_PATH ${PROJECT_BINARY_DIR}/_deps/brpc/build/output/include) |