blob: 0c7f13dfaf13dddfa9a0aba1a72de930e5d03084 [file] [log] [blame]
James E. King IIIc9ac8d22019-01-07 16:46:45 -05001#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
19
20set(BOOST_MINREV 1.53)
21
22macro(REQUIRE_BOOST_HEADERS)
23 find_package(Boost ${BOOST_MINREV} QUIET REQUIRED)
24 if (NOT Boost_FOUND)
25 string(CONCAT fatal_message
26 "Boost 1.53 or later is required to build sources in ${CMAKE_CURRENT_SOURCE_DIR}")
27 message(FATAL_ERROR, ${fatal_message})
28 endif()
29 include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
30endmacro()
31
32macro(REQUIRE_BOOST_LIBRARIES libs)
33 message(STATUS "Locating boost libraries required by sources in ${CMAKE_CURRENT_SOURCE_DIR}")
34 find_package(Boost ${BOOST_MINREV} REQUIRED COMPONENTS ${${libs}})
35 if (NOT Boost_FOUND)
36 string(CONCAT fatal_message
37 "Boost 1.53 or later is required to build sources in ${CMAKE_CURRENT_SOURCE_DIR}, "
38 "or use -DBUILD_TESTING=OFF")
39 message(FATAL_ERROR, ${fatal_message})
40 endif()
41endmacro()