Skip to content

Commit

Permalink
Disable all status messages unless Boost_VERBOSE is set
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Apr 18, 2019
1 parent 3880d50 commit 4bf56cc
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 31 deletions.
61 changes: 35 additions & 26 deletions BoostConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,42 +39,51 @@
# Boost_PYTHON_VERSION: The version of Python against which Boost.Python
# has been built; only required when more than one
# Boost.Python library is present.
#
# The following variables control the verbosity of the output:
#
# Boost_VERBOSE: Enable verbose output
# Boost_DEBUG: Enable debug (even more verbose) output

message(STATUS "Found Boost ${Boost_VERSION} at ${Boost_DIR}")
if(Boost_VERBOSE OR Boost_DEBUG)

# Output requested configuration (f.ex. "REQUIRED COMPONENTS filesystem")
message(STATUS "Found Boost ${Boost_VERSION} at ${Boost_DIR}")

if(Boost_FIND_QUIETLY)
set(_BOOST_CONFIG "${_BOOST_CONFIG} QUIET")
endif()
# Output requested configuration (f.ex. "REQUIRED COMPONENTS filesystem")

if(Boost_FIND_REQUIRED)
set(_BOOST_CONFIG "${_BOOST_CONFIG} REQUIRED")
endif()
if(Boost_FIND_QUIETLY)
set(_BOOST_CONFIG "${_BOOST_CONFIG} QUIET")
endif()

foreach(__boost_comp IN LISTS Boost_FIND_COMPONENTS)
if(${Boost_FIND_REQUIRED_${__boost_comp}})
list(APPEND _BOOST_COMPONENTS ${__boost_comp})
else()
list(APPEND _BOOST_OPTIONAL_COMPONENTS ${__boost_comp})
if(Boost_FIND_REQUIRED)
set(_BOOST_CONFIG "${_BOOST_CONFIG} REQUIRED")
endif()
endforeach()

if(_BOOST_COMPONENTS)
set(_BOOST_CONFIG "${_BOOST_CONFIG} COMPONENTS ${_BOOST_COMPONENTS}")
endif()
foreach(__boost_comp IN LISTS Boost_FIND_COMPONENTS)
if(${Boost_FIND_REQUIRED_${__boost_comp}})
list(APPEND _BOOST_COMPONENTS ${__boost_comp})
else()
list(APPEND _BOOST_OPTIONAL_COMPONENTS ${__boost_comp})
endif()
endforeach()

if(_BOOST_OPTIONAL_COMPONENTS)
set(_BOOST_CONFIG "${_BOOST_CONFIG} OPTIONAL_COMPONENTS ${_BOOST_OPTIONAL_COMPONENTS}")
endif()
if(_BOOST_COMPONENTS)
set(_BOOST_CONFIG "${_BOOST_CONFIG} COMPONENTS ${_BOOST_COMPONENTS}")
endif()

if(_BOOST_CONFIG)
message(STATUS " Requested configuration:${_BOOST_CONFIG}")
endif()
if(_BOOST_OPTIONAL_COMPONENTS)
set(_BOOST_CONFIG "${_BOOST_CONFIG} OPTIONAL_COMPONENTS ${_BOOST_OPTIONAL_COMPONENTS}")
endif()

unset(_BOOST_CONFIG)
unset(_BOOST_COMPONENTS)
unset(_BOOST_OPTIONAL_COMPONENTS)
if(_BOOST_CONFIG)
message(STATUS " Requested configuration:${_BOOST_CONFIG}")
endif()

unset(_BOOST_CONFIG)
unset(_BOOST_COMPONENTS)
unset(_BOOST_OPTIONAL_COMPONENTS)

endif()

# find_dependency doesn't forward arguments until 3.9, so we have to roll our own

Expand Down
18 changes: 13 additions & 5 deletions boost-install.jam
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ rule generate-cmake-variant- ( target : sources * : properties * )

print.text

"message(STATUS \" $(fname)\")"
"if(Boost_VERBOSE OR Boost_DEBUG)"
" message(STATUS \" $(fname)\")"
"endif()"
""
: true ;

Expand Down Expand Up @@ -525,7 +527,9 @@ rule generate-cmake-config- ( target : sources * : properties * )
" return()"
"endif()"
""
"message(STATUS \"Found $(name) ${$(name)_VERSION} at ${$(name)_DIR}\")"
"if(Boost_VERBOSE OR Boost_DEBUG)"
" message(STATUS \"Found $(name) ${$(name)_VERSION} at ${$(name)_DIR}\")"
"endif()"
""
"# Compute the include and library directories relative to this file."
"get_filename_component(_BOOST_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" ABSOLUTE)"
Expand Down Expand Up @@ -580,8 +584,10 @@ rule generate-cmake-config- ( target : sources * : properties * )
"get_target_property(__boost_configs $(ltarget) IMPORTED_CONFIGURATIONS)"
""
"if(__boost_variants AND NOT __boost_configs)"
" message(STATUS \"No suitable $(name) variant has been identified!\")"
" if(NOT Boost_DEBUG)"
" if(Boost_VERBOSE OR Boost_DEBUG)"
" message(STATUS \"No suitable $(name) variant has been identified!\")"
" endif()"
" if(Boost_VERBOSE AND NOT Boost_DEBUG)"
" foreach(s IN LISTS __boost_skipped)"
" message(STATUS \" ${s}\")"
" endforeach()"
Expand All @@ -601,7 +607,9 @@ rule generate-cmake-config- ( target : sources * : properties * )
""
"if(_BOOST_$(lname:U)_DEPS)"
" list(REMOVE_DUPLICATES _BOOST_$(lname:U)_DEPS)"
" message(STATUS \"Adding $(name) dependencies: ${_BOOST_$(lname:U)_DEPS}\")"
" if(Boost_VERBOSE OR Boost_DEBUG)"
" message(STATUS \"Adding $(name) dependencies: ${_BOOST_$(lname:U)_DEPS}\")"
" endif()"
"endif()"
""
"foreach(dep_$(name) IN LISTS _BOOST_$(lname:U)_DEPS")
Expand Down

0 comments on commit 4bf56cc

Please sign in to comment.