CodeCommitsIssuesPull requestsActionsInsightsSecurity
8349d2b9a0b041e3f34ac3221fbec6569ec72ad4

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

cmake/find_boost.cmake

47lines · modecode

1option (USE_INTERNAL_BOOST_LIBRARY "Set to FALSE to use system boost library instead of bundled" ${NOT_UNBUNDLED})
2
3# Test random file existing in all package variants
4if (USE_INTERNAL_BOOST_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/boost/libs/system/src/error_code.cpp")
5 message (WARNING "submodules in contrib/boost is missing. to fix try run: \n git submodule update --init --recursive")
6 set (USE_INTERNAL_BOOST_LIBRARY 0)
7endif ()
8
9if (NOT USE_INTERNAL_BOOST_LIBRARY)
10 set (Boost_USE_STATIC_LIBS ${USE_STATIC_LIBRARIES})
11 set (BOOST_ROOT "/usr/local")
12 find_package (Boost 1.60 COMPONENTS program_options system filesystem thread)
13 # incomplete, no include search, who use it?
14 if (NOT Boost_FOUND)
15 # # Try to find manually.
16 # set (BOOST_PATHS "")
17 # find_library (Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options PATHS ${BOOST_PATHS})
18 # find_library (Boost_SYSTEM_LIBRARY boost_system PATHS ${BOOST_PATHS})
19 # find_library (Boost_FILESYSTEM_LIBRARY boost_filesystem PATHS ${BOOST_PATHS})
20 # maybe found but incorrect version.
21 set (Boost_INCLUDE_DIRS "")
22 set (Boost_SYSTEM_LIBRARY "")
23 endif ()
24
25endif ()
26
27if (NOT Boost_SYSTEM_LIBRARY)
28 set (USE_INTERNAL_BOOST_LIBRARY 1)
29 set (Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options_internal)
30 set (Boost_SYSTEM_LIBRARY boost_system_internal)
31 set (Boost_FILESYSTEM_LIBRARY boost_filesystem_internal)
32
33 set (Boost_INCLUDE_DIRS)
34
35 # For boost from github:
36 file (GLOB Boost_INCLUDE_DIRS_ "${ClickHouse_SOURCE_DIR}/contrib/boost/libs/*/include")
37 list (APPEND Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS_})
38 # numeric has additional level
39 file (GLOB Boost_INCLUDE_DIRS_ "${ClickHouse_SOURCE_DIR}/contrib/boost/libs/numeric/*/include")
40 list (APPEND Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS_})
41
42 # For packaged version:
43 list (APPEND Boost_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/boost")
44
45endif ()
46
47message (STATUS "Using Boost: ${Boost_INCLUDE_DIRS} : ${Boost_PROGRAM_OPTIONS_LIBRARY},${Boost_SYSTEM_LIBRARY},${Boost_FILESYSTEM_LIBRARY}")