Skip to content

Commit b36e896

Browse files
committed
HBASE-18901 [C++] Remove white space lines and clean up CMAKE
1 parent f795983 commit b36e896

File tree

11 files changed

+0
-84
lines changed

11 files changed

+0
-84
lines changed

hbase-native-client/CMakeLists.txt

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
#
19-
2019
cmake_minimum_required(VERSION 3.0)
2120
PROJECT(hbaseclient CXX)
2221
set(PROJECT_NAME "hbaseclient")
@@ -26,29 +25,24 @@ set(PROJECT_VERSION_PATCH 0)
2625
set(BUILD_SHARED_LIBS ON)
2726
## set our cmake module path
2827
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
29-
3028
## include the Protobuf generation code
3129
include(ProtobufGen)
3230
if(COMPILER_SUPPORTS_CXX14)
3331
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
3432
else()
3533
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
3634
endif()
37-
3835
set(CMAKE_CXX_STANDARD 14)
3936
set(CMAKE_CXX_STANDARD_REQUIRED ON)
40-
4137
set(HBASE_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/hbase")
4238
set(HBASE_PROTO_GEN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/hbase/if")
4339
set(HBASE_PROTO_GEN_INC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/hbase/if")
44-
4540
# Set the right openssl root path
4641
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
4742
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl/")
4843
else()
4944
set(OPENSSL_ROOT_DIR "/usr/lib/x86_64-linux-gnu")
5045
endif()
51-
5246
# Include OpenSSL
5347
find_package (OpenSSL REQUIRED)
5448
if (OPENSSL_FOUND)
@@ -70,24 +64,18 @@ find_package(Java REQUIRED)
7064
find_package(JNI REQUIRED)
7165
find_package(Zookeeper REQUIRED)
7266
find_package(Protobuf REQUIRED)
73-
74-
7567
if (NOT FOLLY_FOUND)
7668
message(FATAL_ERROR "-- Folly not found")
7769
endif()
78-
7970
if (NOT WANGLE_FOUND)
8071
message(FATAL_ERROR "-- Wangle not found")
8172
endif()
82-
8373
if (NOT PROTOBUF_FOUND)
8474
message(FATAL_ERROR "-- Protocol buffer include directory not found ${PROTOBUF_INCLUDE_DIRS}")
8575
endif()
86-
8776
if (NOT JNI_FOUND)
8877
message(FATAL_ERROR "-- JAVA include directory not found")
8978
endif()
90-
9179
### provide the include directories, starting at the base
9280
### and including those from our
9381
include_directories(include)
@@ -102,10 +90,6 @@ include_directories(${FOLLY_INCLUDE_DIRS})
10290
### the protocol buffer source/headers without polluting our tree.
10391
set(CMAKE_BINARY_DIR_GEN "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/hbase/if/")
10492
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR_GEN})
105-
106-
107-
108-
10993
## build a recursive list of sources
11094
file(GLOB_RECURSE CONNECTION_SRC "${HBASE_SRC_DIR}/connection/*.cc" )
11195
file(GLOB_RECURSE EXCEPTION_SRC "${HBASE_SRC_DIR}/exceptions/*.cc" )
@@ -118,9 +102,7 @@ file(GLOB_RECURSE TEST_UTIL "${HBASE_SRC_DIR}/test-util/*.cc" )
118102
include_directories(${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY})
119103
include_directories(${SASL_INCLUDE_DIRS})
120104
include_directories(${GFLAGS_INCLUDE_DIR})
121-
122105
file(GLOB_RECURSE PROTO_FILES "${HBASE_SRC_DIR}/if/*.proto" )
123-
124106
### generate the protocol buffers.
125107
generate_protobuf_src(PROTO_SOURCES PROTO_HEADERS ${PROTO_FILES})
126108

@@ -138,7 +120,6 @@ target_link_libraries(hbaseclient-static ${KRB5_LIBRARIES})
138120
target_link_libraries(hbaseclient-static ${WANGLE_LIBRARIES})
139121
target_link_libraries(hbaseclient-static ${Zookeeper_LIBRARIES})
140122
target_link_libraries(hbaseclient-static ${OPENSSL_LIBRARIES})
141-
142123
add_library(hbaseclient-shared SHARED ${PROTO_SOURCES} ${CLIENT_SRC} ${CONNECTION_SRC} ${EXCEPTION_SRC} ${PROTO_SRC} ${SECURITY_SRC} ${SRDE_SRC} ${UTILS_SRC})
143124
set_target_properties(hbaseclient-shared PROPERTIES LINKER_LANGUAGE CXX)
144125
SET_TARGET_PROPERTIES(hbaseclient-shared PROPERTIES COMPILE_FLAGS " -fPIC")
@@ -152,7 +133,6 @@ target_link_libraries(hbaseclient-shared ${GFLAGS_SHARED_LIB})
152133
target_link_libraries(hbaseclient-shared ${KRB5_LIBRARIES})
153134
target_link_libraries(hbaseclient-shared ${WANGLE_LIBRARIES})
154135
target_link_libraries(hbaseclient-shared ${Zookeeper_LIBRARIES})
155-
156136
add_executable(simple-client "${HBASE_SRC_DIR}/examples/simple-client.cc")
157137
SET_TARGET_PROPERTIES(simple-client PROPERTIES COMPILE_FLAGS " ")
158138
target_link_libraries(simple-client ${PROTOBUF_LIBRARY})
@@ -162,7 +142,6 @@ target_link_libraries(simple-client ${GFLAGS_SHARED_LIB})
162142
target_link_libraries(simple-client ${KRB5_LIBRARIES})
163143
target_link_libraries(simple-client ${Zookeeper_LIBRARIES})
164144
target_link_libraries(simple-client hbaseclient-static ${CMAKE_THREAD_LIBS_INIT})
165-
166145
add_executable(load-client "${HBASE_SRC_DIR}/examples/load-client.cc")
167146
SET_TARGET_PROPERTIES(load-client PROPERTIES COMPILE_FLAGS " ")
168147
target_link_libraries(load-client ${PROTOBUF_LIBRARY})
@@ -172,26 +151,19 @@ target_link_libraries(load-client ${GFLAGS_SHARED_LIB})
172151
target_link_libraries(load-client ${KRB5_LIBRARIES})
173152
target_link_libraries(load-client ${Zookeeper_LIBRARIES})
174153
target_link_libraries(load-client hbaseclient-static ${CMAKE_THREAD_LIBS_INIT})
175-
176-
177154
if (JNI_FOUND)
178155
message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}")
179156
message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}")
180157
endif()
181-
182158
if (NOT SKIP_TESTS)
183159
include(BuildTests)
184160
endif()
185-
186161
## Create a custom target for our linter
187-
188162
add_custom_target(
189163
linter
190164
COMMAND ${CMAKE_SOURCE_DIR}/bin/cpplint.sh)
191165

