Jan Woetzel wrote:
> Hi CMates,
> 
> (1)
> can I retrieve a list with all components listed after REQUIRED, e.g.
> FIND_PACKAGE(Foo REQUIRED component1   component2 ... )
> -->
> component1; component2 ?

No

> I want to use it in FindFoo.cmake with
> Foo_FIND_REQUIRED_component1
> to handle arbitrary components (unknown to teh Find scripts and handled 
> through macros).

FIND_XXXX(FOO_COMPONENT1 ....)
IF(NOT Foo_FIND_QUIETLY)
  MESSAGE(STATUS "Found component1 ${FOO_COMPONET1}")
ELSE()
  IF(Foo_FIND_REQUIRED_component1)
    MESSAGE(FATAL_ERROR "Missing component1")
  ENDIF()
ENDIF()

> 
> (2) QUIET actually overrides REQUIRED and suppresses the components 
> _FIND_REQUIRED setting.
> I think this is not correct.
> QUIET should just suppress the verbosity of the Find script complains 
> about missing libraries, right?
> No matter if finding QUIETLY or not - the REQUIRED settings are 
> mandatory to set correct _FOUND flags - thus a bug, right?
> See
> cmFindPackageCommand.cxx:75 ff
> 
> Jan

There is bug in a patch that I made to handle components. If we have the
QUIET argument in the end [FIND_PACKAGE(Foo REQUIRED Comp1 Comp2 QUIET)
] the quiet argument is ignored. I attached a fix.

-- 
Filipe Sousa
Index: cmFindPackageCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindPackageCommand.cxx,v
retrieving revision 1.18
diff -u -r1.18 cmFindPackageCommand.cxx
--- cmFindPackageCommand.cxx    10 May 2006 19:46:45 -0000      1.18
+++ cmFindPackageCommand.cxx    8 Jul 2006 09:55:35 -0000
@@ -75,10 +75,15 @@
       else if(args[i] == "REQUIRED")
         {
         required = true;
-        while (++i < args.size() && args[i] != "QUIET")
+        while (++i < args.size())
           {
-          std::string req_var = Name + "_FIND_REQUIRED_" + args[i];
-          this->Makefile->AddDefinition(req_var.c_str(), "1");
+            if (args[i] == "QUIET")
+              {
+                --i;
+                break;
+              }
+           std::string req_var = Name + "_FIND_REQUIRED_" + args[i];
+           this->Makefile->AddDefinition(req_var.c_str(), "1");
           }
         }
       else

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to