2022-01-17 19:42:00 +00:00
|
|
|
#"${folder}/CMakeLists.txt" Third-party libraries may have substandard code.
|
2018-07-30 20:36:23 +00:00
|
|
|
|
2021-04-28 22:16:45 +00:00
|
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
|
2016-08-25 21:55:02 +00:00
|
|
|
|
2020-12-23 12:31:18 +00:00
|
|
|
if (WITH_COVERAGE)
|
2020-12-24 13:06:32 +00:00
|
|
|
set (WITHOUT_COVERAGE_LIST ${WITHOUT_COVERAGE})
|
|
|
|
separate_arguments(WITHOUT_COVERAGE_LIST)
|
|
|
|
# disable coverage for contib files and build with optimisations
|
2021-01-07 16:38:58 +00:00
|
|
|
if (COMPILER_CLANG)
|
|
|
|
add_compile_options(-O3 -DNDEBUG -finline-functions -finline-hint-functions ${WITHOUT_COVERAGE_LIST})
|
|
|
|
endif()
|
2020-12-23 12:31:18 +00:00
|
|
|
endif()
|
|
|
|
|
2020-11-06 17:52:28 +00:00
|
|
|
if (SANITIZE STREQUAL "undefined")
|
|
|
|
# 3rd-party libraries usually not intended to work with UBSan.
|
|
|
|
add_compile_options(-fno-sanitize=undefined)
|
|
|
|
endif()
|
|
|
|
|
2019-02-04 14:07:01 +00:00
|
|
|
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1)
|
|
|
|
|
2022-01-18 07:52:32 +00:00
|
|
|
# add_contrib cmake_folder[ base_folder1[, ...base_folderN]]
|
|
|
|
function(add_contrib cmake_folder)
|
|
|
|
if (ARGN)
|
|
|
|
set(base_folders ${ARGN})
|
2022-01-18 06:48:25 +00:00
|
|
|
else()
|
2022-01-18 07:52:32 +00:00
|
|
|
set(base_folders ${cmake_folder})
|
2019-03-22 11:18:24 +00:00
|
|
|
endif()
|
2021-03-29 13:09:50 +00:00
|
|
|
|
2022-01-18 07:52:32 +00:00
|
|
|
foreach (base_folder ${base_folders})
|
|
|
|
# some typos in the code
|
|
|
|
if (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${base_folder}")
|
|
|
|
message(FATAL_ERROR "No such base folder '${base_folder}' (for '${cmake_folder}' cmake folder). Typo in the base folder name?")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(GLOB contrib_files "${base_folder}/*")
|
|
|
|
if (NOT contrib_files)
|
2022-06-23 11:38:25 +00:00
|
|
|
# Checking out *all* submodules takes > 5 min. Therefore, the smoke build ("FastTest") in CI initializes only the set of
|
|
|
|
# submodules minimally needed for a build and we cannot assume here that all submodules are populated.
|
2022-01-18 07:52:32 +00:00
|
|
|
message(STATUS "submodule ${base_folder} is missing or empty. to fix try run:")
|
|
|
|
message(STATUS " git submodule update --init")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
message(STATUS "Adding contrib module ${base_folders} (configuring with ${cmake_folder})")
|
|
|
|
add_subdirectory (${cmake_folder})
|
2021-09-09 19:41:26 +00:00
|
|
|
endfunction()
|
2022-12-06 22:17:53 +00:00
|
|
|
if (ENABLE_OPENSSL OR ENABLE_OPENSSL_DYNAMIC)
|
|
|
|
add_contrib (openssl-cmake openssl)
|
|
|
|
else ()
|
|
|
|
add_contrib (boringssl-cmake boringssl)
|
|
|
|
endif ()
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (miniselect-cmake miniselect)
|
|
|
|
add_contrib (pdqsort-cmake pdqsort)
|
2023-01-11 04:56:16 +00:00
|
|
|
add_contrib (crc32-vpmsum-cmake crc32-vpmsum)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (sparsehash-c11-cmake sparsehash-c11)
|
|
|
|
add_contrib (abseil-cpp-cmake abseil-cpp)
|
|
|
|
add_contrib (magic-enum-cmake magic_enum)
|
|
|
|
add_contrib (boost-cmake boost)
|
|
|
|
add_contrib (cctz-cmake cctz)
|
2022-01-18 06:48:25 +00:00
|
|
|
add_contrib (consistent-hashing)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (dragonbox-cmake dragonbox)
|
2022-06-17 10:15:19 +00:00
|
|
|
add_contrib (vectorscan-cmake vectorscan)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (jemalloc-cmake jemalloc)
|
|
|
|
add_contrib (libcpuid-cmake libcpuid)
|
2022-12-11 18:57:30 +00:00
|
|
|
add_contrib (libdivide-cmake)
|
2022-01-18 06:48:25 +00:00
|
|
|
add_contrib (libmetrohash)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (lz4-cmake lz4)
|
2022-01-18 06:48:25 +00:00
|
|
|
add_contrib (murmurhash)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (replxx-cmake replxx)
|
|
|
|
add_contrib (unixodbc-cmake unixodbc)
|
|
|
|
add_contrib (nanodbc-cmake nanodbc)
|
|
|
|
add_contrib (capnproto-cmake capnproto)
|
|
|
|
add_contrib (yaml-cpp-cmake yaml-cpp)
|
|
|
|
add_contrib (re2-cmake re2)
|
|
|
|
add_contrib (xz-cmake xz)
|
|
|
|
add_contrib (brotli-cmake brotli)
|
|
|
|
add_contrib (double-conversion-cmake double-conversion)
|
|
|
|
add_contrib (croaring-cmake croaring)
|
|
|
|
add_contrib (zstd-cmake zstd)
|
|
|
|
add_contrib (zlib-ng-cmake zlib-ng)
|
|
|
|
add_contrib (bzip2-cmake bzip2)
|
2022-01-28 17:31:50 +00:00
|
|
|
add_contrib (minizip-ng-cmake minizip-ng)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (snappy-cmake snappy)
|
|
|
|
add_contrib (rocksdb-cmake rocksdb)
|
|
|
|
add_contrib (thrift-cmake thrift)
|
2022-01-16 19:37:27 +00:00
|
|
|
# parquet/arrow/orc
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (arrow-cmake arrow) # requires: snappy, thrift, double-conversion
|
|
|
|
add_contrib (avro-cmake avro) # requires: snappy
|
2022-01-18 19:34:22 +00:00
|
|
|
add_contrib (protobuf-cmake protobuf)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (openldap-cmake openldap)
|
|
|
|
add_contrib (grpc-cmake grpc)
|
|
|
|
add_contrib (msgpack-c-cmake msgpack-c)
|
2022-08-01 18:31:38 +00:00
|
|
|
|
2022-09-16 17:54:46 +00:00
|
|
|
add_contrib (corrosion-cmake corrosion)
|
2020-12-10 00:36:31 +00:00
|
|
|
|
2022-01-17 18:45:53 +00:00
|
|
|
if (ENABLE_FUZZING)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (libprotobuf-mutator-cmake libprotobuf-mutator)
|
2022-01-17 18:45:53 +00:00
|
|
|
endif()
|
|
|
|
|
2022-04-20 23:26:37 +00:00
|
|
|
add_contrib (wyhash-cmake wyhash)
|
2022-01-18 06:48:25 +00:00
|
|
|
add_contrib (cityhash102)
|
|
|
|
add_contrib (libfarmhash)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (icu-cmake icu)
|
|
|
|
add_contrib (h3-cmake h3)
|
|
|
|
add_contrib (mariadb-connector-c-cmake mariadb-connector-c)
|
2023-04-25 20:07:04 +00:00
|
|
|
add_contrib (libfiu-cmake libfiu)
|
2018-08-02 00:49:31 +00:00
|
|
|
|
2022-01-17 20:26:05 +00:00
|
|
|
if (ENABLE_TESTS)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (googletest-cmake googletest)
|
2019-01-25 20:12:15 +00:00
|
|
|
endif()
|
2018-11-16 12:22:51 +00:00
|
|
|
|
2022-09-26 05:43:14 +00:00
|
|
|
add_contrib (llvm-project-cmake llvm-project)
|
2022-10-21 14:04:01 +00:00
|
|
|
add_contrib (libfuzzer-cmake llvm-project)
|
2023-01-12 14:00:26 +00:00
|
|
|
add_contrib (gwpasan-cmake llvm-project)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (libxml2-cmake libxml2)
|
2022-11-21 21:29:40 +00:00
|
|
|
|
|
|
|
add_contrib (aws-cmake
|
2022-01-18 07:52:32 +00:00
|
|
|
aws
|
2022-11-21 21:29:40 +00:00
|
|
|
aws-c-auth
|
|
|
|
aws-c-cal
|
2022-01-18 07:52:32 +00:00
|
|
|
aws-c-common
|
2022-11-21 21:29:40 +00:00
|
|
|
aws-c-compression
|
2022-01-18 07:52:32 +00:00
|
|
|
aws-c-event-stream
|
2022-11-21 21:29:40 +00:00
|
|
|
aws-c-http
|
|
|
|
aws-c-io
|
|
|
|
aws-c-mqtt
|
|
|
|
aws-c-s3
|
|
|
|
aws-c-sdkutils
|
|
|
|
aws-s2n-tls
|
2022-01-18 07:52:32 +00:00
|
|
|
aws-checksums
|
2022-11-21 21:29:40 +00:00
|
|
|
aws-crt-cpp
|
|
|
|
aws-cmake
|
2022-01-18 07:52:32 +00:00
|
|
|
)
|
2022-11-21 21:29:40 +00:00
|
|
|
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (base64-cmake base64)
|
2023-05-04 19:48:46 +00:00
|
|
|
if (NOT ARCH_S390X)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (simdjson-cmake simdjson)
|
2023-05-04 19:48:46 +00:00
|
|
|
endif()
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (rapidjson-cmake rapidjson)
|
|
|
|
add_contrib (fastops-cmake fastops)
|
|
|
|
add_contrib (libuv-cmake libuv)
|
2022-06-27 08:38:00 +00:00
|
|
|
add_contrib (liburing-cmake liburing)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (amqpcpp-cmake AMQP-CPP) # requires: libuv
|
|
|
|
add_contrib (cassandra-cmake cassandra) # requires: libuv
|
2023-05-01 20:37:33 +00:00
|
|
|
if (NOT OS_DARWIN)
|
2022-04-06 13:28:35 +00:00
|
|
|
add_contrib (curl-cmake curl)
|
|
|
|
add_contrib (azure-cmake azure)
|
|
|
|
add_contrib (sentry-native-cmake sentry-native) # requires: curl
|
|
|
|
endif()
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (fmtlib-cmake fmtlib)
|
|
|
|
add_contrib (krb5-cmake krb5)
|
|
|
|
add_contrib (cyrus-sasl-cmake cyrus-sasl) # for krb5
|
2022-01-19 06:16:10 +00:00
|
|
|
add_contrib (libgsasl-cmake libgsasl) # requires krb5
|
|
|
|
add_contrib (librdkafka-cmake librdkafka) # requires: libgsasl
|
2022-05-08 12:12:15 +00:00
|
|
|
add_contrib (nats-io-cmake nats-io)
|
2023-05-01 20:37:33 +00:00
|
|
|
add_contrib (isa-l-cmake isa-l)
|
|
|
|
add_contrib (libhdfs3-cmake libhdfs3) # requires: protobuf, krb5, isa-l
|
2022-01-19 06:16:10 +00:00
|
|
|
add_contrib (hive-metastore-cmake hive-metastore) # requires: thrift/avro/arrow/libhdfs3
|
|
|
|
add_contrib (cppkafka-cmake cppkafka)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (libpqxx-cmake libpqxx)
|
|
|
|
add_contrib (libpq-cmake libpq)
|
|
|
|
add_contrib (nuraft-cmake NuRaft)
|
|
|
|
add_contrib (fast_float-cmake fast_float)
|
|
|
|
add_contrib (datasketches-cpp-cmake datasketches-cpp)
|
2022-05-07 01:25:20 +00:00
|
|
|
add_contrib (hashidsxx-cmake hashidsxx)
|
2021-07-30 13:30:30 +00:00
|
|
|
|
2022-01-18 06:48:23 +00:00
|
|
|
option(ENABLE_NLP "Enable NLP functions support" ${ENABLE_LIBRARIES})
|
2022-01-18 06:48:25 +00:00
|
|
|
if (ENABLE_NLP)
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (libstemmer-c-cmake libstemmer_c)
|
|
|
|
add_contrib (wordnet-blast-cmake wordnet-blast)
|
|
|
|
add_contrib (lemmagen-c-cmake lemmagen-c)
|
2022-01-25 09:54:43 +00:00
|
|
|
add_contrib (nlp-data-cmake nlp-data)
|
|
|
|
add_contrib (cld2-cmake cld2)
|
2022-01-18 06:48:25 +00:00
|
|
|
endif()
|
2020-12-09 23:26:01 +00:00
|
|
|
|
2022-01-18 07:52:32 +00:00
|
|
|
add_contrib (sqlite-cmake sqlite-amalgamation)
|
|
|
|
add_contrib (s2geometry-cmake s2geometry)
|
2022-07-25 13:49:03 +00:00
|
|
|
add_contrib (c-ares-cmake c-ares)
|
2023-05-08 20:43:37 +00:00
|
|
|
|
2023-05-12 13:56:01 +00:00
|
|
|
if (OS_LINUX AND ARCH_AMD64 AND ENABLE_SSE42)
|
2023-05-08 20:43:37 +00:00
|
|
|
option (ENABLE_QPL "Enable Intel® Query Processing Library" ${ENABLE_LIBRARIES})
|
|
|
|
elseif(ENABLE_QPL)
|
2023-05-12 13:56:01 +00:00
|
|
|
message (${RECONFIGURE_MESSAGE_LEVEL} "QPL library is only supported on x86_64 arch with SSE 4.2 or higher")
|
2023-05-08 20:43:37 +00:00
|
|
|
endif()
|
|
|
|
if (ENABLE_QPL)
|
|
|
|
add_contrib (idxd-config-cmake idxd-config)
|
|
|
|
add_contrib (qpl-cmake qpl) # requires: idxd-config
|
|
|
|
else()
|
|
|
|
message(STATUS "Not using QPL")
|
|
|
|
endif ()
|
|
|
|
|
2022-09-25 17:58:00 +00:00
|
|
|
add_contrib (morton-nd-cmake morton-nd)
|
2022-12-01 15:43:32 +00:00
|
|
|
if (ARCH_S390X)
|
|
|
|
add_contrib(crc32-s390x-cmake crc32-s390x)
|
|
|
|
endif()
|
2022-11-25 23:14:08 +00:00
|
|
|
add_contrib (annoy-cmake annoy)
|
|
|
|
add_contrib (xxHash-cmake xxHash)
|
2022-08-30 15:26:56 +00:00
|
|
|
|
2023-01-04 14:22:39 +00:00
|
|
|
add_contrib (libbcrypt-cmake libbcrypt)
|
|
|
|
|
2022-12-08 12:38:08 +00:00
|
|
|
add_contrib (google-benchmark-cmake google-benchmark)
|
2022-12-28 00:54:50 +00:00
|
|
|
add_contrib (ulid-c-cmake ulid-c)
|
|
|
|
|
2021-10-03 16:26:48 +00:00
|
|
|
# Put all targets defined here and in subdirectories under "contrib/<immediate-subdir>" folders in GUI-based IDEs.
|
|
|
|
# Some of third-party projects may override CMAKE_FOLDER or FOLDER property of their targets, so they would not appear
|
|
|
|
# in "contrib/..." as originally planned, so we workaround this by fixing FOLDER properties of all targets manually,
|
|
|
|
# instead of controlling it via CMAKE_FOLDER.
|
|
|
|
|
|
|
|
function (ensure_target_rooted_in _target _folder)
|
2021-11-25 23:04:11 +00:00
|
|
|
# Skip aliases and INTERFACE library targets, since FOLDER property is not available/writable for them.
|
|
|
|
get_target_property (_target_aliased "${_target}" ALIASED_TARGET)
|
2021-10-03 17:07:44 +00:00
|
|
|
get_target_property (_target_type "${_target}" TYPE)
|
2021-11-25 23:04:11 +00:00
|
|
|
if (_target_aliased OR _target_type STREQUAL "INTERFACE_LIBRARY")
|
2021-10-03 17:07:44 +00:00
|
|
|
return ()
|
|
|
|
endif ()
|
|
|
|
|
2021-10-03 16:26:48 +00:00
|
|
|
# Read the original FOLDER property value, if any.
|
|
|
|
get_target_property (_folder_prop "${_target}" FOLDER)
|
|
|
|
|
|
|
|
# Normalize that value, so we avoid possible repetitions in folder names.
|
|
|
|
|
|
|
|
if (NOT _folder_prop)
|
|
|
|
set (_folder_prop "")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (CMAKE_FOLDER AND _folder_prop MATCHES "^${CMAKE_FOLDER}/(.*)\$")
|
|
|
|
set (_folder_prop "${CMAKE_MATCH_1}")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (_folder AND _folder_prop MATCHES "^${_folder}/(.*)\$")
|
|
|
|
set (_folder_prop "${CMAKE_MATCH_1}")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (_folder)
|
|
|
|
set (_folder_prop "${_folder}/${_folder_prop}")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (CMAKE_FOLDER)
|
|
|
|
set (_folder_prop "${CMAKE_FOLDER}/${_folder_prop}")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
# Set the updated FOLDER property value back.
|
|
|
|
set_target_properties ("${_target}" PROPERTIES FOLDER "${_folder_prop}")
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
function (ensure_own_targets_are_rooted_in _dir _folder)
|
|
|
|
get_directory_property (_targets DIRECTORY "${_dir}" BUILDSYSTEM_TARGETS)
|
|
|
|
foreach (_target IN LISTS _targets)
|
|
|
|
ensure_target_rooted_in ("${_target}" "${_folder}")
|
|
|
|
endforeach ()
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
function (ensure_all_targets_are_rooted_in _dir _folder)
|
|
|
|
ensure_own_targets_are_rooted_in ("${_dir}" "${_folder}")
|
|
|
|
|
|
|
|
get_property (_sub_dirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES)
|
|
|
|
foreach (_sub_dir IN LISTS _sub_dirs)
|
|
|
|
ensure_all_targets_are_rooted_in ("${_sub_dir}" "${_folder}")
|
|
|
|
endforeach ()
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
function (organize_ide_folders_2_level _dir)
|
|
|
|
get_filename_component (_dir_name "${_dir}" NAME)
|
|
|
|
ensure_own_targets_are_rooted_in ("${_dir}" "${_dir_name}")
|
|
|
|
|
|
|
|
# Note, that we respect only first two levels of nesting, we don't want to
|
|
|
|
# reorganize target folders further within each third-party dir.
|
|
|
|
|
|
|
|
get_property (_sub_dirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES)
|
|
|
|
foreach (_sub_dir IN LISTS _sub_dirs)
|
|
|
|
get_filename_component (_sub_dir_name "${_sub_dir}" NAME)
|
|
|
|
ensure_all_targets_are_rooted_in ("${_sub_dir}" "${_dir_name}/${_sub_dir_name}")
|
|
|
|
endforeach ()
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
organize_ide_folders_2_level ("${CMAKE_CURRENT_LIST_DIR}")
|