1# Copyright 2019 Peter Dimov 2# Distributed under the Boost Software License, Version 1.0. 3# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt 4 5if(NOT CMAKE_VERSION VERSION_LESS 3.10) 6 include_guard() 7endif() 8 9# boost_message( 10# [FATAL_ERROR|SEND_ERROR|WARNING|AUTHOR_WARNING|DEPRECATION|NOTICE|STATUS 11# |VERBOSE|DEBUG] 12# messages...) 13 14function(boost_message type) 15 16 if(type STREQUAL "VERBOSE") 17 if(Boost_VERBOSE OR Boost_DEBUG) 18 set(type STATUS) 19 elseif(CMAKE_VERSION VERSION_LESS 3.15) 20 return() 21 endif() 22 endif() 23 24 if(type STREQUAL "DEBUG") 25 if(Boost_DEBUG) 26 set(type STATUS) 27 elseif(CMAKE_VERSION VERSION_LESS 3.15) 28 return() 29 endif() 30 endif() 31 32 if(type STREQUAL "NOTICE" AND CMAKE_VERSION VERSION_LESS 3.15) 33 set(type "") 34 endif() 35 36 set(m "") 37 math(EXPR last "${ARGC}-1") 38 39 foreach(i RANGE 1 ${last}) 40 string(APPEND m "${ARGV${i}}") 41 endforeach() 42 43 message(${type} "${m}") 44 45endfunction() 46