function( found_status )
  if( ${${ARGV1}} )
    set( found_str "Found" )
    if( ${ARGC} EQUAL 4 AND NOT ${ARGV3} EQUAL "" )
      set( version_str "(${ARGV2}${ARGV3})" )
    elseif( ${ARGC} EQUAL 3 AND NOT ${ARGV2} EQUAL "" )
      set( version_str "(${ARGV2})" )
    endif()
  else()
    set( found_str "Not Found" )
  endif()
  set( fill_len   25 )
  set( padded_len 25 )
  string( RANDOM LENGTH ${fill_len} ALPHABET " " fill_str )
  string( SUBSTRING "${ARGV0}:${fill_str}" 0 ${padded_len} padded_str )
  message( STATUS "   ${padded_str}${found_str} ${version_str}" )
endfunction()

function( message_status )
  set( fill_len   25 )
  set( padded_len 25 )
  string( RANDOM LENGTH ${fill_len} ALPHABET " " fill_str )
  string( SUBSTRING "${ARGV0}:${fill_str}" 0 ${padded_len} padded_str )
  message( STATUS "   ${padded_str}${ARGV1}" )
endfunction()

function( print_faodel_config_summary )
  message( STATUS "" )
  message( STATUS "======================================================================" )
  message( STATUS "" )
  message( STATUS "Configured to build Faodel with ${CMAKE_MAKE_PROGRAM}" )
  if( CMAKE_INSTALL_PREFIX )
    message( STATUS "Installation prefix is ${CMAKE_INSTALL_PREFIX}" )
  endif()
  message( STATUS "" )
  message( STATUS "External Programs:" )
  message_status( "compiler"  "${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER_VERSION})" )
  found_status( "doxygen"     DOXYGEN_FOUND "v" "${DOXYGEN_VERSION}" )
  message( STATUS "" )
  message( STATUS "TPLs:" )
  found_status( "Boost"       Boost_FOUND "v" "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}" )
  found_status( "MPI"         MPI_FOUND "implements MPI-" "${MPI_C_VERSION}" )
  found_status( "googletest"  GTest_FOUND )
  if (Faodel_NETWORK_LIBRARY STREQUAL "libfabric")
    found_status( "libfabric"   LIBFABRIC_FOUND "v" "${Libfabric_pc_VERSION}" )
  endif()
  if (Faodel_NETWORK_LIBRARY STREQUAL "nnti")
    found_status( "libugni"     UGNI_FOUND "v" "${UGNI_PC_VERSION}" )
    found_status( "Cray DRC"    DRC_FOUND )
    found_status( "ibverbs"     IBVerbs_FOUND )
  endif()
  message( STATUS "" )
  message( STATUS "Faodel Common Config:" )
  message( STATUS "   Threading Model:         ${Faodel_THREADING_MODEL}" )
  message( STATUS "   Logging Method:          ${Faodel_LOGGING_METHOD}" )
  message( STATUS "" )
  message( STATUS "Lunasa Config:" )
  if ( ${Faodel_ENABLE_TCMALLOC} )
    message( STATUS "   Building with tcmalloc from gperftools" )
  endif()
  message( STATUS "" )
  message( STATUS "NNTI Config:" )
  if( ${NNTI_BUILD_IBVERBS} )
    if( ${NNTI_HAVE_VERBS_EXP_H} )
      message( STATUS "   Building the IBVerbs Transport with the libverbs expanded API (mlx4 or mlx5)" )
    else()
      message( STATUS "   Building the IBVerbs Transport with the libverbs standard API (mlx4 ONLY)" )
    endif()
  else()
    if( ${NNTI_DISABLE_IBVERBS_TRANSPORT} )
      message( STATUS "   IBVerbs Transport explicitly disabled" )
    else()
      message( STATUS "   Not building the IBVerbs Transport" )
    endif()
  endif()
  if( ${NNTI_BUILD_UGNI} )
    message( STATUS "   Building the UGNI Transport" )
  else()
    if( ${NNTI_DISABLE_UGNI_TRANSPORT} )
      message( STATUS "   UGNI Transport explicitly disabled" )
    else()
      message( STATUS "   Not building the UGNI Transport" )
    endif()
  endif()
  if( ${NNTI_BUILD_MPI} )
    message( STATUS "   Building the MPI Transport" )
  else()
    if( ${NNTI_DISABLE_MPI_TRANSPORT} )
      message( STATUS "   MPI Transport explicitly disabled" )
    else()
      message( STATUS "   Not building the MPI Transport" )
    endif()
  endif()
  if( ${NNTI_USE_XDR} )
    message( STATUS "   Using XDR for serialization" )
  else()
    if( ${NNTI_USE_CEREAL} )
      message( STATUS "   Using Cereal for serialization" )
    else()
      message( STATUS "   ERROR - Couldn't find a serialization library" )
    endif()
  endif()
  message( STATUS "" )
  message( STATUS "Opbox Config:" )
  message( STATUS "   Network Library:         ${Faodel_NETWORK_LIBRARY}" )
  message( STATUS "" )
  message( STATUS "======================================================================" )
  message( STATUS "" )
  message( STATUS "" )
endfunction()
