Now that I use my own copy in K3b I changed it a bit again. Just in case that 
anyone is interested I attach the new version.

Cheers,
Sebastian

On Thursday 19 February 2009 23:57:54 Loïc Corbasson wrote:
> On Thu, Feb 19, 2009 at 21:24, Alexander Neundorf <[email protected]> wrote:
> > On Thursday 19 February 2009, Sebastian Trüg wrote:
> > > On Thursday 19 February 2009 18:23:01 Sebastian Trüg wrote:
> > > > > I agree with Allen -- when I compile a module, the information "you
> >
> > are
> >
> > > > > missing this and that" is much more important than the information
> > > > > "I found this and that". For the missing stuff I might have to take
> > > > > action. For the found stuff there is no problem, so there is little
> > > > > point in filling 3 screens with "I found this and that, so you'll
> > > > > get such and such features"... we don't list the features that one
> > > > > gets
> >
> > in
> >
> > > > > all cases, either
> > > > >
> > > > > :-) I think all that's needed is a short confirmation that "foo"
> > > > > : was found
> > > > >
> > > > > after you installed it.
> > > >
> > > > well, OK then. I will just use my own local copy for K3b then,
> > > > because frankly, I really don't like the output as it is now.
> > >
> > > Sorry, this sounds way to aggressive. And that was not my intention.
> > > What
> >
> > I
> >
> > > should have written is:
> >
> > No problem.
> > Actually I agree with you, and also also agree that your version looks
> > nicer.
> > But one of the things was that there should be only one line per package,
> > so
> > it's easy to grep for stuff.
> > And it's also correct that the things which were found shouldn't take too
> > much
> > space.
> >
> > Alex
>
> How about making this an option then, that you can switch on and off, and
> which is non-verbose like today as a default? I too like Sebastian's work
> and find it very useful -- but I understand that it doesn't fit all use
> cases, e.g. making grepping difficult.
>
> Cheers,
> Loïc

# This file defines the Feature Logging macros.
#
# MACRO_LOG_FEATURE(VAR FEATURE DESCRIPTION URL [REQUIRED [MIN_VERSION [COMMENTS]]])
#   Logs the information so that it can be displayed at the end
#   of the configure run
#   VAR : TRUE or FALSE, indicating whether the feature is supported
#   FEATURE: name of the feature, e.g. "libjpeg"
#   DESCRIPTION: description what this feature provides
#   URL: home page
#   REQUIRED: TRUE or FALSE, indicating whether the featue is required
#   MIN_VERSION: minimum version number. empty string if unneeded
#   COMMENTS: More info you may want to provide.  empty string if unnecessary
#
# MACRO_DISPLAY_FEATURE_LOG()
#   Call this to display the collected results.
#   Exits CMake with a FATAL error message if a required feature is missing
#
# Example:
#
# INCLUDE(MacroLogFeature)
#
# FIND_PACKAGE(JPEG)
# MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "Support JPEG images" "http://www.ijg.org"; TRUE "3.2a" "")
# ...
# MACRO_DISPLAY_FEATURE_LOG()

# Copyright (c) 2006, Alexander Neundorf, <[email protected]>
# Copyright (c) 2006, Allen Winter, <[email protected]>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

IF (NOT _macroLogFeatureAlreadyIncluded)
   SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
   IF (EXISTS ${_file})
      FILE(REMOVE ${_file})
   ENDIF (EXISTS ${_file})

   SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
   IF (EXISTS ${_file})
      FILE(REMOVE ${_file})
   ENDIF (EXISTS ${_file})

   SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
   IF (EXISTS ${_file})
      FILE(REMOVE ${_file})
  ENDIF (EXISTS ${_file})

  SET(_macroLogFeatureAlreadyIncluded TRUE)
ENDIF (NOT _macroLogFeatureAlreadyIncluded)


MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _comments)

   SET(_required "${ARGV4}")
   SET(_minvers "${ARGV5}")
   SET(_comments "${ARGV6}")

   IF (${_var})
     SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
   ELSE (${_var})
     IF (${_required} MATCHES "[Tt][Rr][Uu][Ee]")
       SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
     ELSE (${_required} MATCHES "[Tt][Rr][Uu][Ee]")
       SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
     ENDIF (${_required} MATCHES "[Tt][Rr][Uu][Ee]")
   ENDIF (${_var})

   SET(_logtext "   * ${_package}")

   IF (NOT ${_var})
      IF (${_minvers} MATCHES ".*")
        SET(_logtext "${_logtext} (${_minvers} or higher)")
      ENDIF (${_minvers} MATCHES ".*")
      SET(_logtext "${_logtext}  <${_url}>")
   ENDIF (NOT ${_var})

   SET(_logtext "${_logtext}\n     ${_description}")

   IF (NOT ${_var})
      IF (${_comments} MATCHES ".*")
        SET(_logtext "${_logtext}\n     ${_comments}")
      ENDIF (${_comments} MATCHES ".*")
#      SET(_logtext "${_logtext}\n") #double-space missing features?
   ENDIF (NOT ${_var})

   FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n")
 
ENDMACRO(MACRO_LOG_FEATURE)


MACRO(MACRO_DISPLAY_FEATURE_LOG)

   SET(_missingFile ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
   SET(_enabledFile ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
   SET(_disabledFile ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)

   IF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})
     SET(_printSummary TRUE)
   ENDIF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})

   IF(_printSummary)
     IF (EXISTS ${_missingFile})
       FILE(READ ${_missingFile} _requirements)
       SET(_summary "\n-----------------------------------------------------------------------------\n-- The following REQUIRED dependencies could NOT be found.\n-----------------------------------------------------------------------------\n${_requirements}")
       FILE(REMOVE ${_missingFile})
       SET(_haveMissingReq 1)
     ENDIF (EXISTS ${_missingFile})

     SET(_elist 0)
     IF (EXISTS ${_enabledFile})
       SET(_elist 1)
       FILE(READ ${_enabledFile} _enabled)
       FILE(REMOVE ${_enabledFile})
       SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following dependencies were found.\n-----------------------------------------------------------------------------\n${_enabled}")
     ENDIF (EXISTS ${_enabledFile})

     SET(_dlist 0)
     IF (EXISTS ${_disabledFile})
       SET(_dlist 1)
       FILE(READ ${_disabledFile} _disabled)
       FILE(REMOVE ${_disabledFile})
       SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following OPTIONAL dependencies could NOT be found.\n-----------------------------------------------------------------------------\n${_disabled}")
     ELSE (EXISTS ${_disabledFile})
       IF (${_elist})
         SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- Congratulations! All external packages have been found.")
       ENDIF (${_elist})
     ENDIF (EXISTS ${_disabledFile})

     MESSAGE(${_summary})
     MESSAGE("-----------------------------------------------------------------------------\n")

     IF(_haveMissingReq)
       MESSAGE(FATAL_ERROR "Exiting: Missing Requirements")
     ENDIF(_haveMissingReq)
   ENDIF(_printSummary)

ENDMACRO(MACRO_DISPLAY_FEATURE_LOG)
_______________________________________________
Kde-buildsystem mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-buildsystem

Reply via email to