On Friday 21 September 2012, Alexander Neundorf wrote: > On Thursday 20 September 2012, Brad King wrote: > > On 09/20/2012 12:20 PM, Alexander Neundorf wrote: > > > if(NOT TARGET Foo) > > > > > > if(CMAKE_FIND_PACKAGE_NAME) > > > > > > set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE) > > > > What happens if other imported targets have already been defined? > > Then the targets file will have been partially loaded. > > Yes. > Is this a problem ? > > If some find-module searches several libraries, and finds only some of > them, those FOO_LIBRARY variables which have been found also stay set, and > are not reset, but the overall result is NOTFOUND. > > > > set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE > > > > > > "The required target Foo does not exist !") > > > > > > else() > > > > > > message(STATUS > > > > > > "Warning: the required target Foo does not exist !") > > > > > > endif() > > > > > > endif() > > > > > > > > > or SEND_ERROR or FATAL_ERROR ? > > > > I think FATAL_ERROR. It is always easier to lessen this later. > > Ok.
This is now in the export-sets-2 branch on stage, including a basic test. Comments ? Ok to merge into next ? 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