On Tuesday 13 March 2012, Brad King wrote: > On 3/13/2012 5:10 PM, Alexander Neundorf wrote: > > Regarding the error: I think (didn't check) right now cmake doesn't > > complain if I list a component multiple times: > > > > find_package(Foo COMPONENTS bar blub bar) > > I don't think it does. > > > If it doesn't, then I'd say > > > > find_package(Foo COMPONENTS bar blub OPTIONAL_COMPONENTS bar) > > > > maybe also should not lead to an error. > > It is a new option so we can have new behavior ;) > > It can simply be an error to be in BOTH but not to repeat in one > or the other. > > -Brad
This is now in the ImprovedCOMPONENTSSupportInFindPackage2 branch on stage. It adds an OPTIONAL_COMPONENTS option to find_package(). It adds an option HANDLE_COMPONENTS to FPHSA(), so FPHSA() checks whether all requested required components have been found (doing this by default might break existing find-modules). It adds a macro check_required_components() to @PACKAGE_INIT@, configured using configure_package_config_file() It also adds documentation and testing. Listing a component both as COMPONENT and as OPTIONAL_COMPONENT is not allowed, cmake errors out then (3f9acd827da99ca581). I'm not sure this is good, maybe this list is created programmatically using dependent components, so maybe both a required and an optional component require and additional component, which is then maybe handed down to a find_package(NO_MODULE) call. Then we would have duplicated entries. I'd prefer "required overrides optional". Please review. Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers