cmake: disable internal ORC when using external Parquet

Squashed:
- fix internal poco linking with `zlib`

Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com>
This commit is contained in:
Konstantin Podshumok 2020-08-17 21:47:16 +03:00
parent e0939a8666
commit cc6a59d59b
No known key found for this signature in database
GPG Key ID: 7EA5D4784D5BB847
5 changed files with 16 additions and 4 deletions

View File

@ -418,7 +418,12 @@ include (cmake/find/parquet.cmake)
include (cmake/find/simdjson.cmake)
include (cmake/find/rapidjson.cmake)
include (cmake/find/fastops.cmake)
if(NOT USE_INTERNAL_PARQUET_LIBRARY)
set (ENABLE_ORC OFF CACHE INTERNAL "")
endif()
include (cmake/find/orc.cmake)
include (cmake/find/avro.cmake)
include (cmake/find/msgpack.cmake)
include (cmake/find/cassandra.cmake)

View File

@ -7,8 +7,12 @@ if(NOT ENABLE_ORC)
return()
endif()
option(USE_INTERNAL_ORC_LIBRARY "Set to FALSE to use system ORC instead of bundled (experimental set to OFF on your own risk)"
if (USE_INTERNAL_PARQUET_LIBRARY)
option(USE_INTERNAL_ORC_LIBRARY "Set to FALSE to use system ORC instead of bundled (experimental set to OFF on your own risk)"
ON)
elseif(USE_INTERNAL_ORC_LIBRARY)
message (${RECONFIGURE_MESSAGE_LEVEL} "Currently internal ORC can be build only with bundled Parquet")
endif()
include(cmake/find/snappy.cmake)

View File

@ -23,6 +23,8 @@ if (NOT USE_INTERNAL_ZLIB_LIBRARY)
find_package (ZLIB)
if (NOT ZLIB_FOUND)
message (${RECONFIGURE_MESSAGE_LEVEL} "Can't find system zlib library")
else()
set (ZLIB_NAME "libz")
endif()
endif ()
@ -33,6 +35,7 @@ if (NOT ZLIB_FOUND AND NOT MISSING_INTERNAL_ZLIB_LIBRARY)
set (ZLIB_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIR}) # for protobuf
set (ZLIB_FOUND 1) # for poco
set (ZLIB_LIBRARIES zlib CACHE INTERNAL "")
set (ZLIB_NAME "${INTERNAL_ZLIB_NAME}")
endif ()
message (STATUS "Using ${INTERNAL_ZLIB_NAME}: ${ZLIB_INCLUDE_DIR} : ${ZLIB_LIBRARIES}")
message (STATUS "Using ${ZLIB_NAME}: ${ZLIB_INCLUDE_DIR} : ${ZLIB_LIBRARIES}")

View File

@ -84,7 +84,7 @@ if (NOT EXTERNAL_BOOST_FOUND)
add_library (_boost_iostreams ${SRCS_IOSTREAMS})
add_library (boost::iostreams ALIAS _boost_iostreams)
target_include_directories (_boost_iostreams PRIVATE ${LIBRARY_DIR})
target_link_libraries (_boost_iostreams PRIVATE zlib)
target_link_libraries (_boost_iostreams PRIVATE ${ZLIB_LIBRARIES})
# program_options

View File

@ -222,7 +222,7 @@ if (USE_INTERNAL_POCO_LIBRARY)
POCO_OS_FAMILY_UNIX
)
target_include_directories (_poco_foundation SYSTEM PUBLIC ${LIBRARY_DIR}/Foundation/include)
target_link_libraries (_poco_foundation PRIVATE Poco::Foundation::PCRE zlib)
target_link_libraries (_poco_foundation PRIVATE Poco::Foundation::PCRE ${ZLIB_LIBRARIES})
else ()
add_library (Poco::Foundation UNKNOWN IMPORTED GLOBAL)