192-
193166
# Install library headers
194-
195167
include(GNUInstallDirs)
196168
file(GLOB RECURSE HEADERS include/*.h)
197169
set_target_properties(hbaseclient-static PROPERTIES PUBLIC_HEADER "${HEADERS}")
@@ -200,18 +172,15 @@ install(TARGETS hbaseclient-static
200172
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
201173
PUBLIC_HEADER DESTINATION include/
202174
COMPONENT LIBRARY )
203-
204175
install(TARGETS hbaseclient-shared
205176
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
206177
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
207178
PUBLIC_HEADER DESTINATION include/
208179
COMPONENT LIBRARY )
209-
210180
INSTALL (
211181
DIRECTORY ${CMAKE_SOURCE_DIR}/include/
212182
DESTINATION include/
213183
FILES_MATCHING PATTERN "*.h*")
214-
215184
# Install pb-generated headers too
216185
INSTALL (
217186
DIRECTORY "${CMAKE_BINARY_DIR_GEN}"

hbase-native-client/cmake/BuildTests.cmake

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
18-
1917
### test functions
20-
2118
MACRO(GETSOURCEFILES result curdir)
2219
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
2320
SET(dirlist "")
@@ -29,7 +26,6 @@ MACRO(GETSOURCEFILES result curdir)
2926
ENDFOREACH()
3027
SET(${result} ${dirlist})
3128
ENDMACRO()
32-
3329
find_package(GMock REQUIRED)
3430
add_library(testutil STATIC ${TEST_UTIL})
3531
target_include_directories(testutil PRIVATE BEFORE "include")
@@ -43,7 +39,6 @@ target_include_directories(testutil PRIVATE BEFORE${KRB5_INCLUDE_DIRS})
4339
target_include_directories(testutil PRIVATE BEFORE${Java_INCLUDE_DIRS})
4440
target_include_directories(testutil PRIVATE BEFORE${FOLLY_INCLUDE_DIRS})
4541
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})
46-
4742
function(createTests testName)
4843
message ("-- Including Test: ${testName}")
4944
target_include_directories(${testName} PRIVATE BEFORE "include")
@@ -71,14 +66,9 @@ function(createTests testName)
7166
${FOLLY_LIBRARIES}
7267
${GLOG_SHARED_LIB})
7368
endfunction()
74-
75-
7669
enable_testing(test)
77-
7870
SET(TEST_DIR ${CMAKE_SOURCE_DIR}/src/test)
79-
8071
GETSOURCEFILES(UNIT_TESTS "${TEST_DIR}")
81-
8272
SET(UNIT_TEST_COUNT 0)
8373
FOREACH(testfile ${UNIT_TESTS})
8474
get_filename_component(testfilename "${testfile}" NAME_WE)
@@ -88,5 +78,3 @@ FOREACH(testfile ${UNIT_TESTS})
8878
add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR})
8979
ENDFOREACH()
9080
message("-- Finished building ${UNIT_TEST_COUNT} unit test file(s)...")
91-
92-

hbase-native-client/cmake/FindFolly.cmake

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,32 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
#
19-
2019
find_path(FOLLY_ROOT_DIR
2120
NAMES include/folly/AtomicHashMap.h
2221
)
23-
2422
find_library(FOLLY_LIBRARIES
2523
NAMES folly
2624
HINTS ${FOLLY_ROOT_DIR}/lib /usr/lib/ /usr/local/lib/ /usr/lib/x86_64-linux-gnu/
2725
)
28-
2926
find_library(FOLLY_BENCHMARK_LIBRARIES
3027
NAMES follybenchmark
3128
HINTS ${FOLLY_ROOT_DIR}/lib
3229
)
33-
3430
find_path(FOLLY_INCLUDE_DIR
3531
NAMES folly/AtomicHashMap.h
3632
HINTS ${FOLLY_ROOT_DIR}/include
3733
)
38-
3934
include(FindPackageHandleStandardArgs)
4035
find_package_handle_standard_args(Folly DEFAULT_MSG
4136
FOLLY_LIBRARIES
4237
FOLLY_INCLUDE_DIR
4338
)
44-
4539
mark_as_advanced(
4640
FOLLY_ROOT_DIR
4741
FOLLY_LIBRARIES
4842
FOLLY_BENCHMARK_LIBRARIES
4943
FOLLY_INCLUDE_DIR
5044
)
51-
5245
if (FOLLY_LIBRARIES)
5346
set(FOLLY_FOUND "true")
5447
message("-- Folly found, ${FOLLY_LIBRARIES}")

hbase-native-client/cmake/FindGMock.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
1817
find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
1918
# make sure we don't accidentally pick up a different version
2019
find_library(GMOCK_SHARED_LIB gmock)
2120
find_library(GMOCK_STATIC_LIB libgmock.a)
22-
2321
include(FindPackageHandleStandardArgs)
2422
find_package_handle_standard_args(GMOCK REQUIRED_VARS
2523
GMOCK_SHARED_LIB GMOCK_STATIC_LIB GMOCK_INCLUDE_DIR)

hbase-native-client/cmake/FindGflags.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
1817
find_path(GFLAGS_INCLUDE_DIR gflags/gflags.h)
1918
# make sure we don't accidentally pick up a different version
2019
find_library(GFLAGS_SHARED_LIB gflags)
2120
find_library(GFLAGS_STATIC_LIB libgflags.a)
22-
2321
include(FindPackageHandleStandardArgs)
2422
find_package_handle_standard_args(GFLAGS REQUIRED_VARS
2523
GFLAGS_SHARED_LIB GFLAGS_STATIC_LIB GFLAGS_INCLUDE_DIR)

hbase-native-client/cmake/FindGlog.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
1817
find_path(GLOG_INCLUDE_DIR glog/logging.h)
1918
# make sure we don't accidentally pick up a different version
2019
find_library(GLOG_SHARED_LIB glog)
2120
find_library(GLOG_STATIC_LIB libglog.a)
22-
2321
include(FindPackageHandleStandardArgs)
2422
find_package_handle_standard_args(GLOG REQUIRED_VARS
2523
GLOG_SHARED_LIB GLOG_STATIC_LIB GLOG_INCLUDE_DIR)

hbase-native-client/cmake/FindKrb5.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,23 @@
1919
find_path(KRB5_ROOT_DIR
2020
NAMES include/krb5/krb5.h
2121
)
22-
2322
find_library(KRB5_LIBRARIES
2423
NAMES krb5
2524
HINTS ${KRB5_ROOT_DIR}/lib
2625
)
27-
28-
2926
find_path(KRB5_INCLUDE_DIR
3027
NAMES krb5/krb5.h
3128
HINTS ${KRB5_ROOT_DIR}/include
3229
)
33-
3430
include(FindPackageHandleStandardArgs)
3531
find_package_handle_standard_args(krb5 DEFAULT_MSG
3632
KRB5_LIBRARIES
3733
KRB5_INCLUDE_DIR
3834
)
39-
4035
if (KRB5_LIBRARIES)
4136
set(KRB5_FOUND "true")
4237
message("-- KRB5 Libs Found, ${KRB5_LIBRARIES}")
4338
endif()
44-
4539
mark_as_advanced(
4640
KRB5_ROOT_DIR
4741
KRB5_LIBRARIES

hbase-native-client/cmake/FindSasl2.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@
1717
# under the License.
1818
#
1919
include(CheckSymbolExists)
20-
2120
find_path (
2221
SASL_INCLUDE_DIRS NAMES sasl/sasl.h
2322
PATHS /include /usr/include /usr/local/include /usr/share/include)
24-
2523
find_library(
2624
SASL_LIBS NAMES sasl2
2725
PATHS /usr/lib /lib /usr/local/lib /usr/lib/x86_64-linux-gnu/)
28-
2926
if (SASL_INCLUDE_DIRS AND SASL_LIBS)
3027
set (SASL_FOUND 1)
3128
message("-- LibSASL found, ${SASL_LIBS}")

hbase-native-client/cmake/FindWangle.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,27 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
#
19-
2019
find_path(WANGLE_ROOT_DIR
2120
NAMES include/wangle/acceptor/Acceptor.h
2221
)
23-
2422
find_library(WANGLE_LIBRARIES
2523
NAMES wangle
2624
HINTS ${WANGLE_ROOT_DIR}/lib /usr/lib/ /usr/local/lib/
2725
)
28-
2926
find_path(WANGLE_INCLUDE_DIR
3027
NAMES wangle/acceptor/Acceptor.h
3128
HINTS ${WANGLE_ROOT_DIR}/include /usr/local/include/
3229
)
33-
3430
include(FindPackageHandleStandardArgs)
3531
find_package_handle_standard_args(WANGLE DEFAULT_MSG
3632
WANGLE_LIBRARIES
3733
WANGLE_INCLUDE_DIR
3834
)
39-
4035
mark_as_advanced(
4136
WANGLE_ROOT_DIR
4237
WANGLE_LIBRARIES
4338
WANGLE_INCLUDE_DIR
4439
)
45-
4640
if (WANGLE_LIBRARIES)
4741
set(WANGLE_FOUND "true")
4842
message("-- Wangle found, ${WANGLE_LIBRARIES}")

hbase-native-client/cmake/FindZookeeper.cmake

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ if (MSVC)
2828
else()
2929
FILE(TO_CMAKE_PATH ${ZOOKEEPER_HOME} Zookeeper_HomePath)
3030
set(Zookeeper_LIB_PATHS ${Zookeeper_HomePath}/src/c/${ZK_BuildOutputDir})
31-
3231
find_path(ZK_INCLUDE_DIR zookeeper.h ${Zookeeper_HomePath}/src/c/include)
3332
find_path(ZK_INCLUDE_DIR_GEN zookeeper.jute.h ${Zookeeper_HomePath}/src/c/generated)
3433
set(Zookeeper_INCLUDE_DIR zookeeper.h ${ZK_INCLUDE_DIR} ${ZK_INCLUDE_DIR_GEN} )
@@ -39,21 +38,14 @@ else()
3938
find_path(Zookeeper_INCLUDE_DIR zookeeper/zookeeper.h /usr/local/include)
4039
find_library(Zookeeper_LIBRARY NAMES libzookeeper_mt.a PATHS ${Zookeeper_LIB_PATHS})
4140
endif()
42-
43-
4441
set(Zookeeper_LIBRARIES ${Zookeeper_LIBRARY} )
4542
set(Zookeeper_INCLUDE_DIRS ${Zookeeper_INCLUDE_DIR} )
46-
4743
include(FindPackageHandleStandardArgs)
4844
# handle the QUIETLY and REQUIRED arguments and set Zookeeper_FOUND to TRUE
4945
# if all listed variables are TRUE
5046
find_package_handle_standard_args(Zookeeper DEFAULT_MSG
5147
Zookeeper_LIBRARY Zookeeper_INCLUDE_DIR)
52-
5348
if (Zookeeper_LIBRARY)
5449
message("-- Zookeeper found, ${Zookeeper_LIBRARY}")
5550
endif()
56-
5751
mark_as_advanced(Zookeeper_INCLUDE_DIR Zookeeper_LIBRARY )
58-
59-

0 commit comments

Comments
 (0)