Porting from macro_log_feature without a package to FeatureSummary?

Alexander Neundorf neundorf at kde.org
Fri Sep 16 22:24:44 UTC 2011


On Friday, September 16, 2011 05:07:10 PM Stephen Kelly wrote:
> Alexander Neundorf wrote:
> > On Tuesday, September 13, 2011 08:18:55 PM Stephen Kelly wrote:
> >> Hi,
> >> 
> >> The current feature_summary seems to require a package. Things like this
> >> work:
> >> 
> >> find_package(Foo)
> >> set_package_properties(Foo ...)
> >> 
> >> But in solid we have:
> >> 
> >> find_program(BISON_EXECUTABLE bison) # ### Not find_package
> >> macro_log_feature(bison ...)
> >> 
> >> 
> >> Two ways out are:
> >> 
> >> * Add an equivalent feature to cmake
> >> * Add a FindBison.cmake and find the package.
> >> 
> >> 
> >> 
> >> Regardless of whether cmake is modified to make this easier, I think we
> >> should have a FindBison anyway.
> >> 
> >> What do you think?
> > 
> > What comes to my mind:
> > * FeatureSummary.cmake is the one file where I didn't document the
> > changes from MacroLogFeature.cmake yet
> > 
> > * is that maybe already possible
> > add_feature_info() could be used to do that I think.
> 
> Sort of/not really. It doesn't have URL or PURPOSE fields, so if I use that
> I'd have to format it manually to look consistent:
> 
> diff --git a/tier1/solid/solid/CMakeLists.txt
> b/tier1/solid/solid/CMakeLists.txt
> index c6c0b9f..02d435c 100644
> --- a/tier1/solid/solid/CMakeLists.txt
> +++ b/tier1/solid/solid/CMakeLists.txt
> @@ -413,13 +413,8 @@ set_package_properties(Flex PROPERTIES
>    )
> 
>  find_program(BISON_EXECUTABLE bison)
> -macro_log_feature(BISON_EXECUTABLE
> -   "Bison"
> -   "Allows the Solid predicate parser to be updated"
> -   "http://www.gnu.org/software/bison"
> -   FALSE
> -   ""
> -   "Required by the UpdateSolidPredicateParser target (mainly useful for
> developers)")
> +add_feature_info(Bison BISON_EXECUTABLE
> +   "Allows the Solid predicate parser to be updated,
> http://www.gnu.org/software/bison\n   * Required by the
> UpdateSolidPredicateParser target (mainly useful for developers)")
>  mark_as_advanced(BISON_EXECUTABLE)      # don't show it in the simple view
> in cmake-gui/ccmake
> 
> Notice how I inserted a newline some spaces and a *, to be consistent with
> what the module *currently* looks like.
> 
> > * how should using find_program/library/file/path() be interpreted as
> > opposed to using find_package() ?
> 
> I think it might be enough to add PURPOSE and URL to add_feature_info.

Hmm. The idea for this was that this is used for optional things which can be 
enabled and disabled by the user, more or less independent from packages.
For that PURPOSE and URL doesn't make sense.
 
> > One could argue that find_program() and friends are only for looking for
> > implementation details, which should not be major features which need to
> > be represented to the user at the end of the cmake run.
> > And in general, having a FindBison.cmake sounds good.
> 
> Ok, lets create one then. Should it be in cmake or ECM?

I just checked, there is a FindBISON.cmake in cmake, since quite some time.

Alex


More information about the Kde-buildsystem mailing list