2017-02-28 23:49:04 +00:00
|
|
|
option (USE_INTERNAL_BOOST_LIBRARY "Set to FALSE to use system boost library instead of bundled" ${NOT_UNBUNDLED})
|
|
|
|
|
2018-03-02 20:01:54 +00:00
|
|
|
# Test random file existing in all package variants
|
2019-05-15 17:19:39 +00:00
|
|
|
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/boost/libs/system/src/error_code.cpp")
|
|
|
|
if(USE_INTERNAL_BOOST_LIBRARY)
|
|
|
|
message(WARNING "submodules in contrib/boost is missing. to fix try run: \n git submodule update --init --recursive")
|
|
|
|
endif()
|
|
|
|
set (USE_INTERNAL_BOOST_LIBRARY 0)
|
|
|
|
set (MISSING_INTERNAL_BOOST_LIBRARY 1)
|
2018-03-02 20:01:54 +00:00
|
|
|
endif ()
|
|
|
|
|
2017-02-07 21:28:13 +00:00
|
|
|
if (NOT USE_INTERNAL_BOOST_LIBRARY)
|
2017-04-01 07:20:54 +00:00
|
|
|
set (Boost_USE_STATIC_LIBS ${USE_STATIC_LIBRARIES})
|
|
|
|
set (BOOST_ROOT "/usr/local")
|
2019-02-19 20:51:44 +00:00
|
|
|
find_package (Boost 1.60 COMPONENTS program_options system filesystem thread regex)
|
2017-04-01 07:20:54 +00:00
|
|
|
# incomplete, no include search, who use it?
|
|
|
|
if (NOT Boost_FOUND)
|
|
|
|
# # Try to find manually.
|
|
|
|
# set (BOOST_PATHS "")
|
|
|
|
# find_library (Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options PATHS ${BOOST_PATHS})
|
|
|
|
# find_library (Boost_SYSTEM_LIBRARY boost_system PATHS ${BOOST_PATHS})
|
2018-03-02 20:01:54 +00:00
|
|
|
# find_library (Boost_FILESYSTEM_LIBRARY boost_filesystem PATHS ${BOOST_PATHS})
|
2017-04-01 07:20:54 +00:00
|
|
|
# maybe found but incorrect version.
|
|
|
|
set (Boost_INCLUDE_DIRS "")
|
|
|
|
set (Boost_SYSTEM_LIBRARY "")
|
|
|
|
endif ()
|
2016-12-06 13:35:28 +00:00
|
|
|
endif ()
|
2017-01-13 11:25:44 +00:00
|
|
|
|
2019-05-15 17:19:39 +00:00
|
|
|
if (NOT Boost_SYSTEM_LIBRARY AND NOT MISSING_INTERNAL_BOOST_LIBRARY)
|
2017-04-01 07:20:54 +00:00
|
|
|
set (USE_INTERNAL_BOOST_LIBRARY 1)
|
|
|
|
set (Boost_SYSTEM_LIBRARY boost_system_internal)
|
2018-08-21 23:57:59 +00:00
|
|
|
set (Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options_internal)
|
|
|
|
set (Boost_FILESYSTEM_LIBRARY boost_filesystem_internal ${Boost_SYSTEM_LIBRARY})
|
2020-01-08 09:13:12 +00:00
|
|
|
set (Boost_IOSTREAMS_LIBRARY boost_iostreams_internal)
|
2019-02-19 20:51:44 +00:00
|
|
|
set (Boost_REGEX_LIBRARY boost_regex_internal)
|
2018-03-02 20:01:54 +00:00
|
|
|
|
|
|
|
set (Boost_INCLUDE_DIRS)
|
|
|
|
|
2019-02-19 20:51:44 +00:00
|
|
|
set (BOOST_ROOT "${ClickHouse_SOURCE_DIR}/contrib/boost")
|
|
|
|
|
2018-03-02 20:01:54 +00:00
|
|
|
# For boost from github:
|
|
|
|
file (GLOB Boost_INCLUDE_DIRS_ "${ClickHouse_SOURCE_DIR}/contrib/boost/libs/*/include")
|
|
|
|
list (APPEND Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS_})
|
|
|
|
# numeric has additional level
|
|
|
|
file (GLOB Boost_INCLUDE_DIRS_ "${ClickHouse_SOURCE_DIR}/contrib/boost/libs/numeric/*/include")
|
|
|
|
list (APPEND Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS_})
|
|
|
|
|
|
|
|
# For packaged version:
|
|
|
|
list (APPEND Boost_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/boost")
|
2017-02-06 20:30:19 +00:00
|
|
|
endif ()
|
2017-01-13 11:25:44 +00:00
|
|
|
|
2020-01-08 09:13:12 +00:00
|
|
|
message (STATUS "Using Boost: ${Boost_INCLUDE_DIRS} : ${Boost_PROGRAM_OPTIONS_LIBRARY},${Boost_SYSTEM_LIBRARY},${Boost_FILESYSTEM_LIBRARY},${Boost_IOSTREAMS_LIBRARY},${Boost_REGEX_LIBRARY}")
|