Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
2fe49c9b
Unverified
Commit
2fe49c9b
authored
Jan 21, 2020
by
Ge Jun
Committed by
GitHub
Jan 21, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1032 from zyearn/replace_include_with_find_package
replace_include_with_find_package
parents
6934a7d6
faea9470
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
CMakeLists.txt
CMakeLists.txt
+3
-3
CMakeLists.txt
example/echo_c++/CMakeLists.txt
+8
-10
No files found.
CMakeLists.txt
View file @
2fe49c9b
...
@@ -142,8 +142,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
...
@@ -142,8 +142,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif
()
endif
()
endif
()
endif
()
include
(
FindProtobuf
)
find_package
(
Protobuf REQUIRED
)
include
(
FindThreads
)
find_package
(
Threads REQUIRED
)
find_path
(
LEVELDB_INCLUDE_PATH NAMES leveldb/db.h
)
find_path
(
LEVELDB_INCLUDE_PATH NAMES leveldb/db.h
)
find_library
(
LEVELDB_LIB NAMES leveldb
)
find_library
(
LEVELDB_LIB NAMES leveldb
)
...
@@ -182,7 +182,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
...
@@ -182,7 +182,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
)
)
endif
()
endif
()
include
(
Find
OpenSSL
)
find_package
(
OpenSSL
)
include_directories
(
include_directories
(
${
GFLAGS_INCLUDE_PATH
}
${
GFLAGS_INCLUDE_PATH
}
...
...
example/echo_c++/CMakeLists.txt
View file @
2fe49c9b
...
@@ -102,15 +102,13 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
...
@@ -102,15 +102,13 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
endif
()
endif
()
include_directories
(
${
LEVELDB_INCLUDE_PATH
}
)
include_directories
(
${
LEVELDB_INCLUDE_PATH
}
)
find_library
(
SSL_LIB NAMES ssl
)
if
(
CMAKE_SYSTEM_NAME STREQUAL
"Darwin"
)
if
(
NOT SSL_LIB
)
set
(
OPENSSL_ROOT_DIR
message
(
FATAL_ERROR
"Fail to find ssl"
)
"/usr/local/opt/openssl"
# Homebrew installed OpenSSL
endif
()
)
find_library
(
CRYPTO_LIB NAMES crypto
)
if
(
NOT CRYPTO_LIB
)
message
(
FATAL_ERROR
"Fail to find crypto"
)
endif
()
endif
()
include_directories
(
${
OPENSSL_INCLUDE_DIR
}
)
find_package
(
OpenSSL
)
add_executable
(
echo_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
add_executable
(
echo_client client.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
add_executable
(
echo_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
add_executable
(
echo_server server.cpp
${
PROTO_SRC
}
${
PROTO_HEADER
}
)
...
@@ -120,8 +118,8 @@ set(DYNAMIC_LIB
...
@@ -120,8 +118,8 @@ set(DYNAMIC_LIB
${
GFLAGS_LIBRARY
}
${
GFLAGS_LIBRARY
}
${
PROTOBUF_LIBRARIES
}
${
PROTOBUF_LIBRARIES
}
${
LEVELDB_LIB
}
${
LEVELDB_LIB
}
${
SSL_LIB
}
${
OPENSSL_CRYPTO_LIBRARY
}
${
CRYPTO_LIB
}
${
OPENSSL_SSL_LIBRARY
}
${
THRIFT_LIB
}
${
THRIFT_LIB
}
${
THRIFTNB_LIB
}
${
THRIFTNB_LIB
}
dl
dl
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment