Skip to content

Commit

Permalink
Issue#18 and Issue #25: WIP changes to support Accumulo 2.x and remov… (
Browse files Browse the repository at this point in the history
#27)

* Issue#18 and Issue #25: WIP changes to support Accumulo 2.x and remove some warnings

* Add thrift definitions from 2.x

* update

* incremental commit

* add loggers

* Remove libz shared object and boost io streams as external dependencies

* fix tablet caching

* update cmake

* update cmake

* fix issues on osx

* minor update
  • Loading branch information
phrocker authored Nov 8, 2019
1 parent 8830a1a commit e00e525
Show file tree
Hide file tree
Showing 156 changed files with 90,268 additions and 1,241 deletions.
88 changes: 63 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,25 @@ if(CCACHE_FOUND)
message("-- Found ccache: ${CCACHE_FOUND}")
endif(CCACHE_FOUND)

if(NOT APPLE)
if(NOT WIN32)
set(WHOLE_ARCHIVE "-Wl,--whole-archive")
set(NO_WHOLE_ARCHIVE "-Wl,--no-whole-archive")
endif()
endif()

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
####

include(Compression)
include(DownloadProject)

include(LibreSSL)

use_bundled_zlib(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/override/")
find_package(ZLIB REQUIRED)

use_libre_ssl(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/ssl")
find_package (OpenSSL REQUIRED)

################# THRIFT
Expand All @@ -48,21 +58,31 @@ find_package (OpenSSL REQUIRED)
GIT_TAG "v0.12.0"
BUILD_IN_SOURCE true
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/dependencies/thrift-src"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/thrift"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/thrift"
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
"-DWITH_BOOST_STATIC=ON"
"-DBUILD_TESTING=OFF"
"-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}"
"-DWITH_JAVA=OFF"
"-DWITH_LIBEVENT=ON"
"-DWITH_PYTHON=OFF"
"-DLIBRESSL_BIN_DIR=${LIBRESSL_BIN_DIR}"
"-DLIBRESSL_SRC_DIR=${LIBRESSL_BIN_DIR}"
"-DBYPRODUCT_PREFIX=${BYPRODUCT_PREFIX}"
"-DBYPRODUCT_SUFFIX=${BYPRODUCT_SUFFIX}"
"-DZLIB_BYPRODUCT_INCLUDE=${ZLIB_BYPRODUCT_INCLUDE}"
"-DZLIB_BYPRODUCT=${ZLIB_BYPRODUCT}"
"-DZLIB_LIBRARY=${ZLIB_LIBRARY}"
"-DZLIB_LIBRARIES=${ZLIB_LIBRARIES}"
"-DOPENSSL_ROOT_DIR=${LIBRESSL_BIN_DIR}"
"-DWITH_HASKELL=OFF"
"-DWITH_SHARED_LIB=OFF"
"-DWITH_C_GLIB=OFF"
#CONFIGURE_COMMAND ./bootstrap.sh && ./configure --without-qt4 --with-openssl=${LIBRESSL_BIN_DIR} --without-c_glib --without-csharp --without-java --without-erlang --without-nodejs --without-lua --without-python --without-perl --without-php --without-php_extension --without-ruby --without-haskell --without-go --without-d --prefix=${CMAKE_CURRENT_BINARY_DIR}/dependencies/thrift
UPDATE_COMMAND ""
)


add_dependencies(LibThrift zlib-external)
add_dependencies(LibThrift libressl-portable)
add_library(thrift STATIC IMPORTED)
set_target_properties(thrift PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/thrift/lib/libthrift.a")
Expand Down Expand Up @@ -129,8 +149,8 @@ add_subdirectory(${pybind11_SOURCE_DIR})
include_directories("${pybind11_SOURCE_DIR}/include/")
set(Boost_USE_MULTITHREADED ON)
#find_package(GTest REQUIRED)
find_package(Boost 1.55 REQUIRED COMPONENTS system thread iostreams serialization)
find_package(ZLIB REQUIRED)
find_package(Boost 1.55 REQUIRED COMPONENTS system thread serialization)


find_package (Threads)

Expand All @@ -155,23 +175,27 @@ file(GLOB_RECURSE STREAMING_SOURCES "src/data/streaming/*cpp")
file(GLOB_RECURSE ZK_SOURCES "src/data/zookeeper/*cpp")
file(GLOB_RECURSE CLIENT_SOURCES "src/data/client/*cpp")
file(GLOB_RECURSE CAPI_SOURCES "src/extern/*cpp")
file(GLOB_RECURSE EXTERN_SOURCES "src/data/extern/*cpp")
file(GLOB_RECURSE UTIL_SOURCES "src/utils/*cpp")
file(GLOB_RECURSE LOGGING_SOURCES "src/logging/*cpp")
file(GLOB_RECURSE THRIFT_SOURCES "src/data/extern/thrift/*cpp")
file(GLOB_RECURSE THRIFTV2_SOURCES "src/data/extern/thriftv2/*cpp")
file(GLOB_RECURSE CWRAPPER_SOURCES "src/extern/*cpp")
file(GLOB_RECURSE CWRAPPER_SOURCES "src/extern/*cpp")
file(GLOB_RECURSE PYBIND_SOURCES "src/python/*cpp")
file(GLOB_RECURSE INTERCONNECT_SOURCES "src/interconnect/*cpp")
file(GLOB_RECURSE SCANNER_SOURCES "src/scanner/*cpp")
file(GLOB_RECURSE WRITER_SOURCES "src/writer/*cpp")

include_directories("thirdparty/spdlog-20170710/include/")
include_directories("thirdparty/gzip-hpp/")


add_library(sharkbite STATIC ${ZK_SOURCES} ${CONSTRUCT_SOURCES} ${STREAMING_SOURCES} ${CLIENT_SOURCES} ${EXCEPTION_SOURCES} ${EXTERN_SOURCES} ${INTERCONNECT_SOURCES} ${SCANNER_SOURCES} ${WRITER_SOURCES} ${CWRAPPER_SOURCES} )
add_library(sharkbite STATIC ${UTIL_SOURCES} ${LOGGING_SOURCES} ${ZK_SOURCES} ${CONSTRUCT_SOURCES} ${STREAMING_SOURCES} ${CLIENT_SOURCES} ${EXCEPTION_SOURCES} ${THRIFT_SOURCES} ${THRIFTV2_SOURCES} ${INTERCONNECT_SOURCES} ${SCANNER_SOURCES} ${WRITER_SOURCES} ${CWRAPPER_SOURCES} )

#target_link_libraries(sharkbite Python::Python)
add_library(sharkbite-shared SHARED ${ZK_SOURCES} ${CONSTRUCT_SOURCES} ${STREAMING_SOURCES} ${CLIENT_SOURCES} ${EXCEPTION_SOURCES} ${EXTERN_SOURCES} ${INTERCONNECT_SOURCES} ${SCANNER_SOURCES} ${WRITER_SOURCES} ${CWRAPPER_SOURCES} )
add_library(sharkbite-shared SHARED ${UTIL_SOURCES} ${LOGGING_SOURCES} ${ZK_SOURCES} ${CONSTRUCT_SOURCES} ${STREAMING_SOURCES} ${CLIENT_SOURCES} ${EXCEPTION_SOURCES} ${THRIFT_SOURCES} ${THRIFTV2_SOURCES} ${INTERCONNECT_SOURCES} ${SCANNER_SOURCES} ${WRITER_SOURCES} ${CWRAPPER_SOURCES} )


pybind11_add_module(pysharkbite ${PYBIND_SOURCES} ${ZK_SOURCES} ${CONSTRUCT_SOURCES} ${STREAMING_SOURCES} ${CLIENT_SOURCES} ${EXCEPTION_SOURCES} ${EXTERN_SOURCES} ${INTERCONNECT_SOURCES} ${SCANNER_SOURCES} ${WRITER_SOURCES} ${CWRAPPER_SOURCES})
pybind11_add_module(pysharkbite ${PYBIND_SOURCES} ${LOGGING_SOURCES} ${UTIL_SOURCES} ${ZK_SOURCES} ${CONSTRUCT_SOURCES} ${STREAMING_SOURCES} ${CLIENT_SOURCES} ${EXCEPTION_SOURCES} ${THRIFT_SOURCES} ${THRIFTV2_SOURCES} ${INTERCONNECT_SOURCES} ${SCANNER_SOURCES} ${WRITER_SOURCES} ${CWRAPPER_SOURCES})


add_dependencies(sharkbite Protobuf)
Expand All @@ -187,15 +211,31 @@ add_dependencies(sharkbite LibThrift)
add_dependencies(pysharkbite LibThrift)
add_dependencies(sharkbite-shared LibThrift)

target_link_libraries (sharkbite ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${ZOOKEEPER_LIBRARIES} ${OPENSSL_LIBRARIES} ${THRIFT_LIBS} ${ZLIB_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries (sharkbite ${CMAKE_THREAD_LIBS_INIT} ${ZOOKEEPER_LIBRARIES} ${OPENSSL_LIBRARIES} ${THRIFT_LIBS} ${Boost_LIBRARIES})

target_link_libraries (pysharkbite PRIVATE ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${ZOOKEEPER_LIBRARIES} ${OPENSSL_LIBRARIES} ${THRIFT_LIBS} ${ZLIB_LIBRARIES} ${Boost_LIBRARIES})

target_link_libraries(sharkbite
${WHOLE_ARCHIVE}
${ZLIB_LIBRARY}
${NO_WHOLE_ARCHIVE}
)

target_link_libraries (pysharkbite PRIVATE ${CMAKE_THREAD_LIBS_INIT} ${ZOOKEEPER_LIBRARIES} ${OPENSSL_LIBRARIES} ${THRIFT_LIBS} ${Boost_LIBRARIES})
target_compile_definitions( pysharkbite PRIVATE -DPYTHON=1)
target_link_libraries(pysharkbite PRIVATE
${WHOLE_ARCHIVE}
${ZLIB_LIBRARY}
${NO_WHOLE_ARCHIVE}
)

target_link_libraries (sharkbite-shared ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries (sharkbite-shared ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} ${Boost_LIBRARIES})

target_link_libraries (sharkbite-shared ${ZOOKEEPER_LIBRARIES})

target_link_libraries(sharkbite-shared ${WHOLE_ARCHIVE} ${ZLIB_LIBRARY} ${NO_WHOLE_ARCHIVE}
)


target_link_libraries (sharkbite-shared ${THRIFT_LIBS})


Expand All @@ -206,15 +246,15 @@ target_link_libraries(capi PRIVATE sharkbite-shared)
#ClientExample
add_executable(ClientExample "src/examples/ClientExample.cpp")
target_link_libraries (ClientExample ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ClientExample ${ZLIB_LIBRARIES})
#target_link_libraries (ClientExample ${WHOLE_ARCHIVE} ${ZLIB_LIBRARY} ${NO_WHOLE_ARCHIVE})
target_link_libraries( ClientExample ${Boost_LIBRARIES} )
target_link_libraries( ClientExample ${ZOOKEEPER_LIBRARIES} ${OPENSSL_LIBRARIES})
target_link_libraries( ClientExample ${THRIFT_LIBS} sharkbite)

#ClientExample
add_executable(InsertTest "src/examples/InsertTest.cpp")
target_link_libraries (InsertTest ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (InsertTest ${ZLIB_LIBRARIES})
#target_link_libraries (InsertTest ${WHOLE_ARCHIVE} ${ZLIB_LIBRARY} ${NO_WHOLE_ARCHIVE})
target_link_libraries( InsertTest ${Boost_LIBRARIES} )
target_link_libraries( InsertTest ${ZOOKEEPER_LIBRARIES} )
target_link_libraries( InsertTest ${THRIFT_LIBS} ${OPENSSL_LIBRARIES})
Expand All @@ -224,7 +264,7 @@ target_link_libraries( InsertTest sharkbite)
#ClientExample
add_executable(ContinuousIngest "src/examples/ContinuousIngest.cpp")
target_link_libraries (ContinuousIngest ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (ContinuousIngest ${ZLIB_LIBRARIES})
#target_link_libraries (ContinuousIngest ${WHOLE_ARCHIVE} ${ZLIB_LIBRARY} ${NO_WHOLE_ARCHIVE})
target_link_libraries( ContinuousIngest ${Boost_LIBRARIES} )
target_link_libraries( ContinuousIngest ${ZOOKEEPER_LIBRARIES} ${OPENSSL_LIBRARIES})
target_link_libraries( ContinuousIngest ${THRIFT_LIBS})
Expand All @@ -233,23 +273,23 @@ target_link_libraries( ContinuousIngest sharkbite)
#TableOps
add_executable(TableOps "src/examples/TableOps.cpp")
target_link_libraries (TableOps ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (TableOps ${ZLIB_LIBRARIES})
#target_link_libraries (TableOps ${WHOLE_ARCHIVE} ${ZLIB_LIBRARY} ${NO_WHOLE_ARCHIVE})
target_link_libraries( TableOps ${Boost_LIBRARIES} )
target_link_libraries( TableOps ${ZOOKEEPER_LIBRARIES} )
target_link_libraries( TableOps ${THRIFT_LIBS} ${OPENSSL_LIBRARIES})
target_link_libraries( TableOps sharkbite)

add_executable(RfileReadExample "src/examples/RfileReadExample.cpp")
target_link_libraries (RfileReadExample ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (RfileReadExample ${ZLIB_LIBRARIES})
#target_link_libraries (RfileReadExample ${WHOLE_ARCHIVE} ${ZLIB_LIBRARY} ${NO_WHOLE_ARCHIVE})
target_link_libraries( RfileReadExample ${Boost_LIBRARIES} )
target_link_libraries( RfileReadExample ${ZOOKEEPER_LIBRARIES} ${OPENSSL_LIBRARIES} )
target_link_libraries( RfileReadExample ${THRIFT_LIBS})
target_link_libraries( RfileReadExample sharkbite)

add_executable(PrintInfo "src/examples/PrintInfo.cpp")
target_link_libraries (PrintInfo ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (PrintInfo ${ZLIB_LIBRARIES})
#target_link_libraries (PrintInfo ${WHOLE_ARCHIVE} ${ZLIB_LIBRARY} ${NO_WHOLE_ARCHIVE})
target_link_libraries( PrintInfo ${Boost_LIBRARIES} )
target_link_libraries( PrintInfo ${ZOOKEEPER_LIBRARIES} ${OPENSSL_LIBRARIES} )
target_link_libraries( PrintInfo ${THRIFT_LIBS})
Expand All @@ -266,23 +306,23 @@ enable_testing()

file(GLOB_RECURSE RFILE_TEST "test/constructs/rfile_test.cpp")
add_executable(testrfile ${RFILE_TEST})
target_link_libraries(testrfile ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES} sharkbite)
target_link_libraries(testrfile ${CMAKE_THREAD_LIBS_INIT} sharkbite)


add_test(NAME testrfile
COMMAND testrfile)

file(GLOB_RECURSE TEST_CONSTRUCTS "test/constructs/TestConstructs.cpp")
add_executable(testconstructs ${TEST_CONSTRUCTS})
target_link_libraries(testconstructs ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES} sharkbite)
target_link_libraries(testconstructs ${CMAKE_THREAD_LIBS_INIT} sharkbite)


add_test(NAME testconstructs
COMMAND testconstructs)

file(GLOB_RECURSE TEST_STREAMS "test/constructs/TestStreams.cpp")
add_executable(teststreams ${TEST_STREAMS})
target_link_libraries(teststreams ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES} sharkbite)
target_link_libraries(teststreams ${CMAKE_THREAD_LIBS_INIT} sharkbite)

add_test(NAME teststreams
COMMAND teststreams)
Expand All @@ -291,7 +331,6 @@ enable_testing()
file(GLOB_RECURSE TEST_ZK_INSTANCE "test/zookeeper/testInstance.cpp")
add_executable(testzkInstance ${TEST_ZK_INSTANCE})
target_link_libraries (testzkInstance ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (testzkInstance ${ZLIB_LIBRARIES})
target_link_libraries( testzkInstance ${Boost_LIBRARIES} )
target_link_libraries( testzkInstance ${ZOOKEEPER_LIBRARIES} )
target_link_libraries( testzkInstance ${OPENSSL_LIBRARIES} ${THRIFT_LIBS} sharkbite)
Expand All @@ -301,7 +340,6 @@ enable_testing()
file(GLOB_RECURSE VANDV "test/vandv/IntegrationTest.cpp")
add_executable(integrationTest ${VANDV})
target_link_libraries (integrationTest ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (integrationTest ${ZLIB_LIBRARIES})
target_link_libraries( integrationTest ${Boost_LIBRARIES} )
target_link_libraries( integrationTest ${ZOOKEEPER_LIBRARIES} )
target_link_libraries( integrationTest ${THRIFT_LIBS} ${OPENSSL_LIBRARIES})
Expand Down
7 changes: 6 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,9 @@ This includes derived works from the Apache NiFi MiNiFi c++ (ALv2 Licensed ) pro
Copyright 2019 The Apache Software Foundation
The derived and original works are listed below:
BackTrace.h
ThreadPool.h
ThreadPool.h
Properties.h/Properties.cpp
Logger.h
LoggerConfiguration.h/LoggerConfiguration.cpp
StringUtils.h/StringUtils.cpp
ClassUtils.h/ClassUtils.cpp
60 changes: 60 additions & 0 deletions cmake/modules/Compression.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

function(use_bundled_zlib SOURCE_DIR BINARY_DIR)
message("Using bundled zlib")
if (WIN32)
string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type)
if (build_type MATCHES relwithdebinfo OR build_type MATCHES release)
set(BYPRODUCT "thirdparty/zlib-src/zlibstatic.lib")
else()
set(BYPRODUCT "thirdparty/zlib-src/zlibstaticd.lib")
endif()
else()
set(BYPRODUCT "thirdparty/zlib-src/libz.a")
endif()
ExternalProject_Add(
zlib-external
BUILD_IN_SOURCE true
GIT_REPOSITORY "https://github.com/madler/zlib.git"
GIT_TAG "cacf7f1d4e3d44d871b605da3b647f07d718623f" # Version 1.2.11
SOURCE_DIR "${BINARY_DIR}/thirdparty/zlib-src"
CMAKE_ARGS "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
"-D_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/zlib-install"
BUILD_BYPRODUCTS ${BYPRODUCT}
INSTALL_COMMAND ""
)


add_library(z STATIC IMPORTED)
set_target_properties(z PROPERTIES IMPORTED_LOCATION "${BINARY_DIR}/${BYPRODUCT}")

set(ZLIB_BYPRODUCT "${BINARY_DIR}/${BYPRODUCT}" CACHE STRING "" FORCE)
set(ZLIB_BYPRODUCT_INCLUDE "${BINARY_DIR}/thirdparty/zlib-src/" CACHE STRING "" FORCE)
set(ZLIB_BIN_DIR "${BINARY_DIR}/thirdparty/zlib-src/" CACHE STRING "" FORCE)

add_dependencies(z zlib-external)
set(ZLIB_FOUND "YES" CACHE STRING "" FORCE)
set(ZLIB_INCLUDE_DIR "${ZLIB_BYPRODUCT_INCLUDE}" CACHE STRING "" FORCE)
set(ZLIB_INCLUDE_DIRS "${ZLIB_BYPRODUCT_INCLUDE}" CACHE STRING "" FORCE)

set(ZLIB_LIBRARY "${BINARY_DIR}/${BYPRODUCT}" CACHE STRING "" FORCE)
set(ZLIB_LIBRARIES "${ZLIB_LIBRARY}" CACHE STRING "" FORCE)
set(ZLIB_LIBRARY_RELEASE "${ZLIB_LIBRARY}" CACHE STRING "" FORCE)
set(ZLIB_LIBRARY_DEBUG "${ZLIB_LIBRARY}" CACHE STRING "" FORCE)

endfunction(use_bundled_zlib)
6 changes: 3 additions & 3 deletions cmake/modules/LibreSSL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ function(use_libre_ssl SOURCE_DIR BINARY_DIR)
set_target_properties(tls PROPERTIES INTERFACE_LINK_LIBRARIES crypto)
add_dependencies(tls libressl-portable)

set(LIBRESSL_SRC_DIR "${SOURCE_DIR}/dependencies/libressl/" CACHE STRING "" FORCE)
set(LIBRESSL_BIN_DIR "${BINARY_DIR}/dependencies/libressl-install/" CACHE STRING "" FORCE)
set(LIBRESSL_SRC_DIR "${SOURCE_DIR}/dependencies/libressl" CACHE STRING "" FORCE)
set(LIBRESSL_BIN_DIR "${BINARY_DIR}/dependencies/libressl-install" CACHE STRING "" FORCE)

set(OPENSSL_FOUND "YES" CACHE STRING "" FORCE)
set(OPENSSL_INCLUDE_DIR "${SOURCE_DIR}/dependencies/libressl/include" CACHE STRING "" FORCE)
set(OPENSSL_INCLUDE_DIR "${LIBRESSL_BIN_DIR}/include" CACHE STRING "" FORCE)
set(OPENSSL_LIBRARIES "${BINARY_DIR}/dependencies/libressl-install/lib/${BYPRODUCT_PREFIX}tls${BYPRODUCT_SUFFIX}" "${BINARY_DIR}/dependencies/libressl-install/lib/${BYPRODUCT_PREFIX}ssl${BYPRODUCT_SUFFIX}" "${BINARY_DIR}/dependencies/libressl-install/lib/${BYPRODUCT_PREFIX}crypto${BYPRODUCT_SUFFIX}" CACHE STRING "" FORCE)

endfunction(use_libre_ssl)
47 changes: 47 additions & 0 deletions cmake/override/FindOpenSSL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Dummy OpenSSL find for when we use bundled version

set(OPENSSL_FOUND "YES" CACHE STRING "" FORCE)
set(OPENSSL_INCLUDE_DIR "${LIBRESSL_BIN_DIR}/include" CACHE STRING "" FORCE)
set(OPENSSL_CRYPTO_LIBRARY "${LIBRESSL_BIN_DIR}/lib/${BYPRODUCT_PREFIX}crypto${BYPRODUCT_SUFFIX}" CACHE STRING "" FORCE)
set(OPENSSL_SSL_LIBRARY "${LIBRESSL_BIN_DIR}/lib/${BYPRODUCT_PREFIX}ssl${BYPRODUCT_SUFFIX}" CACHE STRING "" FORCE)
set(OPENSSL_LIBRARIES "${LIBRESSL_BIN_DIR}/lib/${BYPRODUCT_PREFIX}tls${BYPRODUCT_SUFFIX}" ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} CACHE STRING "" FORCE)
set(OPENSSL_VERSION "1.0.2" CACHE STRING "" FORCE)

if(NOT TARGET OpenSSL::Crypto )
add_library(OpenSSL::Crypto UNKNOWN IMPORTED)
set_target_properties(OpenSSL::Crypto PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}")

set_target_properties(OpenSSL::Crypto PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}")

endif()

if(NOT TARGET OpenSSL::SSL
)
add_library(OpenSSL::SSL UNKNOWN IMPORTED)
set_target_properties(OpenSSL::SSL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENSSL_INCLUDE_DIR}")
set_target_properties(OpenSSL::SSL PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${OPENSSL_SSL_LIBRARY}")

endif()
Loading

0 comments on commit e00e525

Please sign in to comment.