On 02/11/2013 12:32 PM, Alexander Neundorf wrote:
> So the exported targets file should do something like the following ?
> 
> set(failWithError FALSE)
> cmake_policy(GET CMP00xy POLICY_SET_TO_NEW)
> if("${POLICY_SET_TO_NEW}" STREQUAL "NEW")
>    set(Foo_FOUND FALSE);
>    set(Foo_NOT_FOUND_MESSAGE "Foo not found because some target is missing")
> else()
>    message(STATUS "Foo may not work because some imported target is
>                    currently still missing")
> endif()

In order to make sure it (silently) works in older CMake versions
and that there is no warning for OLD behavior:

if(POLICY CMP00xy)
  cmake_policy(GET CMP00xy cmp00xy)
  if("${cmp00xy}" STREQUAL "NEW")
     set(Foo_FOUND FALSE)
     set(Foo_NOT_FOUND_MESSAGE "Foo not found because some target is missing")
  elseif(NOT "${cmp00xy}" STREQUAL "OLD")
     message(STATUS "Foo may not work because some imported target is
                     currently still missing")
  endif()
endif()

-Brad
--

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

Reply via email to