Skip to content

Commit 5ed5927

Browse files
committed
HBASE-18901 [C++] Provide CMAKE infrastructure
* Provided cmake files for packages in which a default module did not exist. * Moved tests to a location where we could automatically build the test suite. * Resolved minor issues with tests * Tested across OSX, RHEL7, and Ubuntu16 HBASE-18901 [C++] Cleanup CMAKE JJELSER: A hack to get the protobuf-gen headers installed too. Admittedly, not sure if there is a better way to do it. HBASE-18901 [C++] Fix PROTOBUF_LIBRARY by removing static override in FindZookeeper HBASE-18901 [C++] Remove white space lines and clean up CMAKE
1 parent e2bb10a commit 5ed5927

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+623
-9
lines changed

hbase-native-client/CMakeLists.txt

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
#
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
cmake_minimum_required(VERSION 3.0)
20+
PROJECT(hbaseclient CXX)
21+
set(PROJECT_NAME "hbaseclient")
22+
set(PROJECT_VERSION_MAJOR 0)
23+
set(PROJECT_VERSION_MINOR 1 )
24+
set(PROJECT_VERSION_PATCH 0)
25+
set(BUILD_SHARED_LIBS ON)
26+
## set our cmake module path
27+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
28+
## include the Protobuf generation code
29+
include(ProtobufGen)
30+
if(COMPILER_SUPPORTS_CXX14)
31+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
32+
else()
33+
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
34+
endif()
35+
set(CMAKE_CXX_STANDARD 14)
36+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
37+
set(HBASE_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/hbase")
38+
set(HBASE_PROTO_GEN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/hbase/if")
39+
set(HBASE_PROTO_GEN_INC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/hbase/if")
40+
# Set the right openssl root path
41+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
42+
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl/")
43+
else()
44+
set(OPENSSL_ROOT_DIR "/usr/lib/x86_64-linux-gnu")
45+
endif()
46+
# Include OpenSSL
47+
find_package (OpenSSL REQUIRED)
48+
if (OPENSSL_FOUND)
49+
include_directories(${OPENSSL_INCLUDE_DIR})
50+
else ()
51+
message( FATAL_ERROR "OpenSSL was not found. Please install OpenSSL" )
52+
endif (OPENSSL_FOUND)
53+
# ensure we have required dependencies
54+
find_package(Threads)
55+
find_package(Boost REQUIRED COMPONENTS thread system filesystem)
56+
find_package(Gflags REQUIRED)
57+
find_package(Folly REQUIRED)
58+
find_package(Krb5 REQUIRED)
59+
find_package(Sasl2 REQUIRED)
60+
find_package(Wangle REQUIRED)
61+
find_package(GTest)
62+
find_package(Glog)
63+
find_package(Java REQUIRED)
64+
find_package(JNI REQUIRED)
65+
find_package(Zookeeper REQUIRED)
66+
find_package(Protobuf REQUIRED)
67+
if (NOT FOLLY_FOUND)
68+
message(FATAL_ERROR "-- Folly not found")
69+
endif()
70+
if (NOT WANGLE_FOUND)
71+
message(FATAL_ERROR "-- Wangle not found")
72+
endif()
73+
if (NOT PROTOBUF_FOUND)
74+
message(FATAL_ERROR "-- Protocol buffer include directory not found ${PROTOBUF_INCLUDE_DIRS}")
75+
endif()
76+
if (NOT JNI_FOUND)
77+
message(FATAL_ERROR "-- JAVA include directory not found")
78+
endif()
79+
### provide the include directories, starting at the base
80+
### and including those from our
81+
include_directories(include)
82+
include_directories(${PROTOBUF_INCLUDE_DIRS})
83+
include_directories(${Zookeeper_INCLUDE_DIRS})
84+
include_directories(${Boost_INCLUDE_DIR})
85+
include_directories(${KRB5_INCLUDE_DIRS})
86+
include_directories(${JAVA_INCLUDE_DIRS})
87+
include_directories(${FOLLY_INCLUDE_DIRS})
88+
### create a directory for the hbase protobuf headers.
89+
### this is helpful so that when we include it, later, we can generate
90+
### the protocol buffer source/headers without polluting our tree.
91+
set(CMAKE_BINARY_DIR_GEN "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/hbase/if/")
92+
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR_GEN})
93+
## build a recursive list of sources
94+
file(GLOB_RECURSE CONNECTION_SRC "${HBASE_SRC_DIR}/connection/*.cc" )
95+
file(GLOB_RECURSE EXCEPTION_SRC "${HBASE_SRC_DIR}/exceptions/*.cc" )
96+
file(GLOB_RECURSE PROTO_SRC "${HBASE_SRC_DIR}/if/*.cc" )
97+
file(GLOB_RECURSE UTILS_SRC "${HBASE_SRC_DIR}/utils/*.cc" )
98+
file(GLOB_RECURSE CLIENT_SRC "${HBASE_SRC_DIR}/client/*.cc" )
99+
file(GLOB_RECURSE SECURITY_SRC "${HBASE_SRC_DIR}/security/*.cc" )
100+
file(GLOB_RECURSE SRDE_SRC "${HBASE_SRC_DIR}/serde/*.cc" )
101+
file(GLOB_RECURSE TEST_UTIL "${HBASE_SRC_DIR}/test-util/*.cc" )
102+
include_directories(${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY})
103+
include_directories(${SASL_INCLUDE_DIRS})
104+
include_directories(${GFLAGS_INCLUDE_DIR})
105+
file(GLOB_RECURSE PROTO_FILES "${HBASE_SRC_DIR}/if/*.proto" )
106+
### generate the protocol buffers.
107+
generate_protobuf_src(PROTO_SOURCES PROTO_HEADERS ${PROTO_FILES})
108+
109+
110+
add_library(hbaseclient-static STATIC ${PROTO_SOURCES} ${CLIENT_SRC} ${CONNECTION_SRC} ${EXCEPTION_SRC} ${PROTO_SRC} ${SECURITY_SRC} ${SRDE_SRC} ${UTILS_SRC})
111+
set_target_properties(hbaseclient-static PROPERTIES LINKER_LANGUAGE CXX)
112+
SET_TARGET_PROPERTIES(hbaseclient-static PROPERTIES OUTPUT_NAME hbaseclient CLEAN_DIRECT_OUTPUT 1)
113+
target_link_libraries(hbaseclient-static ${PROTOBUF_LIBRARY})
114+
target_link_libraries(hbaseclient-static ${FOLLY_LIBRARIES})
115+
target_link_libraries(hbaseclient-static ${Boost_LIBRARIES})
116+
target_link_libraries(hbaseclient-static ${SASL_LIBS})
117+
target_link_libraries(hbaseclient-static ${GLOG_SHARED_LIB})
118+
target_link_libraries(hbaseclient-static ${GFLAGS_SHARED_LIB})
119+
target_link_libraries(hbaseclient-static ${KRB5_LIBRARIES})
120+
target_link_libraries(hbaseclient-static ${WANGLE_LIBRARIES})
121+
target_link_libraries(hbaseclient-static ${Zookeeper_LIBRARIES})
122+
target_link_libraries(hbaseclient-static ${OPENSSL_LIBRARIES})
123+
add_library(hbaseclient-shared SHARED ${PROTO_SOURCES} ${CLIENT_SRC} ${CONNECTION_SRC} ${EXCEPTION_SRC} ${PROTO_SRC} ${SECURITY_SRC} ${SRDE_SRC} ${UTILS_SRC})
124+
set_target_properties(hbaseclient-shared PROPERTIES LINKER_LANGUAGE CXX)
125+
SET_TARGET_PROPERTIES(hbaseclient-shared PROPERTIES COMPILE_FLAGS " -fPIC")
126+
SET_TARGET_PROPERTIES(hbaseclient-shared PROPERTIES OUTPUT_NAME hbaseclient CLEAN_DIRECT_OUTPUT 1)
127+
target_link_libraries(hbaseclient-shared ${PROTOBUF_LIBRARY})
128+
target_link_libraries(hbaseclient-shared ${FOLLY_LIBRARIES})
129+
target_link_libraries(hbaseclient-shared ${Boost_LIBRARIES})
130+
target_link_libraries(hbaseclient-shared ${SASL_LIBS})
131+
target_link_libraries(hbaseclient-shared ${GLOG_SHARED_LIB})
132+
target_link_libraries(hbaseclient-shared ${GFLAGS_SHARED_LIB})
133+
target_link_libraries(hbaseclient-shared ${KRB5_LIBRARIES})
134+
target_link_libraries(hbaseclient-shared ${WANGLE_LIBRARIES})
135+
target_link_libraries(hbaseclient-shared ${Zookeeper_LIBRARIES})
136+
add_executable(simple-client "${HBASE_SRC_DIR}/examples/simple-client.cc")
137+
SET_TARGET_PROPERTIES(simple-client PROPERTIES COMPILE_FLAGS " ")
138+
target_link_libraries(simple-client ${PROTOBUF_LIBRARY})
139+
target_link_libraries(simple-client ${Boost_LIBRARIES})
140+
target_link_libraries(simple-client ${SASL_LIBS})
141+
target_link_libraries(simple-client ${GFLAGS_SHARED_LIB})
142+
target_link_libraries(simple-client ${KRB5_LIBRARIES})
143+
target_link_libraries(simple-client ${Zookeeper_LIBRARIES})
144+
target_link_libraries(simple-client hbaseclient-static ${CMAKE_THREAD_LIBS_INIT})
145+
add_executable(load-client "${HBASE_SRC_DIR}/examples/load-client.cc")
146+
SET_TARGET_PROPERTIES(load-client PROPERTIES COMPILE_FLAGS " ")
147+
target_link_libraries(load-client ${PROTOBUF_LIBRARY})
148+
target_link_libraries(load-client ${Boost_LIBRARIES})
149+
target_link_libraries(load-client ${SASL_LIBS})
150+
target_link_libraries(load-client ${GFLAGS_SHARED_LIB})
151+
target_link_libraries(load-client ${KRB5_LIBRARIES})
152+
target_link_libraries(load-client ${Zookeeper_LIBRARIES})
153+
target_link_libraries(load-client hbaseclient-static ${CMAKE_THREAD_LIBS_INIT})
154+
if (JNI_FOUND)
155+
message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}")
156+
message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}")
157+
endif()
158+
if (NOT SKIP_TESTS)
159+
include(BuildTests)
160+
endif()
161+
## Create a custom target for our linter
162+
add_custom_target(
163+
linter
164+
COMMAND ${CMAKE_SOURCE_DIR}/bin/cpplint.sh)
165+
166+
# Install library headers
167+
include(GNUInstallDirs)
168+
file(GLOB RECURSE HEADERS include/*.h)
169+
set_target_properties(hbaseclient-static PROPERTIES PUBLIC_HEADER "${HEADERS}")
170+
install(TARGETS hbaseclient-static
171+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
172+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
173+
PUBLIC_HEADER DESTINATION include/
174+
COMPONENT LIBRARY )
175+
install(TARGETS hbaseclient-shared
176+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
177+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
178+
PUBLIC_HEADER DESTINATION include/
179+
COMPONENT LIBRARY )
180+
INSTALL (
181+
DIRECTORY ${CMAKE_SOURCE_DIR}/include/
182+
DESTINATION include/
183+
FILES_MATCHING PATTERN "*.h*")
184+
# Install pb-generated headers too
185+
INSTALL (
186+
DIRECTORY "${CMAKE_BINARY_DIR_GEN}"
187+
DESTINATION include/hbase/if
188+
FILES_MATCHING PATTERN "hbase/if/*.h")

hbase-native-client/bin/cpplint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818
IFS=$'\n\t'
19-
19+
OUTPUT_DIR=$1
20+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2021
CPPLINT_LOC=https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py
21-
OUTPUT=build/cpplint.py
22+
OUTPUT=$OUTPUT_DIR/cpplint.py
2223

2324
declare -a MODULES=( client connection exceptions security serde utils test-util )
2425

@@ -31,9 +32,9 @@ wget -nc $CPPLINT_LOC -O $OUTPUT
3132
# build/c++11 (We are building with c++14)
3233
for m in ${MODULES[@]}; do
3334
if [ $m != "security" ]; then #These are empty
34-
exec find src/hbase/$m -name "*.h" -or -name "*.cc" | xargs -P8 python $OUTPUT --filter=-build/header_guard,-readability/todo,-build/c++11 --linelength=100
35+
exec find ${SCRIPT_DIR}/../src/hbase/$m -name "*.h" -or -name "*.cc" | xargs -P8 python $OUTPUT --filter=-build/header_guard,-readability/todo,-build/c++11 --linelength=100
3536
fi
3637
if [ $m != "test-util" ]; then
37-
exec find include/hbase/$m -name "*.h" -or -name "*.cc" | xargs -P8 python $OUTPUT --filter=-build/header_guard,-readability/todo,-build/c++11 --linelength=100
38+
exec find ${SCRIPT_DIR}/../include/hbase/$m -name "*.h" -or -name "*.cc" | xargs -P8 python $OUTPUT --filter=-build/header_guard,-readability/todo,-build/c++11 --linelength=100
3839
fi
3940
done
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
### test functions
18+
MACRO(GETSOURCEFILES result curdir)
19+
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
20+
SET(dirlist "")
21+
FOREACH(child ${children})
22+
IF( "${child}" MATCHES ^[^.].*\\.cc)
23+
24+
LIST(APPEND dirlist ${child})
25+
ENDIF()
26+
ENDFOREACH()
27+
SET(${result} ${dirlist})
28+
ENDMACRO()
29+
find_package(GMock REQUIRED)
30+
add_library(testutil STATIC ${TEST_UTIL})
31+
target_include_directories(testutil PRIVATE BEFORE "include")
32+
target_include_directories(testutil PRIVATE BEFORE "${Java_INCLUDE_DIRS}")
33+
target_include_directories(testutil PRIVATE BEFORE "${JNI_INCLUDE_DIRS}")
34+
target_include_directories(testutil PRIVATE BEFORE "${Boost_INCLUDE_DIR}")
35+
target_include_directories(testutil PRIVATE BEFORE "${GTEST_INCLUDE_DIRS}")
36+
target_include_directories(testutil PRIVATE BEFORE${PROTOBUF_INCLUDE_DIRS})
37+
target_include_directories(testutil PRIVATE BEFORE${Zookeeper_INCLUDE_DIRS})
38+
target_include_directories(testutil PRIVATE BEFORE${KRB5_INCLUDE_DIRS})
39+
target_include_directories(testutil PRIVATE BEFORE${Java_INCLUDE_DIRS})
40+
target_include_directories(testutil PRIVATE BEFORE${FOLLY_INCLUDE_DIRS})
41+
target_link_libraries(testutil hbaseclient-static ${CMAKE_THREAD_LIBS_INIT} ${Java_LIBRARIES} ${JNI_LIBRARIES} ${PROTOBUF_LIBRARY} ${Boost_LIBRARIES} ${GFLAGS_SHARED_LIB} ${GMOCK_SHARED_LIB} ${GTEST_BOTH_LIBRARIES} ${SASL_LIBS} ${GFLAGS_SHARED_LIB} ${KRB5_LIBRARIES} ${OPENSSL_LIBRARIES} ${Zookeeper_LIBRARIES})
42+
function(createTests testName)
43+
message ("-- Including Test: ${testName}")
44+
target_include_directories(${testName} PRIVATE BEFORE "include")
45+
target_include_directories(${testName} PRIVATE BEFORE "${Java_INCLUDE_DIRS}")
46+
target_include_directories(${testName} PRIVATE BEFORE "${JNI_INCLUDE_DIRS}")
47+
target_include_directories(${testName} PRIVATE BEFORE "${Boost_INCLUDE_DIR}")
48+
target_include_directories(${testName} PRIVATE BEFORE "${GTEST_INCLUDE_DIRS}")
49+
target_include_directories(${testName} PRIVATE BEFORE "${OPENSSL_INCLUDE_DIR}")
50+
51+
target_link_libraries(hbaseclient-static ${PROTOBUF_LIBRARY})
52+
target_link_libraries(hbaseclient-static ${FOLLY_LIBRARIES})
53+
54+
target_link_libraries(${testName} hbaseclient-static testutil ${CMAKE_THREAD_LIBS_INIT}
55+
${Java_LIBRARIES}
56+
${JNI_LIBRARIES}
57+
${PROTOBUF_LIBRARY}
58+
${Boost_LIBRARIES}
59+
${GFLAGS_SHARED_LIB}
60+
${GTEST_BOTH_LIBRARIES}
61+
${SASL_LIBS}
62+
${GFLAGS_SHARED_LIB}
63+
${KRB5_LIBRARIES}
64+
${Zookeeper_LIBRARIES} ${OPENSSL_LIBRARIES}
65+
${WANGLE_LIBRARIES}
66+
${FOLLY_LIBRARIES}
67+
${GLOG_SHARED_LIB})
68+
endfunction()
69+
enable_testing(test)
70+
SET(TEST_DIR ${CMAKE_SOURCE_DIR}/src/test)
71+
GETSOURCEFILES(UNIT_TESTS "${TEST_DIR}")
72+
SET(UNIT_TEST_COUNT 0)
73+
FOREACH(testfile ${UNIT_TESTS})
74+
get_filename_component(testfilename "${testfile}" NAME_WE)
75+
add_executable("${testfilename}" "${TEST_DIR}/${testfile}")
76+
createTests("${testfilename}")
77+
MATH(EXPR UNIT_TEST_COUNT "${UNIT_TEST_COUNT}+1")
78+
add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR})
79+
ENDFOREACH()
80+
message("-- Finished building ${UNIT_TEST_COUNT} unit test file(s)...")
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
#
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
find_path(FOLLY_ROOT_DIR
20+
NAMES include/folly/AtomicHashMap.h
21+
)
22+
find_library(FOLLY_LIBRARIES
23+
NAMES folly
24+
HINTS ${FOLLY_ROOT_DIR}/lib /usr/lib/ /usr/local/lib/ /usr/lib/x86_64-linux-gnu/
25+
)
26+
find_library(FOLLY_BENCHMARK_LIBRARIES
27+
NAMES follybenchmark
28+
HINTS ${FOLLY_ROOT_DIR}/lib
29+
)
30+
find_path(FOLLY_INCLUDE_DIR
31+
NAMES folly/AtomicHashMap.h
32+
HINTS ${FOLLY_ROOT_DIR}/include
33+
)
34+
include(FindPackageHandleStandardArgs)
35+
find_package_handle_standard_args(Folly DEFAULT_MSG
36+
FOLLY_LIBRARIES
37+
FOLLY_INCLUDE_DIR
38+
)
39+
mark_as_advanced(
40+
FOLLY_ROOT_DIR
41+
FOLLY_LIBRARIES
42+
FOLLY_BENCHMARK_LIBRARIES
43+
FOLLY_INCLUDE_DIR
44+
)
45+
if (FOLLY_LIBRARIES)
46+
set(FOLLY_FOUND "true")
47+
message("-- Folly found, ${FOLLY_LIBRARIES}")
48+
endif(FOLLY_LIBRARIES)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
18+
# make sure we don't accidentally pick up a different version
19+
find_library(GMOCK_SHARED_LIB gmock)
20+
find_library(GMOCK_STATIC_LIB libgmock.a)
21+
include(FindPackageHandleStandardArgs)
22+
find_package_handle_standard_args(GMOCK REQUIRED_VARS
23+
GMOCK_SHARED_LIB GMOCK_STATIC_LIB GMOCK_INCLUDE_DIR)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
find_path(GFLAGS_INCLUDE_DIR gflags/gflags.h)
18+
# make sure we don't accidentally pick up a different version
19+
find_library(GFLAGS_SHARED_LIB gflags)
20+
find_library(GFLAGS_STATIC_LIB libgflags.a)
21+
include(FindPackageHandleStandardArgs)
22+
find_package_handle_standard_args(GFLAGS REQUIRED_VARS
23+
GFLAGS_SHARED_LIB GFLAGS_STATIC_LIB GFLAGS_INCLUDE_DIR)

0 commit comments

Comments
 (0)