From kde-buildsystem Wed Jun 17 20:10:52 2009 From: Alexander Neundorf Date: Wed, 17 Jun 2009 20:10:52 +0000 To: kde-buildsystem Subject: Re: find_package(Foo REQUIRED) Message-Id: <200906172210.53160.neundorf () kde ! org> X-MARC-Message: https://marc.info/?l=kde-buildsystem&m=124526958130370 On Wednesday 17 June 2009, Allen Winter wrote: > On Tuesday 16 June 2009 5:36:14 pm Alexander Neundorf wrote: > > On Tuesday 16 June 2009, Allen Winter wrote: > > > Howdy, > > > > > > Maybe this should be a feature of cmake itself.. but I wish for > > > find_package(Foo REQUIRED) to print a nicer message > > > if Foo is not found. > > > > > > We have the macro_log_feature() stuff for the optional packages > > > which creates the nice summary at the end of the cmake run, > > > but when required FOO is not found all we get is a terse error and > > > quit. > > > > > > I wonder.. can we overload find_package() with a COMMENT option? > > > i.e. > > > find_package(Foo REQUIRED COMMENT "Foo is a critical library and this > > > software cannot be build without it. Please install Foo > > > version 2.9 or higher") > > > > > > and have the COMMENT printed on termination? > > > > > > Or maybe there is already something like this and I'm not seeing it? > > > > The second argument to find_package_handle_standard_args() can be > > either "DEFAULT_MSG", then the default message is printed, or it can be a > > custom message. I think this should be good enough ? > > But until now nobody inserted custom messages there. > > Not quite good enough because most of the REQUIRED FindFoo.cmake's > are not ours -- they belong to CMake itself. Also there improved messages can be committed. > > > find_package(Foo REQUIRED COMMENT "Foo is a critical library and this > > > software cannot be build without it. Please install Foo > > > version 2.9 or higher") The first sentence is quite generic, having a modified default error message should be no problem. Can you send a patch for FindPackageHandleStandardArgs.cmake ? The second sentence is still relatively generic with some additional information. Let's see. Alex _______________________________________________ Kde-buildsystem mailing list Kde-buildsystem@kde.org https://mail.kde.org/mailman/listinfo/kde-buildsystem